MarkdownDoc
A Java tool/maven plugin/library to generate HMTL and PDF from markdown text intended for project documentation. Supports JSON based "stylesheet" for PDFs.
Install / Use
/learn @tombensve/MarkdownDocREADME

Copyright (C) 2012 Natusoft AB
Version: 3.1.11
Author: Tommy Svensson (tommy@natusoft.se)
The below CI status seem to have some problems. It builds perfectly fine for me. Right now I don't have the time to look into this.
A tool for generating HTML and PDF from markdown for the purpose of documentation.
There are no new changes to the code! There is however a change in versions to adapt to my new personal version number standard:
major.minor.bytecode
Binaries
Binaries are available at:
<repositories>
<repository>
<id>repsy</id>
<name>My Private Maven Repository on Repsy</name>
<url>https://repo.repsy.io/mvn/tombensve/natusoft-os</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repsy</id>
<name>repsy</name>
<url>https://repo.repsy.io/mvn/tombensve/natusoft-os</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
This is a free repo (for open source binaries). This will remain after I no longer can do this.
My old repo at my web server is already gone.
JDK version support
MarkdownDoc is now upgraded to Groovy 4.0.1 producing JDK 11 bytecode by default.
It is now also, since Groovy 4, possible to specify which level of bytecode to generate by groovy code. Currently 11 is specified: <byte-code>11</byte-code> in top pom. I have tested JDK 17 also, and it works fine.
In my maven repo (see above) there is also a 3.1.0_17 version available. This is compiled to JDK 17 bytecode.
Everything but the maven plugin is now done in Groovy. This so that when the byte code version specified in <byte-code>11</byte-code> in the root POM is changed and an mvn clean install is done, then all code will be compiled to that byte code level.
Licenses
<!-- Created by CodeLicenseManager -->Project License
Apache Software License version 2.0
Third Party Licenses
Apache Software License version 2.0
The following third party products are using this license:
<!-- CLM -->Version history
About versions, they are hell! After personal experience of having different versions for each module / produced jar which was close to impossible to keep track of which was compatible with which, I decided to go with just one and the same version for all modules of the tool. This has the side effect of changes in any submodule, even the editor, which probably not everyone uses, will change the version for all even though no changes have been done for some modules. What have changed for each version is documented below so that you can determine if upgrading to the latest version is wanted/needed or not.
3.1.11
-
Adapted to my new version standard of: major.minor.bytecode.
-
Documentation fixes.
Only non functional fixes.
3.1.0
Now uses Groovy 4 and produces JDK 11 bytecode. There is also a 3.1.0_17 version available in my repo which have JDK 17 bytecode.
3.0.1
Small bugfixes.
Now also automatically tries to convert an http:// URL to an https:// URL if the first returns a 301.
3.0.0
Now built with Groovy 3.0.7. Groovy 3 produces 1.8 bytecode, while 2.5 produced 1.5 bytecode! I thought that this warranted a bump of first version number. That said, this should not cause any problems as long as minimum is 1.8. I can't imagine anyone running a JVM lower that 1.8 today.
2.1.5
No functional change other than dropping files on editor window is no longer supported since it required a library that is not mine and was included, checked in with source, and not an optimal solution. I also suspect that there are very few people other than myself that uses the editor.
Fixed dependencies so that it will now build cleanly from checkout.
2.1.4
Added possibility to specify @PDFMSS(path) in document comment to override default mss for document. This will also work in the Editor which currently does not support specifying an MSS file. A bit of a lazy workaround.
Also added "Grey" to default.mss with same color as "Gray". There seems to be 2 spellings of this color.
2.1.3
The colors in the default.mss file are copied from the X11 color names, which starts with capitals. I then screwed up by specifying color "grey" for "horizontal_ruler" in default.mss. My bad!
I considered making color names case-insensitive, but when looking at it realized that it can have more side effects than what this did.
Anyhow, this version only fixes this!
2.1.2
Github security alert fix for PDFBox version 2.0.6 -> 2.0.15,. Maven have downloaded 2.0.16 so I guess that is the latest version at this moment.
2.1.1
ithub security alert fix for PDFBox.
2.1.0
New features
I recently had to deal with rather bad PDF generating code to produce letters at work. I thought, "woudn't it be nice if I could produce such with just easy markdown text and some MSS settings!". This tool was made to write and generate documentation. Letters and reports have different layout requirements that MDD did not support. But I realized that 3 rather easy small changes could improve this. They are listed below. It is too late to do anyting with the work code, but I already suspect that others are using MDD for such purposes, so these small features might help produce non documentation layouts. That also goes for the <!-- @PB --> described below.
Page margins anywhere in document section.
Page margins are now allowed anywhere in the document section of an MSS, not just for the top part. So now page margins can be changed for different formats and for divs. The left and right margins are of course the most useful here. Changeing top and bottom will only have an effect on the next page.
"freeFloating" MSS style.
This is a very special (and use at your own risk) feature that needs to be used with great care! It allows for placing text anywhere on a page.
The only sensible use of this is within a div. It allows for changeing X & Y on the page and page margins (see above) can also be changed in same div. It makes sense to set leftMargin to X coordinate.
Read the docs for more information about this feature.
"paragraphSpace" MSS attribute.
This sets the space between paragraphs. Defaults to 10pt. Previously the space between paragraphs where created by doing an extra newline. The space created by a newline is affected by the current font size. That is no longer the case. Thereby there can be slight differences when generating with this version.
If generating report or letters where short texts are wanted under each other without empty lines between them, like an address to be shown in an envelope window for example, this can be set to 0.0pt within a div. In the markdown you have to have each line as a separate paragraph, but when generating PDF they will be as expected.
Bug fix
For sublist the first sublist entry had same indentation as parent list, and the second entry and down had the correct indentation. This must have been for a while, I'm not sure how I missed it. Anyhow, this is now fixed.
Update to documentation
There has been a feature to do <!-- @PB --> or <!-- @PageBreak --> (on their own line) since a while back. This has not been mentioned in the documentation. This is now documented under the "Markdown Reference" section as MarkdownDoc special feature.
2.0.3
Fix of clumsy NPE bug in editor open files dialog.
2.0.2
Upgrade of PDFBox from 2.0.2 to 2.0.6 which fixes the latest problem in the "Special language characters not rendered to PDF" issue. It now only warns for "INFO: font subset is empty" instead of throwing an exception, and produces a result. This was a problem for some external ttf fonts.
2.0.1
This is yet another editor only update. The popup window for selecting loaded/open file to edit were quite bad. This have now been completely redone. Now a popup window pops upp to the left of the editor window and lists all open files, and some starting text from the file to make it easier to identify. An idea I borrowed from other tools.
2.0.0
PDFBox is now used instead of iText to generate PDF. This required some non backwards compatible changes so thereby the version is bumped to 2.0.0. Note that the incompatibilities are small, and most likely this version will work without changes for many.
-
Keywords are gone.
-
Footer is no longer supported. Can be added if enough wants it. I have had no use for it myself.
-
pageSize is no longer an option, but an MSS setting. This was a decision I made due to now being responsible for all rendering on the page and thus having more control over things like margins (now also settable in MSS), etc.
-
There is a difference in image types handled. iText supports JPEG, JPEG2000, GIF, PNG, BMP, WMF, TIFF, CCITT and JBIG2 images. I can't find a clear list of image types supported by PDFBox (which in general is bady documented, I had to use Stack Exchange a lot!), but from MarkdownDoc:s perspective those image types suppor
