Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ echo '# Hello' | md2mdhtml
md2mdhtml input.md > out.html
md2mdhtml --math=on input.md > out.html
md2mdhtml --math=dollars input.md > out.html
md2mdhtml --implicit_figures input.md > out.html
md2mdhtml --no-bare_autolinks input.md > out.html
md2mdhtml --implicit-figures input.md > out.html
md2mdhtml --no-bare-autolinks input.md > out.html
```

`md2html` goes the rest of the way, lowering that fragment to a finished HTML page: references baked, headings and captions numbered, code highlighted (```` ```markdown ```` fences by mdhtml itself, everything else by the optional fastpylight extra), mustache tokens shown as styled pills, and the assets those features need (`dialect_css`, light and dark fastpylight themes, KaTeX plus `math_js`) composed into the page. With no `--out` it writes the page under `~/.cache/md2html/` and opens it in a browser, inlining local images so the page renders from anywhere; piped, it writes to stdout instead, and `--out -` forces that even at a terminal. `--fragment` emits the body alone. `--frontmatter` recognizes a leading metadata block (see below), and ```mermaid fences become diagrams drawn in place by mermaid.js. References default to `--refs=ids`, which shows each reference's target id and never fails on a draft; `--refs=resolve` numbers them and raises on a broken one, and `--refs=lenient` numbers what it can and warns about the rest.
Expand All @@ -87,7 +87,7 @@ md2mdhtml --no-bare_autolinks input.md > out.html
md2html input.md
md2html examples/sample.md
md2html --refs=lenient draft.md
md2html --number_headings=legal --toc input.md --out out.html
md2html --number-headings=legal --toc input.md --out out.html
md2html --theme=onedark --hl=api input.md --out -
```

Expand Down
4 changes: 2 additions & 2 deletions tests/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def test_cli_reads_markdown_from_stdin():
assert_html(res.stdout, "<h1>Hello</h1>")
assert res.stderr == ""

res = subprocess.run(["md2mdhtml", "--implicit_figures"],
res = subprocess.run(["md2mdhtml", "--implicit-figures"],
input="# Hello\n\n![A picture](pic.png)\n", text=True, capture_output=True, check=True)
assert_html(res.stdout, '<h1>Hello</h1><figure><img src="pic.png" alt=""><figcaption>A picture</figcaption></figure>')

Expand All @@ -774,7 +774,7 @@ def test_cli_defaults_to_bracket_math():


def test_cli_can_disable_bare_autolinks():
res = subprocess.run(["md2mdhtml", "--no-bare_autolinks"], input="https://example.com\n",
res = subprocess.run(["md2mdhtml", "--no-bare-autolinks"], input="https://example.com\n",
text=True, capture_output=True, check=True)
assert_html(res.stdout, "<p>https://example.com</p>")

Expand Down