-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: markdown parsing #559
feat: markdown parsing #559
Conversation
Using the showdown javascript parser to convert the text as Markdown to HTML.
Add the showdown dependency. Probably include the source in the project.
From what I can see this loads a JS MD parsing library and converts any MD present in the Documentation field in the HTML Report. I guess that's one approach, the other being to natively convert any MD via a Java library at the point of export. But as you say, "I've chosen the easy Javascript route, rather than the (for me) complicated Java route." So this would not work for Jasper. @jbsarrodie is working on a new HTML report, and it might be better to have a more rounded solution combining MD support natively. But...you could distribute your report template as well. |
Indeed that is the solution I came up with. Building it into Java seems better. That'll take me more time and effort to come up with a contribution. For that I have some additional questions:
Perhaps there is a WYSIWYG editor available for Java that can be included. @jbsarrodie is working on a new HTML report, and it might be better to have a more rounded solution combining MD support natively. But...you could distribute your report template as well. Where can I view this work? Or what can I expect from this? Will it just put the documentation at a different location, or will there be a significant change in technology and structure? |
So if I understand correctly, that would require modifying the archi/com.archimatetool.jasperreports/src/com/archimatetool/jasperreports/data/FieldDataFactory.java Lines 70 to 73 in 288941b
And as used in archi/tests/com.archimatetool.csv.tests/src/com/archimatetool/csv/importer/CSVImporterTests.java Line 119 in 3c9f421
So either there would need to be an option for getting it as parsed Markdown, or a custom function. Can Jasper Report deal with HTML data? In that case the HTML output can be used in both cases. There is a variety of Java libraries for dealing with Markdown files: https://stackoverflow.com/questions/19784525/markdown-to-html-with-java-scala Also for the UI inspiration can be drawn from Eclipse plugins like https://github.com/satyagraha/gfm_viewer |
Hi, My 2cts on this... I personally like the idea of being able to use markdown in several places, but this has to be made optional, or else we'll impact reports for everyone. You can find here the ideas I'm collecting for a new HTML export. This does not details my ideas around markdown though, so in short, here's how I see it:
|
If MD is supported we need:
|
BTW - HTML already has a previewer - the inbuilt Browser component as this is used when creating hints for Canvas objects. |
Check, thanks for the input. I'll see if I can contribute a Java-based Markdown renderer. I think this PR can be closed as a Java based solution is preferred. |
This is a work-in-progress pull request to tackle #293
I've chosen the easy Javascript route, rather than the (for me) complicated Java route. As a result the Markdown parsing is not present in the Archi UI itself, or in Jasper reports.
I'm interested in your feedback.
The results of this change: