I have added the possibility to set the node level by adding a icon with a number. So for example if a node is at level 3 because of it's position but contains the icon number with '2' on it, then in the html it will be shown as a level 2 section.
For now the icons by default are:
Dark-2
Dark-3
Dark-4
You can set any of those to any nodes to change their level.
As of now the children of nodes will not change level automatically according to the parent where such an icon was added, so they will need to be set too.
The new version is here and the documentation is also change to explain that:
"Inline Image" refers to a very useful add-on to insert the image into the detai of the node. All my images use this method -- I have a macro in Macro Express that sends the keystrokes in the correct order with pauses. The key reason I recall using this method is the Export Branch to HTML included the images whereas the seeded images did not. Interestingly, it appears to be the opposite for your rendition. Thanks, Ryan
I don't use this add-on. The fastest way of inserting image I found is by drag-n-dropping them.
The reason I think you insert images in details is to be able to hide them. But I have this small script (see attachment) that show/hides images added by drag-n-drop. Please try it, you may not need the addon after.
I have added icons (partial) support to the script as was requested earlier. So now you can insert icons, and they will be show in the table of contents as well as in the content of the html document created.
The demo map document is modified with some examples and explanation on the support limitations.
Dear Alexandre
in attachment you will find zip file. In zip file are mm and all pictures for this mm.
I used last version of MapToHtmlDoc.groovy, but i don't see any pictures in html file.
1.Could you help me with my problem, please?
2.Could you add support for SVG files?
By design the images are not shown at the header levels h1, h2, h3, h4. They are visible inside those. So your map images could be child nodes of WITHOUT SLIT, POKETS etc for example. This level and levels below that would display the images.
The h1 node is the root node (the title). Then you have h2, h3, h4. You can have any of them empty one after another and then put your images after that.
Also you should put the full path to the images starting from c:... or d:... I didn't thought of supporting relative paths yet as I always use absolute paths.
Alexandre
Last edit: Alexandre 2017-10-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It works if the format is added with the "Edit node core in dialog".
Menu Edit > Node core > Edit node core in dialog
I have a mapping to show it (ctrl+backspace)
I don't use much the format panel. I tried with it and the style is not retained like you said. I don't know the difference in the map, I would need to check that. It doesn't work with the format toolbar as well.
For now you may want to use "Edit node core in dialog".
"But there is a limitation. The color and size are only retained if they are added using the Menu Edit > Node core > Edit node core in dialog feature. The format is not retained if it is changed using the toolbar or the format panel. I will try to fix that in a next version, for now please use Edit node core in dialog or ctrl+b (for bold) ctrl+r (for red) etc these are working also."
Thanks,
Alexandre
Last edit: Alexandre 2017-10-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did a test and the formatting done by the format panel is different from the formating done by the Edit node core in dialog.
The Edit node core in dialog generate a richcontent tag which contains basically a html document. The script extracts the html from it and inserts it in the output document. But it cannot do that with the formatting from the panel because it is not html. So some kind of conversion would need to be done or maybe freeplane as something available already, I would need to check for that.
// ###############################################
// # Node formatted with the Edit node core in dialog
// ###############################################
<nodePOSITION="right"ID="ID_103219600"CREATED="1508925594099"MODIFIED="1508925676915"><richcontentTYPE="NODE"><html><head></head><body><p><fontsize="6"><b>Dialog</b></font> <fontcolor="#33ff00">format</font></p></body></html></richcontent><edgeCOLOR="#ff0000"/></node>
// ###############################################
// # Node formatted with the format panel
// ###############################################
<nodeTEXT="Format panel"POSITION="right"ID="ID_701970045"CREATED="1508925603411"MODIFIED="1508925652571"COLOR="#990099"><edgeCOLOR="#0000ff"/><fontSIZE="22"/></node>
Best regards,
Alexandre
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have added support for formulas to the script as was requested earlier.
So one can enter a formula in the core text or in attributes and both will display their result in the html document.
I have added the 2 examples in the demo map.
This could be useful for example if you have a budget map (like I do) and want to save it to a file, view it on mobile or print it. In my budget map I have multiple attributes for many currencies that are calculated using formulas.
In the script, I also corrected a bug with the icons, when there was a icon that was not in one of the icons directories and files an empty image tag was added which was adding some kind of indentation to text were the icon couldn't be displayed.
Hi Alexandre, since you mentioned the ability to use formula, it led me to think about something similar of the same note. Similar to this unanswered [six-year-old question] (https://sourceforge.net/p/freeplane/discussion/758437/thread/5e621f6d/), I was wondering if it's possible to retain the rendered LaTeX upon export, which would be great to display more complex formulas.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I added basic support for Latex formulas in the maps. The formulas will be rendered as png files and added to the html document as images.
A latex formula in freeplane can contain text mixed with multiple latex statement delimited by $...$. For now the script will only render the first statement it finds, the rest is ignored.
Also a library is needed to render the latex, jlatexmath-1.0.6.jar. This library should be copied in the Freeplane user lib path and the code to support latex should be un-commented (otherwise there would be errors because the library is not there by default).
I have added details in the demo map on usage and setup in the demo map, there is also a sample formula.
I don't have the latest Freeplane, so I googled and downloaded jlatexmath-1.0.6.jar, moved it to %appdata%\Freeplane\1.6.x\lib, and added %appdata%\Freeplane\1.6.x\lib to classpath, and the commented-in script worked like a charm, with a resulting html containing in-line-rendered image of LaTeX formula. Thanks again, Alexandre.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I added a new feature to the script. It now supports connectors.
So if you draw a connector from one node to another the script will create a link to that node and in the target node there will also be a link created to the source node.
To identify if it is a "in" (<) connector or "out" (>) connector I have used: < and >
There is a constant in the script call SHOW_CONNECTOR_DETAILS. If it is set to 'true' (by default) then there will be details about the connect shown beside the link. These details contain: The source node, the target node, the labels and the path to the source or target node. These details are displayed in the form of a textual arrow.
The demo map as a new connector section, and I added some sample connectors in the map to demo it.
I extended this feature just now with the possibility to IGNORE connector ends:
If the word 'IGNORE' is contained in a connector label, the link will not be created at the node where that label is located. And 'IGNORE' is found in the label in the middle, no link will be created at all (this can be useful if connectors are needed in the map but they are not needed in the html output).
I added yet another feature I wanted to add for some time: Breadcrumbs.
So now the paths in sections H2, H3 and optionally H4 can have the paths to their sections, and each part of the path is clickable to jump back these sections.
3 constants are added to the script to add and remove the breadcrumbs for the sections.
I added a 'next' (>>) and 'previous' (<<) links to the breadcrumbs to jump to the next or previous section of the same level. It makes navigation more easy, specially to go to the next and previous H2 sections. It is visible with H3 also by default and optional for H4.
I have started to add Markdown support in MapToHtmlDoc. So now the maps are exported to 2 files, 1 to html and the other one to markdown (.md). The export to markdown is optional and can be disabled by setting MARKDOWN = false.
There is still some issues with markdown support, so it is like in 'beta' or 'alpha' stage if I may say but at least 60% of the 'features' are working.
There is also another new feature added: The copying of linked files and images to the output directory.
This was required for markdown as links to the file system paths didn't work (on windows+firefox markdown plugin) so the files needed to be in the same directory as the markdown file.
I have added the possibility to enable this for html also. This can be useful because it is now possible to have a html document with all its linked files in the same place and it makes it easy to copy the files for example to a web server.
The files and images when copied are renamed to the name of the map + the name of the file + the id of the node + its extension.
By default the files will be copied now because markdown is enabled by default. If MARKDOWN = false then the files will not be copied unless
COPY_FILES_TO_OUT_DIR = true
COPY_IMAGES_TO_OUT_DIR = true
Also it is possible to reuse the files (not to copy them again) the next time the map is exported by setting:
@Field def OVERWRITE_IF_EXISTS = false
If set to true the files will be copied everytime the document is exported.
I wanted to support markdown because I see that it is a popular format now, but I see it can be more limited than html, I hope all feature could be implemented properly in markdown.
I have updated the demo map but there is still some documentation to do.
It crossed my mind something like this severall nights: have a script to
upload-and-publish as html a certain mindmap branch... do that I could
write my notes in freeplane and publish them as a blog in github... I was
trying to do it using jruby, jekyll and a GIT-java-lib... but didnt had
enough freetime to do it...
Then, shortly after, this script went public here on the mailing-list, and
looked in much better shape...
I can say that making the git add/commit/push from a script, looked mildly
easy with the javalib I was investigating... the auth to github was very
straightforward via https (hust user/pass) avoiding the mangling of
sdh-keys (and associated multiplatform annoyances)
Dont yet have much freetime but if anyone is interested in those notes I
can gladly share
If you send me the code I will check, it could be interesting to have the code uploaded to github from the script.
For now I have added a "Github Pages" node inside an IGNORE node (so it is not displayed) and it I just copy paste the "# Upload" branch into git bash.
See the screenshot.
Every map could have a similar branch with git commands.
I use such branches to manage git repositories.
I've found the notes - the git-java lib is called jgit and here was the relevant links to sample-code that I planned to reused, to basically emulate the minimum git commands: git clone https://xxxxx git commit -a -m 'some message' git push -u origin gh-pages
Authenticating to github using keys is more complex - a better/easier alternative seemed to be https, which only uses user/password. The following blog covers how to do it: http://www.codeaffine.com/2014/12/09/jgit-authentication/
Thanks I will try to integrate the code in the script to have it upload.
I was thinking that once the html document is created, there could be a message box asking if we want to upload to github.
The github site and settings would be set using constants in the script and if the password constant is not set then a input box would show to ask to enter it.
Eventually I was thinking to add the posibility to some of the constants from the script using attributes in the current node of the map (root note or another).
Thanks, this would make updating web pages much faster than having to copy paste to the console and enter the user/password.
Alexandre
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have added the possibility to set the node level by adding a icon with a number. So for example if a node is at level 3 because of it's position but contains the icon number with '2' on it, then in the html it will be shown as a level 2 section.
For now the icons by default are:
Dark-2
Dark-3
Dark-4
You can set any of those to any nodes to change their level.
As of now the children of nodes will not change level automatically according to the parent where such an icon was added, so they will need to be set too.
The new version is here and the documentation is also change to explain that:
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
Best regards,
Alexandre
Last edit: Alexandre 2017-10-15
"Inline Image" refers to a very useful add-on to insert the image into the detai of the node. All my images use this method -- I have a macro in Macro Express that sends the keystrokes in the correct order with pauses. The key reason I recall using this method is the Export Branch to HTML included the images whereas the seeded images did not. Interestingly, it appears to be the opposite for your rendition. Thanks, Ryan
https://sourceforge.net/projects/freeplane/files/addons/insertInlineImage/InsertInlineImage-v1.0.addon.mm/download
Hi Ryan,
I don't use this add-on. The fastest way of inserting image I found is by drag-n-dropping them.
The reason I think you insert images in details is to be able to hide them. But I have this small script (see attachment) that show/hides images added by drag-n-drop. Please try it, you may not need the addon after.
Best regards,
Alexandre
Hi All,
I have added icons (partial) support to the script as was requested earlier. So now you can insert icons, and they will be show in the table of contents as well as in the content of the html document created.
The demo map document is modified with some examples and explanation on the support limitations.
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
Best regards,
Alexandre
Dear Alexandre
in attachment you will find zip file. In zip file are mm and all pictures for this mm.
I used last version of MapToHtmlDoc.groovy, but i don't see any pictures in html file.
1.Could you help me with my problem, please?
2.Could you add support for SVG files?
Thanks in advanced
Kind regards
Have a nice day
Predrag Cuklin
Hi Predrag,
By design the images are not shown at the header levels h1, h2, h3, h4. They are visible inside those. So your map images could be child nodes of WITHOUT SLIT, POKETS etc for example. This level and levels below that would display the images.
The h1 node is the root node (the title). Then you have h2, h3, h4. You can have any of them empty one after another and then put your images after that.
Also you should put the full path to the images starting from c:... or d:... I didn't thought of supporting relative paths yet as I always use absolute paths.
Alexandre
Last edit: Alexandre 2017-10-17
Hi!
Thank you for your work!
But when I tried it, the color and size were not retained.
Are they only retained, when they NOT formatted from a style?
Hi KBreker,
It works if the format is added with the "Edit node core in dialog".
Menu Edit > Node core > Edit node core in dialog
I have a mapping to show it (ctrl+backspace)
I don't use much the format panel. I tried with it and the style is not retained like you said. I don't know the difference in the map, I would need to check that. It doesn't work with the format toolbar as well.
For now you may want to use "Edit node core in dialog".
I updated the demo map with comments on that limitation:
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
"But there is a limitation. The color and size are only retained if they are added using the Menu Edit > Node core > Edit node core in dialog feature. The format is not retained if it is changed using the toolbar or the format panel. I will try to fix that in a next version, for now please use Edit node core in dialog or ctrl+b (for bold) ctrl+r (for red) etc these are working also."
Thanks,
Alexandre
Last edit: Alexandre 2017-10-17
Hi KBreker,
I did a test and the formatting done by the format panel is different from the formating done by the Edit node core in dialog.
The Edit node core in dialog generate a richcontent tag which contains basically a html document. The script extracts the html from it and inserts it in the output document. But it cannot do that with the formatting from the panel because it is not html. So some kind of conversion would need to be done or maybe freeplane as something available already, I would need to check for that.
Best regards,
Alexandre
Hi All,
I have added support for formulas to the script as was requested earlier.
So one can enter a formula in the core text or in attributes and both will display their result in the html document.
I have added the 2 examples in the demo map.
This could be useful for example if you have a budget map (like I do) and want to save it to a file, view it on mobile or print it. In my budget map I have multiple attributes for many currencies that are calculated using formulas.
In the script, I also corrected a bug with the icons, when there was a icon that was not in one of the icons directories and files an empty image tag was added which was adding some kind of indentation to text were the icon couldn't be displayed.
Please find the latest version here:
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
Best regards,
Alexandre
Hi Alexandre, since you mentioned the ability to use formula, it led me to think about something similar of the same note. Similar to this unanswered [six-year-old question] (https://sourceforge.net/p/freeplane/discussion/758437/thread/5e621f6d/), I was wondering if it's possible to retain the rendered LaTeX upon export, which would be great to display more complex formulas.
Hi Luigi,
I added basic support for Latex formulas in the maps. The formulas will be rendered as png files and added to the html document as images.
A latex formula in freeplane can contain text mixed with multiple latex statement delimited by $...$. For now the script will only render the first statement it finds, the rest is ignored.
Also a library is needed to render the latex, jlatexmath-1.0.6.jar. This library should be copied in the Freeplane user lib path and the code to support latex should be un-commented (otherwise there would be errors because the library is not there by default).
I have added details in the demo map on usage and setup in the demo map, there is also a sample formula.
Please find the latest version here:
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
Best regards,
Alexandre
Last edit: Alexandre 2017-10-24
I don't have the latest Freeplane, so I googled and downloaded jlatexmath-1.0.6.jar, moved it to %appdata%\Freeplane\1.6.x\lib, and added %appdata%\Freeplane\1.6.x\lib to classpath, and the commented-in script worked like a charm, with a resulting html containing in-line-rendered image of LaTeX formula. Thanks again, Alexandre.
Hi All,
I added a new feature to the script. It now supports connectors.
So if you draw a connector from one node to another the script will create a link to that node and in the target node there will also be a link created to the source node.
To identify if it is a "in" (<) connector or "out" (>) connector I have used: < and >
There is a constant in the script call SHOW_CONNECTOR_DETAILS. If it is set to 'true' (by default) then there will be details about the connect shown beside the link. These details contain: The source node, the target node, the labels and the path to the source or target node. These details are displayed in the form of a textual arrow.
The demo map as a new connector section, and I added some sample connectors in the map to demo it.
Please find the latest version here:
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
Best regards,
Alexandre
Last edit: Alexandre 2017-11-07
I extended this feature just now with the possibility to IGNORE connector ends:
If the word 'IGNORE' is contained in a connector label, the link will not be created at the node where that label is located. And 'IGNORE' is found in the label in the middle, no link will be created at all (this can be useful if connectors are needed in the map but they are not needed in the html output).
Please find the latest version here:
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
Best regards,
Alexandre
Hi,
I added yet another feature I wanted to add for some time: Breadcrumbs.
So now the paths in sections H2, H3 and optionally H4 can have the paths to their sections, and each part of the path is clickable to jump back these sections.
3 constants are added to the script to add and remove the breadcrumbs for the sections.
By default it is set like this so the breadcrumbs are shown for h2 and h3 but not for h4.
Please find the latest version here:
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
Best regards,
Alexandre
I just fixed the notes in the gray boxes. It now keeps the indentation.
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
I added a 'next' (>>) and 'previous' (<<) links to the breadcrumbs to jump to the next or previous section of the same level. It makes navigation more easy, specially to go to the next and previous H2 sections. It is visible with H3 also by default and optional for H4.
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
I changed the link formats for the breadcrumbs previous and next and the connector links. Not a big change but looks better a little bit.
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
Hi,
I have started to add Markdown support in MapToHtmlDoc. So now the maps are exported to 2 files, 1 to html and the other one to markdown (.md). The export to markdown is optional and can be disabled by setting MARKDOWN = false.
There is still some issues with markdown support, so it is like in 'beta' or 'alpha' stage if I may say but at least 60% of the 'features' are working.
There is also another new feature added: The copying of linked files and images to the output directory.
This was required for markdown as links to the file system paths didn't work (on windows+firefox markdown plugin) so the files needed to be in the same directory as the markdown file.
I have added the possibility to enable this for html also. This can be useful because it is now possible to have a html document with all its linked files in the same place and it makes it easy to copy the files for example to a web server.
The files and images when copied are renamed to the name of the map + the name of the file + the id of the node + its extension.
By default the files will be copied now because markdown is enabled by default. If MARKDOWN = false then the files will not be copied unless
COPY_FILES_TO_OUT_DIR = true
COPY_IMAGES_TO_OUT_DIR = true
Also it is possible to reuse the files (not to copy them again) the next time the map is exported by setting:
@Field def OVERWRITE_IF_EXISTS = false
If set to true the files will be copied everytime the document is exported.
I wanted to support markdown because I see that it is a popular format now, but I see it can be more limited than html, I hope all feature could be implemented properly in markdown.
I have updated the demo map but there is still some documentation to do.
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDoc.groovy
https://raw.githubusercontent.com/viaa/FreeplaneScripts/master/MapToHtmlDocDemoMap.mm
https://viaa.github.io/MapToHtmlDocDemoMap.html
Best regards,
Alexandre
Last edit: Alexandre 2017-11-20
Hey,
I have uploaded the demo map rendered as html to github:
https://viaa.github.io/MapToHtmlDocDemoMap.html
With github pages and the script it is easy to create a web page or a web site from Freeplane.
You need to enable the copy of files and images and upload everything, so:
COPY_FILES_TO_OUT_DIR = true
COPY_IMAGES_TO_OUT_DIR = true
The git commands I used are:
Here are tutorials to create the website repositories:
https://www.youtube.com/watch?v=3jt-J4Rc__M
https://guides.github.com/features/pages/
I will document that in the next demo map.
Best regards,
Alexandre
Last edit: Alexandre 2017-11-21
It crossed my mind something like this severall nights: have a script to
upload-and-publish as html a certain mindmap branch... do that I could
write my notes in freeplane and publish them as a blog in github... I was
trying to do it using jruby, jekyll and a GIT-java-lib... but didnt had
enough freetime to do it...
Then, shortly after, this script went public here on the mailing-list, and
looked in much better shape...
I can say that making the git add/commit/push from a script, looked mildly
easy with the javalib I was investigating... the auth to github was very
straightforward via https (hust user/pass) avoiding the mangling of
sdh-keys (and associated multiplatform annoyances)
Dont yet have much freetime but if anyone is interested in those notes I
can gladly share
On 20 Nov 2017 22:26, "Alexandre" alexandreviau77@users.sf.net wrote:
Hi Zipzap,
If you send me the code I will check, it could be interesting to have the code uploaded to github from the script.
For now I have added a "Github Pages" node inside an IGNORE node (so it is not displayed) and it I just copy paste the "# Upload" branch into git bash.
See the screenshot.
Every map could have a similar branch with git commands.
I use such branches to manage git repositories.
Best regards,
Alexandre
Last edit: Alexandre 2017-11-21
I've found the notes - the git-java lib is called jgit and here was the relevant links to sample-code that I planned to reused, to basically emulate the minimum git commands:
git clone https://xxxxx
git commit -a -m 'some message'
git push -u origin gh-pages
https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepositoryWithAuthentication.java
Authenticating to github using keys is more complex - a better/easier alternative seemed to be https, which only uses user/password. The following blog covers how to do it:
http://www.codeaffine.com/2014/12/09/jgit-authentication/
Here is a very simple intro to using jgit (emulate git commands):
http://www.codeaffine.com/2015/12/15/getting-started-with-jgit/
Didnt get to write code, but from the "design-study" this looked like the easiest way to go.
BR
Last edit: zipizap 2017-11-24
Hi Zipzap,
Thanks I will try to integrate the code in the script to have it upload.
I was thinking that once the html document is created, there could be a message box asking if we want to upload to github.
The github site and settings would be set using constants in the script and if the password constant is not set then a input box would show to ask to enter it.
Eventually I was thinking to add the posibility to some of the constants from the script using attributes in the current node of the map (root note or another).
Thanks, this would make updating web pages much faster than having to copy paste to the console and enter the user/password.
Alexandre