Comments (22)
I have recently used plantuml heavily on both Linux and Windows especially with 1.2023.3 and 1.2023.5. I will document the behaviour in a few days.
from scripts.
Of course!
There are also script methods to check the OS if you need to do things differently on different OSes.
from scripts.
from scripts.
Is there any useful log output if you enable the log panel (see Window / Panels)? Please make sure you also enable debug logging in the log panel (by right-clicking on the panel and and selecting Debug
in Options
).
from scripts.
Log panel output with all options enabled:
[08:22:57] [debug] on_noteTreeWidget_itemSelectionChanged
[08:22:57] [debug] setCurrentNote - 'note': Note: <id>489 <name>"test" <fileName>"test.md" <noteSubFolderId>10 <relativePath>"learning/architecture-and-design" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': false
[08:23:03] [debug] added to history: NoteHistoryItem: <noteName>"test" <noteSubFolderPathData>"learning\narchitecture-and-design" <cursorPosition>28 <relativeScrollBarPosition>0
The debug log does not seem to contain any action either:
[Jan 24 08:27:39] [debug]: Set proxy configuration to use NO proxy
[Jan 24 08:27:42] [scripting]: loading script file: C:/Users/animesh/AppData/Roaming/PBE/QOwnNotes/scripts/list-maker/list-maker.qml
[Jan 24 08:27:42] [scripting]: loading script file: C:/Users/animesh/AppData/Roaming/PBE/QOwnNotes/scripts/sort-lines/sort-lines.qml
[Jan 24 08:27:42] [scripting]: loading script file: C:/Users/animesh/AppData/Roaming/PBE/QOwnNotes/scripts/render-plantuml/render-plantuml.qml
[Jan 24 08:27:42] [debug]: initShortcuts - 'menuBarIsVisible': true
[Jan 24 08:27:42] [debug]: cloudConnection: CloudConnection: <id>1 <name>"Default" <serverUrl>"" <username>"" <priority>1
[Jan 24 08:27:42] [debug]: buildNotesIndex - 'noteSubFolderId': 0
[Jan 24 08:27:42] [debug]: storing note file: "test.md"
[Jan 24 08:27:42] [debug]: stored note: Note: <id>489 <name>"test" <fileName>"test.md" <noteSubFolderId>10 <relativePath>"learning/architecture-and-design" <hasDirtyData>false
[Jan 24 08:27:42] [debug]: storeUpdatedNotesToDisk - 'count': 1
[Jan 24 08:27:42] [status]: Stored 1 note(s) to disk
[Jan 24 08:27:43] [debug]: setupNoteFolderTables - 'database version': 14
[Jan 24 08:27:43] [debug]: cloudConnection: CloudConnection: <id>1 <name>"Default" <serverUrl>"" <username>"" <priority>1
[Jan 24 08:27:43] [debug]: loadNoteDirectoryList
[Jan 24 08:27:44] [debug]: reloadTagTree
[Jan 24 08:27:44] [debug]: reloadTagTree - 'noteSubFolderIds': QVector(10)
[Jan 24 08:27:44] [debug]: filterNotesByNoteSubFolders - 'noteSubFolderIds': QVector(10)
[Jan 24 08:27:44] [debug]: reloadNoteSubFolderTree
[Jan 24 08:27:44] [debug]: filterNotesByNoteSubFolders - 'noteSubFolderIds': QVector(10)
[Jan 24 08:27:44] [debug]: reloadNoteSubFolderTree
[Jan 24 08:27:44] [debug]: loadNoteDirectoryList
[Jan 24 08:27:44] [debug]: reloadTagTree
[Jan 24 08:27:44] [debug]: reloadTagTree - 'noteSubFolderIds': QVector(10)
[Jan 24 08:27:44] [debug]: filterNotesByNoteSubFolders - 'noteSubFolderIds': QVector(10)
[Jan 24 08:27:44] [debug]: reloadNoteSubFolderTree
[Jan 24 08:27:44] [debug]: filterNotesByNoteSubFolders - 'noteSubFolderIds': QVector(10)
[Jan 24 08:27:47] [debug]: on_noteTreeWidget_itemSelectionChanged
[Jan 24 08:27:47] [debug]: setCurrentNote - 'note': Note: <id>488 <name>"design-patterns" <fileName>"design-patterns.md" <noteSubFolderId>10 <relativePath>"learning/architecture-and-design" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': false
[Jan 24 08:27:47] [debug]: added to history: NoteHistoryItem: <noteName>"design-patterns" <noteSubFolderPathData>"learning\narchitecture-and-design" <cursorPosition>166 <relativeScrollBarPosition>0
[Jan 24 08:27:51] [debug]: on_noteTreeWidget_itemSelectionChanged
[Jan 24 08:27:51] [debug]: setCurrentNote - 'note': Note: <id>489 <name>"test" <fileName>"test.md" <noteSubFolderId>10 <relativePath>"learning/architecture-and-design" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': false
[Jan 24 08:27:51] [debug]: added to history: NoteHistoryItem: <noteName>"test" <noteSubFolderPathData>"learning\narchitecture-and-design" <cursorPosition>445 <relativeScrollBarPosition>0
from scripts.
Within the exported HTML, I see the path of the image like this:
<img src="file://C:\Users\animesh\programs\tmp/488_2.png?t=1611457999586" alt="Wait for it..">
This image does not exist in this path.
I opened the tmp folder side by side to see if anything is being generated when I enter new PlantUML script and nothing seems to get generated
from scripts.
Did some poking around with console logs 😅 in the qml file. I don't know if this effort is any worth, but I had some fun.
This is from the log panel:
[09:59:23] [debug] filePath: C:\Users\animesh\programs\tmp/488_1
[09:59:24] [debug] params to node: [-e,require('fs').writeFileSync('C:\Users\animesh\programs\tmp/488_1', "@startuml\nBob -> Alice: Hello!\n@enduml\n", 'utf8');]
[09:59:24] [debug] plantumlFiles: [C:\Users\animesh\programs\tmp/488_1]
[09:59:24] [debug] plantumlJarPath: C:\Users\animesh\programs\plantuml\plantuml.jar
The node command when executed with the params on the command line throws an error:
node -e require('fs').writeFileSync('C:\Users\animesh\programs\tmp/488_1', "@startuml\nBob -> Alice: Hello!\n@enduml\n", 'utf8');
[eval]:1
require('fs').writeFileSync('C:\Users\animesh\programs\tmp/488_1',
SyntaxError: Unexpected end of input
←[90m at new Script (vm.js:88:7)←[39m
←[90m at createScript (vm.js:263:10)←[39m
←[90m at Object.runInThisContext (vm.js:311:10)←[39m
at Object.<anonymous> ([eval]-wrapper:10:26)
←[90m at Module._compile (internal/modules/cjs/loader.js:1158:30)←[39m
←[90m at evalScript (internal/process/execution.js:94:25)←[39m
←[90m at internal/main/eval_string.js:23:3←[39m
This command works however:
node -e require('fs').writeFileSync('C:\\Users\\animesh\\programs\\tmp\\4887',"11111111111",'utf8');
I suspect it has to do with how node handles path on Windows.
from scripts.
Hi,
I think there is problems with slashes with Windows. In the code it is probably here:
and here:
scripts/render-plantuml/render-plantuml.qml
Line 117 in 6e7b89a
I don't have Windows so I cannot test. But if you can try to modify the code, you should maybe try to use https://doc.qt.io/qt-5/qdir.html#toNativeSeparators. Since I did not write this code I am not sure about that!
from scripts.
There are scripting methods for separator conversion: https://www.qownnotes.org/scripting/methods-and-objects.html#converting-path-separators-to-native-ones
from scripts.
Hello @pbek and @Beurt, good day!
Apologies for the delay in responding to this issue. Today I got a chance to dig deeper than my previous attempt and after some testing got some progress. I realized that the workDir
is the first culprit.
After replacing single slashes with double slashes using regex replace, I see that the plantuml images got generated in the workDir
location.
var filePath = workDir.replace(/\\/gm,"\\\\") + "/" + note.id + "_" + (++index);
However, the markdown preview does not still display the images. The updatedHtml
is as follows:
<div><img src="file://C:\\Users\\animesh\\programs\\tmp/519_1.png?t=1618234319478" alt="Wait for it.."/></div>
<div><img src="file://C:\\Users\\animesh\\programs\\tmp/519_2.png?t=1618234319478" alt="Wait for it.."/></div>
and I can export the html and preview it in external browser just fine.
Kindly advise next steps.
from scripts.
I noticed that when I right click and copy the image path directly from the preview panel, the path shows up as //c/519_2.png
from scripts.
You can always export the raw html in the preview panel to debug the script code more easily.
from scripts.
Yes, I did that. As in the code snippet above, the raw html exported has the paths properly injected and I can open html file with plantuml images in Firefox.
from scripts.
- I'm not sure how file urls with url parameters like
file://C:\\Users\\animesh\\programs\\tmp/519_2.png?t=1618234319478
are handled. - Im not sure about backslashes neither...
best use an url schema like stated in https://en.wikipedia.org/wiki/File_URI_scheme
e.g. file:///c:/WINDOWS/clock.avi
(yes, 3 slashes at the beginning!)
from scripts.
Great, that fixed it.
If I can verify that it works on Linux and follow the contribution guidelines, can I raise a PR?
from scripts.
Hi @anmsh!
I've been working on some important changes on render-plantuml script. And, I just introduced on new PR (#158) that should solve your problem. It is working well on Linux. Can you Try on Windows?
from scripts.
I will check this @Beurt. Thank you.
from scripts.
This issue is stale because it has been open for 30 days with no activity.
from scripts.
This issue is stale because it has been open for 30 days with no activity.
from scripts.
This issue was closed because it has been inactive for 14 days since being marked as stale.
from scripts.
Apologies for not responding on time for this as specified on this issue.
Here are my observations on Windows 10, QOwnNotes 23.9.0, Support for plantuml plugin 0.1.5
Today I verified that it was working to my pleasant surprise. 😮😀
I have the plantuml-1.2023.5.jar
installed directly from the plantuml website.
Settings:
Path to plantuml jar:
C:/Users/animesh/programs/plantuml/plantuml-1.2023.5.jar
Working directory:
C:/Users/animesh/programs/tmp/plantuml/
Hide plantuml markup:
Yes
No need for @startuml/@enduml:
Yes
Image output format:
PNG
from scripts.
Thank you for testing 😉
from scripts.
Related Issues (20)
- When importing HTML pages, save absolute links (QOwnNotes) HOT 2
- Mermaid script isn't working HOT 15
- Toggle-checkbox script should support dashed checkboxes [-]
- Script "Paste HTML as GitHub Markdown" is using deprecated markdown_github. Replace with gfm HOT 6
- The Latex code can't display. HOT 11
- In Text-Highlights script is it possible to highlight in the editor? HOT 10
- latex-math runs wrong on my mac. I set the path to klatexformula correctly, but it still doesn't work. HOT 12
- Tab Sessions HOT 7
- export-notes-as-website doesn't appear to be working on Windows 11. HOT 3
- Is it possible to add enable script API access to a QCompleter popup? HOT 3
- No interface icon in Zotero script (icon svg file not downloaded from Github) HOT 3
- Script Repository broken HOT 4
- Missing library QtQuick.Layouts HOT 3
- Android App & Syncing Available ??? HOT 3
- [BUG] PlantUML svg image output does not display HOT 31
- latex-math displaying rendered formula very wide HOT 1
- [SUPPORT] Script to create local backups for the notes HOT 8
- [FEATURE] WYSIWYG
- [BUG] Highlighted text in dark mode is not legible. HOT 7
- [FEATURE] Color selector menu for text highlighter HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scripts.