Package org.ctan.markup.gfm
Class GfmToHtml
java.lang.Object
org.ctan.markup.gfm.GfmToHtml
Converts GitHub Flavored Markdown (GFM) to HTML using the commonmark-java
library.
Supported GFM features:
- Tables
- Strikethrough (~~text~~)
- Autolinks (bare URLs)
- Task list items (- [x] / - [ ])
- Named HTML entity translation via
NamedEntityExtension
Usage:
# Fragment (no HTML boilerplate): java -jar gfm-to-html.jar input.md # Full HTML document written to a file: java -jar gfm-to-html.jar input.md output.html
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a converter with all GFM extensions enabled, plus the default named-entity mappings (&TeX;,&LaTeX;,&BibTeX;). -
Method Summary
-
Constructor Details
-
GfmToHtml
public GfmToHtml()Constructs a converter with all GFM extensions enabled, plus the default named-entity mappings (&TeX;,&LaTeX;,&BibTeX;).
-
-
Method Details
-
process
Converts a GFM string to an HTML fragment (no<html>wrapper).- Parameters:
markdown- the GFM source text- Returns:
- the rendered HTML fragment
-