For a project that will soon be published on Github I have written an extensive README.md file (i.e. a Wiki Markdown file that will be converted to HTML and be shown on the home-page of the project).
Now I would like to display that same text also as Help when clicking a Help-button or -link from within the running application.
For that I see two options:
- when “help” is clicked it fires up the system’s default browser and directs it to the Github homepage of the project.
- “somehow” convert the README.md file to HTML and ship that together with the application. Then display that HTML-text using some HTML-widget within the application or again, firing up the browser and serving the HTML locally from the application.
What I don’t like with the 1st approach is, that the Github page also contains misc. Github’s project-related stuff (Code, Repositories, Issues, Pull-Requests, etc.), i.e. tons of stuff that are not relevant here when the page is being shown as help text.
The 2nd approach sounds simpler and better to me, since my app is Spring-boot based anyway, i.e. when I put an HTML-file into the application’s resource folder it can easily be served by the built-in HTTP-server.
Thus my question: how do I generate and save an HTML-file from the README.md file (in Github Markdown format) during the project build (I am using Maven as build-tool)?
I googled a bit but found no tool or editor that supports that (it would also be nice if it could be integrated with the build process, although that would not be a strict requirement – I wouldn’t mind if I occasionally had to do the conversion manually…).
In case that matters: the markdown file also references misc. pictures (.png-files). These will also need to be shipped with the application and need to be referenced by the generated HTML-file.
1
I hope I didnt missunderstand the question because its a really simple answer, but why not use a MD to HTML converter? I’ve recently used exactly this one for something similar.
https://codebeautify.org/html-to-markdown
If this isnt sufficent please specify why
2