Repository navigation
docs: clarify the Python and CLI options for file variables - #736
Merged
nicholasserra merged 2 commits intoOct 13, 2026
Merged
Conversation
Crozzers
reviewed
Oct 9, 2026
| $ markdown2 --use-file-vars foo.md > foo.html | ||
| ``` | ||
|
|
||
| In the Python API, pass `use_file_vars=True` to `markdown()`, `markdown_path()`, |
Contributor
There was a problem hiding this comment.
This example is a bit verbose, especially compared to the style of the other examples in the readme.
There is also an example for the CLI flag just above it. Maybe could be combined and shortened alot?
|
|
||
| ## python-markdown2 2.5.6 (not yet released) | ||
|
|
||
| - Clarify how to enable file variables in the Python API and command-line help (#269, #365). |
| * wavedrom: Support for generating Wavedrom digital timing diagrams | ||
| * xml: Passes one-liner processing instructions and namespaced XML tags. | ||
|
|
||
| Use --use-file-vars to enable extras declared in Emacs-style file variables |
Contributor
There was a problem hiding this comment.
This flag is documented with argparse, the user can see that when running python markdown2.py --help.
Doesn't need to be documented here, and also we don't document any of the other CLI flags or params passed to markdown here
Collaborator
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CLI help lists
use-file-varsas an extra, but passingextras=["use-file-vars"]does not enable file variables, as reported in #269 and #365.Remove the incorrect extras entry, and combine the CLI flag and Python API option in the existing README explanation. Keep the Emacs-style comment syntax and CLI example, and use the standard
[pull #736]changelog format. The CLI flag remains documented by argparse; parser behavior is unchanged.Validation: 288 tests passed with
make testone, all 7 ReDoS checks passed, and all 6 Python examples extracted from the README passed doctest. Also verified the three documented Python API forms, the CLI example, argparse help, andgit diff --check.AI-assisted contribution using OpenAI Codex.