From f999d6de7d8e1b9b33de0bd573bc22fabd035c26 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Thu, 27 Aug 2026 08:58:03 +1000 Subject: [PATCH] Update CLI flags for fastcore.script hyphenation --- README.md | 6 +++--- tests/test_python.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3cfc0b1..d278938 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 - ``` diff --git a/tests/test_python.py b/tests/test_python.py index 137c96c..6151a84 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -762,7 +762,7 @@ def test_cli_reads_markdown_from_stdin(): assert_html(res.stdout, "

Hello

") 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, '

Hello

A picture
') @@ -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, "

https://example.com

")