1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2025-12-10 22:12:45 +00:00

updated script

This commit is contained in:
Patrizio Bekerle 2017-05-20 13:04:53 +02:00
parent eb6e526fbc
commit a715f6df90
No known key found for this signature in database
GPG key ID: 2E9FFD770DABE838
5 changed files with 11 additions and 115 deletions

View file

@ -9,7 +9,6 @@ import QtQml 2.0
* https://github.com/2ion/pandoc-bbcode
*/
QtObject {
property string panbbcodePath;
property string pandocPath;
// register your settings variables so the user can set them in the script settings
@ -21,15 +20,12 @@ QtObject {
"type": "file",
"default": "pandoc",
},
{
"identifier": "panbbcodePath",
"name": "panbbcode path",
"description": "Please select the path to your <code>panbbcode.lua</code> executable:",
"type": "file",
"default": "/opt/scripts/panbbcode.lua",
},
];
// the path to the script's directory will be set here
property string scriptDirPath;
/**
* Initializes the custom action
*/
@ -51,6 +47,9 @@ QtObject {
// get the selected text from the note text edit
var text = script.noteTextEditSelectedText();
// get the path of the lua script
var panbbcodePath = scriptDirPath + script.dirSeparator() + "panbbcode.lua";
// you need pandoc and the BBCode writer from https://github.com/2ion/pandoc-bbcode
// to convert Markdown to BBCode
var params = ["-t", panbbcodePath, "-f", "markdown"];