Browser viewer CLI (viewmd)

Browser Markdown and notebook viewer CLI (viewmd) adding a theme picker, sticky table of contents, copy buttons, and collapsible sections.

main

def main(
    file:str=None, # Markdown file (or .ipynb notebook) to view (default: stdin)
    refs:mdhtml.md2html.RefsMode=<RefsMode.lenient: 'lenient'>, # References: target ids ('ids'), numbered ('resolve'), or numbered with ids as fallback ('lenient')
    number_headings:mdhtml.md2html.NumMode=None, # Heading numbering scheme (default: the frontmatter's `number_headings:`, else automatic)
    cite_style:str=None, # Citation style: author-year or numeric; None uses metadata
    hl:mdhtml.md2html.HlMode=<HlMode.spans: 'spans'>, # Code highlighting: classed spans, the Highlight API, or off
    auto_ids:bool=True, # Derive ids for headings
    implicit_figures:bool=True, # Promote image-only paragraphs to figures
    frontmatter:bool=True, # Strip leading `key: value` frontmatter into the page title and a metadata table
    fill:bool=False, # Instantiate the template from formdata, executing its participating code
    head:str=None, # File inlined into the page head: .css as <style>, .js as <script>, else raw HTML; repeatable
    *, math:mdhtml._cli.MathMode=<MathMode.brackets: 'brackets'>, # Math delimiters to recognize
    bare_autolinks:bool=True, # Autolink bare URLs and email addresses
):

Render Markdown (or a Jupyter notebook) to a page with the viewer UI, and open it in a browser