multimark 0.2.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {multimark-0.2.0 → multimark-0.4.0}/.github/CONTRIBUTING.md +23 -0
- {multimark-0.2.0 → multimark-0.4.0}/.github/workflows/ci.yml +60 -16
- multimark-0.4.0/.github/workflows/pyodide.yml +26 -0
- multimark-0.4.0/.github/workflows/test-build.yml +41 -0
- multimark-0.4.0/.github/workflows/test-sdist.yml +29 -0
- multimark-0.4.0/CITATION.cff +22 -0
- multimark-0.4.0/Makefile +58 -0
- {multimark-0.2.0/src/multimark.egg-info → multimark-0.4.0}/PKG-INFO +3 -3
- multimark-0.4.0/WHEELS.md +66 -0
- multimark-0.4.0/_freeze/reference/Options/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/reference/cmark_version/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/reference/markdown_to_commonmark/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/reference/markdown_to_html/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/reference/markdown_to_latex/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/reference/markdown_to_man/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/reference/markdown_to_xml/execute-results/html.json +12 -0
- {multimark-0.2.0 → multimark-0.4.0}/_freeze/site_libs/clipboard/clipboard.min.js +1 -1
- multimark-0.4.0/_freeze/user-guide/gfm-extensions/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/user-guide/installation/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/user-guide/introduction/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/user-guide/options-and-flags/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/user-guide/output-formats/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/user-guide/parsing-and-ast/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/user-guide/quick-start/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/user-guide/recipes/execute-results/html.json +12 -0
- multimark-0.4.0/_freeze/user-guide/security/execute-results/html.json +12 -0
- {multimark-0.2.0 → multimark-0.4.0}/great-docs.yml +12 -0
- multimark-0.4.0/multimark/_binding.c +3660 -0
- multimark-0.4.0/multimark/_binding.o +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/pyproject.toml +22 -2
- {multimark-0.2.0 → multimark-0.4.0}/setup.py +1 -0
- {multimark-0.2.0 → multimark-0.4.0}/skills/multimark/SKILL.md +48 -0
- {multimark-0.2.0 → multimark-0.4.0}/src/multimark/__init__.py +10 -0
- multimark-0.4.0/src/multimark/_batch.py +107 -0
- {multimark-0.2.0 → multimark-0.4.0}/src/multimark/_build_cmark.py +27 -0
- multimark-0.4.0/src/multimark/_node.py +623 -0
- multimark-0.4.0/src/multimark/_parser.py +280 -0
- multimark-0.4.0/src/multimark/cmark.cffi.h +159 -0
- {multimark-0.2.0 → multimark-0.4.0/src/multimark.egg-info}/PKG-INFO +3 -3
- {multimark-0.2.0 → multimark-0.4.0}/src/multimark.egg-info/SOURCES.txt +67 -1
- multimark-0.4.0/src/multimark.egg-info/scm_file_list.json +201 -0
- multimark-0.4.0/src/multimark.egg-info/scm_version.json +8 -0
- multimark-0.4.0/tests/test_ast.py +629 -0
- multimark-0.4.0/tests/test_batch.py +54 -0
- multimark-0.4.0/tests/test_parser.py +274 -0
- multimark-0.4.0/third_party/cmark-gfm/extensions/autolink.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/extensions/core-extensions.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/extensions/ext_scanners.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/extensions/strikethrough.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/extensions/table.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/extensions/tagfilter.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/extensions/tasklist.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/arena.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/blocks.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/buffer.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/cmark.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/cmark_ctype.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/commonmark.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/footnotes.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/houdini_href_e.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/houdini_html_e.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/houdini_html_u.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/html.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/inlines.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/iterator.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/latex.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/linked_list.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/man.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/map.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/node.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/plaintext.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/plugin.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/references.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/registry.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/render.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/scanners.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/syntax_extension.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/utf8.o +0 -0
- multimark-0.4.0/third_party/cmark-gfm/src/xml.o +0 -0
- multimark-0.4.0/user_guide/10-parsing-and-ast.qmd +193 -0
- multimark-0.2.0/Makefile +0 -31
- multimark-0.2.0/src/multimark/cmark.cffi.h +0 -54
- {multimark-0.2.0 → multimark-0.4.0}/.github/CODE_OF_CONDUCT.md +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/.github/ISSUE_TEMPLATE/bug.md +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/.github/ISSUE_TEMPLATE/feature.md +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/.github/ISSUE_TEMPLATE/question.md +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/.github/workflows/docs.yml +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/.gitignore +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/LICENSE +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/README.md +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/ROADMAP.md +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/_freeze/user-guide/performance/execute-results/html.json +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/assets/logo-dark.png +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/assets/logo-light.png +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/assets/logo.png +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/index.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/setup.cfg +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/src/multimark/_cli.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/src/multimark/_cmark.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/src/multimark.egg-info/dependency_links.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/src/multimark.egg-info/entry_points.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/src/multimark.egg-info/requires.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/src/multimark.egg-info/top_level.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/conftest.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/fixtures/extensions.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/fixtures/regression.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/fixtures/smart_punct.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/fixtures/spec.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/spec_parser.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_cli.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_commonmark.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_errors.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_extensions.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_html.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_latex.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_man.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_package.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_param_combos.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_pathological.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_regressions.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_spec_html.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_spec_renderers.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_threads.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/tests/test_xml.py +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/CMakeLists.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/autolink.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/autolink.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/cmark-gfm-core-extensions.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/core-extensions.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/ext_scanners.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/ext_scanners.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/ext_scanners.re +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/strikethrough.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/strikethrough.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/table.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/table.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/tagfilter.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/tagfilter.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/tasklist.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/extensions/tasklist.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/CMakeLists.txt +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/arena.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/blocks.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/buffer.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/buffer.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/case_fold_switch.inc +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/chunk.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/cmark-gfm-extension_api.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/cmark-gfm.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/cmark-gfm_export.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/cmark-gfm_version.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/cmark-gfm_version.h.in +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/cmark.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/cmark_ctype.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/cmark_ctype.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/commonmark.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/config.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/config.h.in +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/entities.inc +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/footnotes.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/footnotes.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/houdini.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/houdini_href_e.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/houdini_html_e.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/houdini_html_u.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/html.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/html.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/inlines.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/inlines.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/iterator.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/iterator.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/latex.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/libcmark-gfm.pc.in +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/linked_list.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/main.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/man.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/map.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/map.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/node.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/node.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/parser.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/plaintext.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/plugin.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/plugin.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/references.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/references.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/registry.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/registry.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/render.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/render.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/scanners.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/scanners.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/scanners.re +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/syntax_extension.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/syntax_extension.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/utf8.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/utf8.h +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/third_party/cmark-gfm/src/xml.c +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/00-introduction.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/01-installation.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/02-quick-start.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/03-gfm-extensions.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/04-output-formats.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/05-options-and-flags.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/06-cli.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/07-security.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/08-recipes.qmd +0 -0
- {multimark-0.2.0 → multimark-0.4.0}/user_guide/09-performance.qmd +0 -0
|
@@ -57,6 +57,29 @@ great-docs build
|
|
|
57
57
|
great-docs preview
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
### Testing Release Builds
|
|
61
|
+
|
|
62
|
+
Before cutting a release, you can dry-run each part of the build pipeline using manually triggered workflows. These mirror the release CI but don't publish anything.
|
|
63
|
+
|
|
64
|
+
From the GitHub Actions tab (or via `gh workflow run`):
|
|
65
|
+
|
|
66
|
+
- **Test Wheel Build** (`test-build.yml`): builds native abi3 wheels on Linux, macOS, and Windows
|
|
67
|
+
- **Test Pyodide Build** (`pyodide.yml`): builds the emscripten/WASM wheel for Pyodide
|
|
68
|
+
- **Test Sdist Build** (`test-sdist.yml`): builds the source distribution
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Run all three in parallel
|
|
72
|
+
gh workflow run test-build.yml
|
|
73
|
+
gh workflow run pyodide.yml
|
|
74
|
+
gh workflow run test-sdist.yml
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
You can also build the Pyodide wheel locally (requires Linux or macOS):
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
make dist-pyodide
|
|
81
|
+
```
|
|
82
|
+
|
|
60
83
|
## Questions?
|
|
61
84
|
|
|
62
85
|
Feel free to open an issue for questions or discussions about contributing.
|
|
@@ -19,7 +19,14 @@ jobs:
|
|
|
19
19
|
fail-fast: false
|
|
20
20
|
matrix:
|
|
21
21
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
22
|
-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
22
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
23
|
+
# setup-python has no 3.9 build for Ubuntu 26.04 (ubuntu-latest from Oct 2026)
|
|
24
|
+
exclude:
|
|
25
|
+
- os: ubuntu-latest
|
|
26
|
+
python-version: "3.9"
|
|
27
|
+
include:
|
|
28
|
+
- os: ubuntu-24.04
|
|
29
|
+
python-version: "3.9"
|
|
23
30
|
|
|
24
31
|
steps:
|
|
25
32
|
- uses: actions/checkout@v6
|
|
@@ -48,33 +55,51 @@ jobs:
|
|
|
48
55
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
49
56
|
|
|
50
57
|
steps:
|
|
51
|
-
- uses: actions/checkout@
|
|
58
|
+
- uses: actions/checkout@v6
|
|
52
59
|
with:
|
|
53
60
|
fetch-depth: 0
|
|
54
61
|
|
|
55
|
-
- uses: actions/setup-python@
|
|
62
|
+
- uses: actions/setup-python@v6
|
|
56
63
|
with:
|
|
57
64
|
python-version: "3.12"
|
|
58
65
|
|
|
66
|
+
- name: Set up QEMU
|
|
67
|
+
if: runner.os == 'Linux'
|
|
68
|
+
uses: docker/setup-qemu-action@v3
|
|
69
|
+
with:
|
|
70
|
+
platforms: arm64
|
|
71
|
+
|
|
59
72
|
- name: Install cibuildwheel
|
|
60
|
-
run: pip install cibuildwheel==2.
|
|
73
|
+
run: pip install cibuildwheel==2.23.4
|
|
61
74
|
|
|
62
75
|
- name: Build wheels
|
|
63
76
|
run: python -m cibuildwheel --output-dir wheelhouse
|
|
64
|
-
env:
|
|
65
|
-
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
|
|
66
|
-
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_i686"
|
|
67
|
-
CIBW_ARCHS_MACOS: "x86_64 arm64"
|
|
68
|
-
CIBW_ARCHS_LINUX: "x86_64"
|
|
69
|
-
CIBW_BEFORE_BUILD: "git config --global --add safe.directory /project"
|
|
70
|
-
CIBW_TEST_COMMAND: "pytest {project}/tests -x"
|
|
71
|
-
CIBW_TEST_REQUIRES: "pytest"
|
|
72
77
|
|
|
73
78
|
- uses: actions/upload-artifact@v4
|
|
74
79
|
with:
|
|
75
|
-
name: wheels-${{ matrix.os }}
|
|
80
|
+
name: wheels-native-${{ matrix.os }}
|
|
76
81
|
path: ./wheelhouse/*.whl
|
|
77
82
|
|
|
83
|
+
build_pyodide:
|
|
84
|
+
name: Build Pyodide wheel
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
needs: test
|
|
87
|
+
if: github.event_name == 'release'
|
|
88
|
+
|
|
89
|
+
steps:
|
|
90
|
+
- uses: actions/checkout@v6
|
|
91
|
+
with:
|
|
92
|
+
fetch-depth: 0
|
|
93
|
+
|
|
94
|
+
- uses: pypa/cibuildwheel@v4.2.1
|
|
95
|
+
env:
|
|
96
|
+
CIBW_PLATFORM: pyodide
|
|
97
|
+
|
|
98
|
+
- uses: actions/upload-artifact@v4
|
|
99
|
+
with:
|
|
100
|
+
name: wheels-pyodide
|
|
101
|
+
path: wheelhouse/*.whl
|
|
102
|
+
|
|
78
103
|
build_sdist:
|
|
79
104
|
name: Build source distribution
|
|
80
105
|
runs-on: ubuntu-latest
|
|
@@ -82,11 +107,11 @@ jobs:
|
|
|
82
107
|
if: github.event_name == 'release'
|
|
83
108
|
|
|
84
109
|
steps:
|
|
85
|
-
- uses: actions/checkout@
|
|
110
|
+
- uses: actions/checkout@v6
|
|
86
111
|
with:
|
|
87
112
|
fetch-depth: 0
|
|
88
113
|
|
|
89
|
-
- uses: actions/setup-python@
|
|
114
|
+
- uses: actions/setup-python@v6
|
|
90
115
|
with:
|
|
91
116
|
python-version: "3.12"
|
|
92
117
|
|
|
@@ -106,7 +131,7 @@ jobs:
|
|
|
106
131
|
steps:
|
|
107
132
|
- uses: actions/download-artifact@v4
|
|
108
133
|
with:
|
|
109
|
-
pattern: wheels-*
|
|
134
|
+
pattern: wheels-native-*
|
|
110
135
|
path: dist
|
|
111
136
|
merge-multiple: true
|
|
112
137
|
|
|
@@ -119,3 +144,22 @@ jobs:
|
|
|
119
144
|
with:
|
|
120
145
|
user: __token__
|
|
121
146
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
147
|
+
skip-existing: true
|
|
148
|
+
|
|
149
|
+
# Uploaded separately so a Pyodide failure can't block the native release.
|
|
150
|
+
publish_pyodide:
|
|
151
|
+
name: Publish Pyodide wheel to PyPI
|
|
152
|
+
needs: [publish, build_pyodide]
|
|
153
|
+
runs-on: ubuntu-latest
|
|
154
|
+
if: github.event_name == 'release'
|
|
155
|
+
steps:
|
|
156
|
+
- uses: actions/download-artifact@v4
|
|
157
|
+
with:
|
|
158
|
+
name: wheels-pyodide
|
|
159
|
+
path: dist
|
|
160
|
+
|
|
161
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
162
|
+
with:
|
|
163
|
+
user: __token__
|
|
164
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
165
|
+
skip-existing: true
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Test Pyodide Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
env:
|
|
7
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build_pyodide:
|
|
11
|
+
name: Build Pyodide wheel
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- uses: pypa/cibuildwheel@v4.2.1
|
|
20
|
+
env:
|
|
21
|
+
CIBW_PLATFORM: pyodide
|
|
22
|
+
|
|
23
|
+
- uses: actions/upload-artifact@v4
|
|
24
|
+
with:
|
|
25
|
+
name: wheels-pyodide
|
|
26
|
+
path: wheelhouse/*.whl
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Test Wheel Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
env:
|
|
7
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build_wheels:
|
|
11
|
+
name: Build wheels on ${{ matrix.os }}
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v6
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- uses: actions/setup-python@v6
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.12"
|
|
25
|
+
|
|
26
|
+
- name: Set up QEMU
|
|
27
|
+
if: runner.os == 'Linux'
|
|
28
|
+
uses: docker/setup-qemu-action@v3
|
|
29
|
+
with:
|
|
30
|
+
platforms: arm64
|
|
31
|
+
|
|
32
|
+
- name: Install cibuildwheel
|
|
33
|
+
run: pip install cibuildwheel==2.23.4
|
|
34
|
+
|
|
35
|
+
- name: Build wheels
|
|
36
|
+
run: python -m cibuildwheel --output-dir wheelhouse
|
|
37
|
+
|
|
38
|
+
- uses: actions/upload-artifact@v4
|
|
39
|
+
with:
|
|
40
|
+
name: wheels-${{ matrix.os }}
|
|
41
|
+
path: ./wheelhouse/*.whl
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Test Sdist Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
env:
|
|
7
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build_sdist:
|
|
11
|
+
name: Build source distribution
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- uses: actions/setup-python@v6
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
|
|
23
|
+
- name: Build sdist
|
|
24
|
+
run: pip install build && python -m build --sdist
|
|
25
|
+
|
|
26
|
+
- uses: actions/upload-artifact@v4
|
|
27
|
+
with:
|
|
28
|
+
name: sdist
|
|
29
|
+
path: dist/*.tar.gz
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: 'If you wish to cite the "nokap" package use:'
|
|
3
|
+
type: software
|
|
4
|
+
license: MIT
|
|
5
|
+
title: "multimark provides Python bindings to cmark and allows for CommonMark parsing and rendering (HTML, LaTeX, man, XML)"
|
|
6
|
+
version: "0.2.0"
|
|
7
|
+
abstract:
|
|
8
|
+
multimark provides Python bindings to cmark, enabling CommonMark parsing and rendering to various formats
|
|
9
|
+
including HTML, LaTeX, man, and XML. A CLI is also provided for command-line usage. The package is designed to be fast,
|
|
10
|
+
efficient, and easy to use, making it a great choice for developers looking to work with CommonMark in Python.
|
|
11
|
+
authors:
|
|
12
|
+
- family-names: Iannone
|
|
13
|
+
given-names: Rich
|
|
14
|
+
email: riannone@me.com
|
|
15
|
+
orcid: https://orcid.org/0000-0003-3925-190X
|
|
16
|
+
repository-code: https://github.com/posit-dev/multimark
|
|
17
|
+
url: https://posit-dev.github.io/multimark
|
|
18
|
+
contact:
|
|
19
|
+
- family-names: Iannone
|
|
20
|
+
given-names: Rich
|
|
21
|
+
email: riannone@me.com
|
|
22
|
+
orcid: https://orcid.org/0000-0003-3925-190X
|
multimark-0.4.0/Makefile
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.PHONY: test
|
|
2
|
+
test: ## Run tests
|
|
3
|
+
@pytest tests \
|
|
4
|
+
--durations 10
|
|
5
|
+
|
|
6
|
+
.PHONY: lint
|
|
7
|
+
lint: ## Run ruff formatter and linter
|
|
8
|
+
@ruff format
|
|
9
|
+
@ruff check --fix
|
|
10
|
+
|
|
11
|
+
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
|
|
12
|
+
|
|
13
|
+
clean-build: ## remove build artifacts
|
|
14
|
+
rm -fr build/
|
|
15
|
+
rm -fr dist/
|
|
16
|
+
rm -fr .eggs/
|
|
17
|
+
find . -name '*.egg-info' -exec rm -fr {} +
|
|
18
|
+
find . -name '*.egg' -exec rm -f {} +
|
|
19
|
+
|
|
20
|
+
clean-pyc: ## remove Python file artifacts
|
|
21
|
+
find . -name '*.pyc' -exec rm -f {} +
|
|
22
|
+
find . -name '*.pyo' -exec rm -f {} +
|
|
23
|
+
find . -name '*~' -exec rm -f {} +
|
|
24
|
+
find . -name '__pycache__' -exec rm -fr {} +
|
|
25
|
+
|
|
26
|
+
clean-test: ## remove test and coverage artifacts
|
|
27
|
+
rm -fr .pytest_cache
|
|
28
|
+
|
|
29
|
+
dist: clean ## builds source and wheel package
|
|
30
|
+
python3 -m build
|
|
31
|
+
ls -l dist
|
|
32
|
+
|
|
33
|
+
.PHONY: dist-wheel
|
|
34
|
+
dist-wheel: clean ## builds native abi3 wheel using cibuildwheel
|
|
35
|
+
pip install cibuildwheel==2.23.4
|
|
36
|
+
python -m cibuildwheel --output-dir dist
|
|
37
|
+
ls -l dist
|
|
38
|
+
|
|
39
|
+
.PHONY: dist-pyodide
|
|
40
|
+
dist-pyodide: clean ## builds Pyodide/emscripten wheel (requires Linux or macOS)
|
|
41
|
+
pip install cibuildwheel==4.2.1
|
|
42
|
+
python -m cibuildwheel --platform pyodide --output-dir dist
|
|
43
|
+
ls -l dist
|
|
44
|
+
|
|
45
|
+
.PHONY: dist-sdist
|
|
46
|
+
dist-sdist: clean ## builds source distribution only
|
|
47
|
+
pip install build
|
|
48
|
+
python3 -m build --sdist
|
|
49
|
+
ls -l dist
|
|
50
|
+
|
|
51
|
+
.PHONY: dist-all
|
|
52
|
+
dist-all: clean ## builds native wheel, Pyodide wheel, and sdist
|
|
53
|
+
pip install cibuildwheel==2.23.4 build
|
|
54
|
+
python -m cibuildwheel --output-dir dist
|
|
55
|
+
pip install cibuildwheel==4.2.1
|
|
56
|
+
python -m cibuildwheel --platform pyodide --output-dir dist
|
|
57
|
+
python3 -m build --sdist --outdir dist
|
|
58
|
+
ls -l dist
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multimark
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Python bindings to cmark: CommonMark parsing and rendering (HTML, LaTeX, man, XML)
|
|
5
5
|
Author: Rich Iannone
|
|
6
|
-
License: MIT AND BSD-2-Clause
|
|
6
|
+
License-Expression: MIT AND BSD-2-Clause
|
|
7
7
|
Project-URL: Homepage, https://github.com/posit-dev/multimark
|
|
8
8
|
Project-URL: Issues, https://github.com/posit-dev/multimark/issues
|
|
9
9
|
Keywords: markdown,commonmark,cmark-gfm,html,latex,gfm
|
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
13
12
|
Classifier: Operating System :: OS Independent
|
|
14
13
|
Classifier: Programming Language :: C
|
|
15
14
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -18,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
21
|
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
22
22
|
Requires-Python: >=3.9
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Wheel Builds
|
|
2
|
+
|
|
3
|
+
multimark is a compiled Python package (CFFI bindings to vendored cmark-gfm C sources). Pre-built wheels are published to PyPI on each release. This document describes what gets built, for which platforms, and why.
|
|
4
|
+
|
|
5
|
+
## Python Version Support
|
|
6
|
+
|
|
7
|
+
multimark uses the Python stable ABI (abi3) with a floor of **CPython 3.9**. A single wheel per platform covers all Python versions from 3.9 onward, including future releases. The test suite runs on Python 3.9 through 3.14.
|
|
8
|
+
|
|
9
|
+
## Native Wheels
|
|
10
|
+
|
|
11
|
+
Built with cibuildwheel using the `cp39-abi3` tag.
|
|
12
|
+
|
|
13
|
+
| Platform | Architectures | Wheel tag |
|
|
14
|
+
|----------|--------------|-----------|
|
|
15
|
+
| Linux (manylinux/musllinux) | x86_64, aarch64 | `cp39-abi3-manylinux_*_{x86_64,aarch64}`, `cp39-abi3-musllinux_*_{x86_64,aarch64}` |
|
|
16
|
+
| macOS | x86_64, arm64 | `cp39-abi3-macosx_*_x86_64`, `cp39-abi3-macosx_*_arm64` |
|
|
17
|
+
| Windows | x86_64 | `cp39-abi3-win_amd64` |
|
|
18
|
+
|
|
19
|
+
Linux aarch64 wheels are built and tested under QEMU on the x86_64 GitHub Actions runner.
|
|
20
|
+
|
|
21
|
+
Skipped: 32-bit Windows (`win32`), 32-bit Linux (`manylinux_i686`), musl 32-bit (`musllinux_i686`).
|
|
22
|
+
|
|
23
|
+
## Pyodide / WebAssembly Wheels
|
|
24
|
+
|
|
25
|
+
Built with cibuildwheel 4.x using `CIBW_PLATFORM=pyodide`, and published to PyPI with the native wheels. They use the PEP 783 `pyemscripten` platform tag, so `micropip.install("multimark")` finds them. These allow multimark to run in browser-based Python environments (Pyodide, JupyterLite, Shinylive).
|
|
26
|
+
|
|
27
|
+
| Pyodide Version | Python | Emscripten | Wheel tag |
|
|
28
|
+
|----------------|--------|------------|-----------|
|
|
29
|
+
| 314.x | 3.14 | 5.0.3 | `cp39-abi3-pyemscripten_2026_0_wasm32` |
|
|
30
|
+
|
|
31
|
+
Pyodide 0.28/0.29 (Python 3.13) is a different ABI and is not built. Its `pyemscripten_2025_0` wheel would only install on Pyodide 0.29.4 and later, because earlier versions bundle a micropip older than 0.11.1, which does not recognise the `pyemscripten` tag.
|
|
32
|
+
|
|
33
|
+
Threading and CLI tests are skipped under Pyodide (emscripten does not support pthreads or subprocesses). For the same reason, `markdown_to_html_batch(..., workers=N)` with `N > 1` raises `RuntimeError` under Pyodide. Leave `workers` unset there.
|
|
34
|
+
|
|
35
|
+
The Pyodide wheel is uploaded to PyPI in its own job, after the native wheels and sdist. If the Pyodide build, its tests, or its upload fail, the native release is still published.
|
|
36
|
+
|
|
37
|
+
## Source Distribution
|
|
38
|
+
|
|
39
|
+
An sdist (`multimark-*.tar.gz`) is also published. Building from source requires a C compiler and the vendored cmark-gfm sources (included in the tarball).
|
|
40
|
+
|
|
41
|
+
## Building Locally
|
|
42
|
+
|
|
43
|
+
| Target | Command |
|
|
44
|
+
|--------|---------|
|
|
45
|
+
| Native wheel | `make dist-wheel` |
|
|
46
|
+
| Pyodide wheel | `make dist-pyodide` |
|
|
47
|
+
| Source distribution | `make dist-sdist` |
|
|
48
|
+
| All of the above | `make dist-all` |
|
|
49
|
+
|
|
50
|
+
## Testing Builds Before a Release
|
|
51
|
+
|
|
52
|
+
Three manually triggered GitHub Actions workflows mirror the release pipeline without publishing:
|
|
53
|
+
|
|
54
|
+
- **Test Wheel Build** (`test-build.yml`): native abi3 wheels on all platforms
|
|
55
|
+
- **Test Pyodide Build** (`pyodide.yml`): emscripten/WASM wheels
|
|
56
|
+
- **Test Sdist Build** (`test-sdist.yml`): source distribution
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
gh workflow run test-build.yml
|
|
60
|
+
gh workflow run pyodide.yml
|
|
61
|
+
gh workflow run test-sdist.yml
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Configuration
|
|
65
|
+
|
|
66
|
+
All cibuildwheel settings live in `pyproject.toml` under `[tool.cibuildwheel]`. The release CI workflow (`ci.yml`) and local Makefile targets read from the same configuration. Native wheels are built with cibuildwheel 2.23.4 and Pyodide wheels with 4.2.1.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hash": "23b4bbb83cb1fc8c7866d80c35d6bec7",
|
|
3
|
+
"result": {
|
|
4
|
+
"engine": "jupyter",
|
|
5
|
+
"markdown": "---\ntitle: \"[Options]{.doc-object-name .doc-class .doc-label .doc-label-enum}\"\nbody-classes: doc-api-page\npage-navigation: false\nhtml-table-processing: none\n---\n\n::: {.doc-subject}\n\nCommonMark/GFM parsing and rendering options.\n:::\n\n::: {.doc-usage-source}\nUsage\n\n[Source](https://github.com/posit-dev/multimark/blob/main/src/multimark/__init__.py#L23-L80){target=\"_blank\" rel=\"noopener\"}\n:::\n\n::: {.doc-signature .doc-Kind.CLASS}\n```python\nOptions()\n```\n:::\n\n::: {.doc-text}\n\nAn `IntFlag` enumeration of all option flags supported by the cmark-gfm library.\nOptions can be combined using the bitwise OR operator (`|`) and passed to any\nrenderer's `options=` parameter. This provides a composable, lower-level alternative\nto the named boolean keyword arguments available on each renderer function.\n\nMost users will prefer the named keyword arguments (e.g., `smart=True`) for common\noptions. The `Options` bitmask is useful when you need to combine multiple flags\ninto a single reusable value, or when working with GFM-specific flags that do not\nhave dedicated keyword arguments.\n:::\n\n## Examples {.doc-examples}\n\nCombine multiple flags with the `|` operator:\n\n::: {#b5ca47ed .cell execution_count=1}\n``` {.python .cell-code}\nfrom multimark import markdown_to_html, Options\n\nopts = Options.SMART | Options.UNSAFE\nmarkdown_to_html('\"Hello\" -- world', options=opts)\n```\n\n::: {.cell-output .cell-output-display execution_count=1}\n```\n'<p>“Hello” – world</p>\\n'\n```\n:::\n:::\n\n\nMix a bitmask with named keyword arguments (they are OR'd together):\n\n::: {#8ca8a90d .cell execution_count=2}\n``` {.python .cell-code}\ntext = \"Here's some *text* to convert\"\nmarkdown_to_html(text, options=Options.SMART, footnotes=True)\n```\n\n::: {.cell-output .cell-output-display execution_count=2}\n```\n'<p>Here’s some <em>text</em> to convert</p>\\n'\n```\n:::\n:::\n\n\nUse GFM-specific flags that have no keyword shortcut:\n\n::: {#3ffb444e .cell execution_count=3}\n``` {.python .cell-code}\nmarkdown_to_html(\n \"~~deleted~~\",\n options=Options.STRIKETHROUGH_DOUBLE_TILDE,\n extensions=[\"strikethrough\"],\n)\n```\n\n::: {.cell-output .cell-output-display execution_count=3}\n```\n'<p><del>deleted</del></p>\\n'\n```\n:::\n:::\n\n\n",
|
|
6
|
+
"supporting": [
|
|
7
|
+
"Options_files"
|
|
8
|
+
],
|
|
9
|
+
"filters": [],
|
|
10
|
+
"includes": {}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hash": "72822c07f9164470668ab21e040d798e",
|
|
3
|
+
"result": {
|
|
4
|
+
"engine": "jupyter",
|
|
5
|
+
"markdown": "---\ntitle: \"[cmark_version()]{.doc-object-name .doc-function .doc-label .doc-label-function}\"\nbody-classes: doc-api-page\npage-navigation: false\nhtml-table-processing: none\n---\n\n::: {.doc-subject}\n\nReturn the version string of the vendored cmark-gfm library.\n:::\n\n::: {.doc-usage-source}\nUsage\n\n[Source](https://github.com/posit-dev/multimark/blob/main/src/multimark/_cmark.py#L726-L746){target=\"_blank\" rel=\"noopener\"}\n:::\n\n::: {.doc-signature .doc-Kind.FUNCTION}\n```python\ncmark_version()\n```\n:::\n\n::: {.doc-text}\n\nReports the version of the bundled cmark-gfm C library that multimark was compiled\nagainst. This is useful for debugging or confirming which release of the underlying\nparser is in use.\n:::\n\n## Returns {.doc-returns}\n\n::: {.doc-definition-items}\n<code> [str]{.doc-parameter-annotation}</code>\n\n: A version string in the format `\"X.Y.Z.gfm.N\"` (e.g., `\"0.29.0.gfm.13\"`).\n:::\n\n## Examples {.doc-examples}\n\n::: {#cb7f0531 .cell execution_count=1}\n``` {.python .cell-code}\nfrom multimark import cmark_version\n\ncmark_version()\n```\n\n::: {.cell-output .cell-output-display execution_count=1}\n```\n'0.29.0.gfm.13'\n```\n:::\n:::\n\n\n",
|
|
6
|
+
"supporting": [
|
|
7
|
+
"cmark_version_files"
|
|
8
|
+
],
|
|
9
|
+
"filters": [],
|
|
10
|
+
"includes": {}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hash": "5b980bcea5ce0af477a36e566ab0bc1a",
|
|
3
|
+
"result": {
|
|
4
|
+
"engine": "jupyter",
|
|
5
|
+
"markdown": "---\ntitle: \"[markdown_to_commonmark()]{.doc-object-name .doc-function .doc-label .doc-label-function}\"\nbody-classes: doc-api-page\npage-navigation: false\nhtml-table-processing: none\n---\n\n::: {.doc-subject}\n\nParse CommonMark/GFM and render back as normalized CommonMark.\n:::\n\n::: {.doc-usage-source}\nUsage\n\n[Source](https://github.com/posit-dev/multimark/blob/main/src/multimark/_cmark.py#L598-L723){target=\"_blank\" rel=\"noopener\"}\n:::\n\n::: {.doc-signature .doc-Kind.FUNCTION}\n```python\nmarkdown_to_commonmark(\n text,\n *,\n hardbreaks=False,\n smart=False,\n normalize=False,\n unsafe=False,\n footnotes=False,\n extensions=(),\n width=0,\n options=0\n)\n```\n:::\n\n::: {.doc-text}\n\nParses the input Markdown into an AST and re-renders it as CommonMark. This\neffectively normalizes the formatting: different but semantically equivalent\nMarkdown inputs (e.g., `*italic*` vs `_italic_`, varying list indentation) will\nproduce a canonical output form.\n\nThis is useful for round-trip testing, canonical formatting, or cleaning up\ninconsistently formatted documents. The output of this function, when parsed again,\nproduces the same AST as the original input.\n:::\n\n## Parameters {.doc-parameters}\n\n::: {.doc-definition-items}\n<code>[text]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [str]{.doc-parameter-annotation}</code>\n\n: The Markdown string to parse and normalize. Must be a Python `str`.\n\n<code>[hardbreaks]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Render soft line breaks as hard breaks (backslash-newline). By default, this is\n `False`.\n\n<code>[smart]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Convert straight quotes to curly quotes, `--` to en-dashes, `---` to em-dashes,\n and `...` to ellipses. By default, this is `False`.\n\n<code>[normalize]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Consolidate adjacent text nodes in the parsed AST. By default, this is `False`.\n\n<code>[unsafe]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Allow raw HTML to pass through. By default, this is `False`, which replaces raw\n HTML with a comment placeholder.\n\n<code>[footnotes]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Enable footnote syntax parsing. By default, this is `False`.\n\n<code>[extensions]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [Sequence[str]]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [()<br>]{.doc-parameter-default}</code>\n\n: A sequence of GFM extension names to enable. Valid names are `\"table\"`,\n `\"strikethrough\"`, `\"autolink\"`, `\"tagfilter\"`, and `\"tasklist\"`.\n\n<code>[width]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [int]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[0]{.dv}]{.doc-parameter-default}</code>\n\n: The column at which to wrap output lines. Set to `0` (the default) to disable\n line wrapping entirely. This is useful for producing line-wrapped output for\n version-control-friendly diffs.\n\n<code>[options]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [int]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[0]{.dv}]{.doc-parameter-default}</code>\n\n: An integer bitmask of `Options` flags (e.g., `Options.SMART | Options.UNSAFE`).\n Merged via OR with any boolean keyword arguments set to `True`.\n Defaults to `0`.\n:::\n\n## Keyword Arguments Vs. Options Flags {.doc-keyword-arguments-vs-options-flags}\n\nThe boolean keyword arguments (`smart`, `unsafe`, `hardbreaks`, etc.) are convenience\nshortcuts for the most common `Options` flags. When both styles are provided, they\nare merged via OR. See `markdown_to_html()` for a detailed explanation.\n\n## Returns {.doc-returns}\n\n::: {.doc-definition-items}\n<code> [str]{.doc-parameter-annotation}</code>\n\n: The normalized CommonMark string.\n:::\n\n## Examples {.doc-examples}\n\nNormalize inconsistent formatting:\n\n::: {#04342f84 .cell execution_count=1}\n``` {.python .cell-code}\nfrom multimark import markdown_to_commonmark\n\nmarkdown_to_commonmark(\"_hello_ **world**\")\n```\n\n::: {.cell-output .cell-output-display execution_count=1}\n```\n'*hello* **world**\\n'\n```\n:::\n:::\n\n\nVerify round-trip stability (parse, render, re-parse produces the same HTML):\n\n::: {#1c104cd0 .cell execution_count=2}\n``` {.python .cell-code}\nfrom multimark import markdown_to_commonmark, markdown_to_html\n\noriginal = \"**bold** and *italic*\"\nnormalized = markdown_to_commonmark(original)\nassert markdown_to_html(original) == markdown_to_html(normalized)\n```\n:::\n\n\nWrap at 80 columns for version-control-friendly output:\n\n::: {#623b5383 .cell execution_count=3}\n``` {.python .cell-code}\nlong_document = \"This is a long sentence for demonstration. \" * 10\nprint(markdown_to_commonmark(long_document, width=80))\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nThis is a long sentence for demonstration. This is a long sentence for\ndemonstration. This is a long sentence for demonstration. This is a long\nsentence for demonstration. This is a long sentence for demonstration. This is a\nlong sentence for demonstration. This is a long sentence for demonstration. This\nis a long sentence for demonstration. This is a long sentence for demonstration.\nThis is a long sentence for demonstration.\n\n```\n:::\n:::\n\n\n",
|
|
6
|
+
"supporting": [
|
|
7
|
+
"markdown_to_commonmark_files"
|
|
8
|
+
],
|
|
9
|
+
"filters": [],
|
|
10
|
+
"includes": {}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hash": "02756b31c68964596dda3163f52e750c",
|
|
3
|
+
"result": {
|
|
4
|
+
"engine": "jupyter",
|
|
5
|
+
"markdown": "---\ntitle: \"[markdown_to_html()]{.doc-object-name .doc-function .doc-label .doc-label-function}\"\nbody-classes: doc-api-page\npage-navigation: false\nhtml-table-processing: none\n---\n\n::: {.doc-subject}\n\nParse CommonMark/GFM and render as HTML.\n:::\n\n::: {.doc-usage-source}\nUsage\n\n[Source](https://github.com/posit-dev/multimark/blob/main/src/multimark/_cmark.py#L78-L232){target=\"_blank\" rel=\"noopener\"}\n:::\n\n::: {.doc-signature .doc-Kind.FUNCTION}\n```python\nmarkdown_to_html(\n text,\n *,\n hardbreaks=False,\n smart=False,\n normalize=False,\n sourcepos=False,\n unsafe=False,\n footnotes=False,\n extensions=(),\n options=0\n)\n```\n:::\n\n::: {.doc-text}\n\nTakes a Markdown string and returns the corresponding HTML output. By default,\nraw HTML embedded in the Markdown is stripped for security (replaced with an HTML\ncomment). Set `unsafe=True` to allow raw HTML passthrough.\n\nThe parser is fully [CommonMark spec](https://spec.commonmark.org/) compliant. When\nGFM extensions are enabled via `extensions=`, additional syntax is recognized\n(tables, strikethrough, autolinks, tag filtering, and task lists).\n:::\n\n## Parameters {.doc-parameters}\n\n::: {.doc-definition-items}\n<code>[text]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [str]{.doc-parameter-annotation}</code>\n\n: The Markdown string to parse and render. Can be any length, from a single\n inline fragment to a full document. Must be a Python `str` (not bytes).\n\n<code>[hardbreaks]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Render soft line breaks (single newlines within a paragraph) as `<br />` tags.\n By default, this is `False` and soft breaks are rendered as spaces, matching the\n CommonMark specification behavior.\n\n<code>[smart]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Convert straight quotes to curly quotes, `--` to en-dashes, `---` to em-dashes,\n and `...` to ellipses. By default, this is `False`.\n\n<code>[normalize]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Consolidate adjacent text nodes in the parsed AST before rendering. This can\n produce slightly cleaner output in edge cases. By default, this is `False`.\n\n<code>[sourcepos]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Include `data-sourcepos` attributes on block-level HTML elements indicating\n their line/column positions in the original Markdown source. Useful for building\n editors or source-mapping tools. By default, this is `False`.\n\n<code>[unsafe]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Allow raw HTML and potentially dangerous links to pass through to the output\n without sanitization. When `False` (the default), raw HTML blocks and inline\n HTML are replaced with a comment `<!-- raw HTML omitted -->`, and dangerous\n URLs (e.g., `javascript:`) are suppressed.\n\n<code>[footnotes]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Enable footnote syntax parsing. When `True`, `[^label]` markers and\n `[^label]: content` definitions are recognized and rendered as numbered\n footnotes with backlinks. By default, this is `False`.\n\n<code>[extensions]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [Sequence[str]]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [()<br>]{.doc-parameter-default}</code>\n\n: A sequence of GFM extension names to enable during parsing. Valid names are\n `\"table\"`, `\"strikethrough\"`, `\"autolink\"`, `\"tagfilter\"`, and `\"tasklist\"`.\n An empty sequence (the default) parses standard CommonMark only.\n\n<code>[options]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [int]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[0]{.dv}]{.doc-parameter-default}</code>\n\n: An integer bitmask of `Options` flags. Build it by OR-ing flags together, e.g.,\n `Options.SMART | Options.UNSAFE`. This value is combined (via OR) with any named\n boolean parameters that are set to `True`, so you can mix both styles freely.\n Defaults to `0` (no additional flags beyond those set by keyword arguments).\n:::\n\n## Keyword Arguments Vs. Options Flags {.doc-keyword-arguments-vs-options-flags}\n\nThe boolean keyword arguments (`smart`, `unsafe`, `hardbreaks`, etc.) are convenience\nshortcuts for the most common `Options` flags. Using `smart=True` is equivalent to\npassing `options=Options.SMART`. When both are provided, they are merged:\n`markdown_to_html(text, smart=True, options=Options.UNSAFE)` is the same as\n`options=Options.SMART | Options.UNSAFE`.\n\nSome flags (like `Options.GITHUB_PRE_LANG`, `Options.STRIKETHROUGH_DOUBLE_TILDE`,\nand `Options.LIBERAL_HTML_TAG`) have no keyword shortcut and can only be set via\nthe `options` parameter.\n\n## Returns {.doc-returns}\n\n::: {.doc-definition-items}\n<code> [str]{.doc-parameter-annotation}</code>\n\n: The rendered HTML string. Block-level elements end with a trailing newline.\n:::\n\n## Examples {.doc-examples}\n\nRender basic Markdown to HTML:\n\n::: {#b8b75ace .cell execution_count=1}\n``` {.python .cell-code}\nfrom multimark import markdown_to_html\n\nmarkdown_to_html(\"**bold** and *italic*\")\n```\n\n::: {.cell-output .cell-output-display execution_count=1}\n```\n'<p><strong>bold</strong> and <em>italic</em></p>\\n'\n```\n:::\n:::\n\n\nEnable smart punctuation:\n\n::: {#2f9dd094 .cell execution_count=2}\n``` {.python .cell-code}\nmarkdown_to_html('\"Hello\" -- world...', smart=True)\n```\n\n::: {.cell-output .cell-output-display execution_count=2}\n```\n'<p>“Hello” – world…</p>\\n'\n```\n:::\n:::\n\n\nAllow raw HTML passthrough:\n\n::: {#51c52fb6 .cell execution_count=3}\n``` {.python .cell-code}\nmarkdown_to_html(\"<div>custom</div>\", unsafe=True)\n```\n\n::: {.cell-output .cell-output-display execution_count=3}\n```\n'<div>custom</div>\\n'\n```\n:::\n:::\n\n\nUse GFM table extension:\n\n::: {#0580635c .cell execution_count=4}\n``` {.python .cell-code}\nmarkdown_to_html(\n \"| A | B |\\n|---|---|\\n| 1 | 2 |\\n\",\n extensions=[\"table\"],\n)\n```\n\n::: {.cell-output .cell-output-display execution_count=4}\n```\n'<table>\\n<thead>\\n<tr>\\n<th>A</th>\\n<th>B</th>\\n</tr>\\n</thead>\\n<tbody>\\n<tr>\\n<td>1</td>\\n<td>2</td>\\n</tr>\\n</tbody>\\n</table>\\n'\n```\n:::\n:::\n\n\nCombine multiple features:\n\n::: {#f130ac5e .cell execution_count=5}\n``` {.python .cell-code}\nmarkdown_to_html(\n \"~~old~~ -> new\\n\\nVisit https://example.com\\n\",\n extensions=[\"strikethrough\", \"autolink\"],\n smart=True,\n)\n```\n\n::: {.cell-output .cell-output-display execution_count=5}\n```\n'<p><del>old</del> -> new</p>\\n<p>Visit <a href=\"https://example.com\">https://example.com</a></p>\\n'\n```\n:::\n:::\n\n\n",
|
|
6
|
+
"supporting": [
|
|
7
|
+
"markdown_to_html_files"
|
|
8
|
+
],
|
|
9
|
+
"filters": [],
|
|
10
|
+
"includes": {}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hash": "3970322368642e8308549c31b299e3cd",
|
|
3
|
+
"result": {
|
|
4
|
+
"engine": "jupyter",
|
|
5
|
+
"markdown": "---\ntitle: \"[markdown_to_latex()]{.doc-object-name .doc-function .doc-label .doc-label-function}\"\nbody-classes: doc-api-page\npage-navigation: false\nhtml-table-processing: none\n---\n\n::: {.doc-subject}\n\nParse CommonMark/GFM and render as LaTeX.\n:::\n\n::: {.doc-usage-source}\nUsage\n\n[Source](https://github.com/posit-dev/multimark/blob/main/src/multimark/_cmark.py#L348-L474){target=\"_blank\" rel=\"noopener\"}\n:::\n\n::: {.doc-signature .doc-Kind.FUNCTION}\n```python\nmarkdown_to_latex(\n text,\n *,\n hardbreaks=False,\n smart=False,\n normalize=False,\n unsafe=False,\n footnotes=False,\n extensions=(),\n width=0,\n options=0\n)\n```\n:::\n\n::: {.doc-text}\n\nConverts Markdown to LaTeX source suitable for inclusion in a `.tex` document.\nInline formatting maps to LaTeX commands (`\\textbf{}`, `\\emph{}`, `\\texttt{}`),\nheadings become sectioning commands (`\\section{}`, `\\subsection{}`, etc.), and\nlinks use `\\href{}{}`.\n\nThe output is a fragment (not a full document): it does not include\n`\\documentclass`, `\\begin{document}`, or preamble. You can concatenate it into\nyour own LaTeX document structure.\n:::\n\n## Parameters {.doc-parameters}\n\n::: {.doc-definition-items}\n<code>[text]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [str]{.doc-parameter-annotation}</code>\n\n: The Markdown string to parse and render. Must be a Python `str`.\n\n<code>[hardbreaks]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Render soft line breaks as hard breaks (`\\\\`). By default, this is `False`.\n\n<code>[smart]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Convert straight quotes to curly quotes, `--` to en-dashes, `---` to em-dashes,\n and `...` to ellipses. By default, this is `False`.\n\n<code>[normalize]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Consolidate adjacent text nodes in the parsed AST. By default, this is `False`.\n\n<code>[unsafe]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Allow raw HTML to pass through. Since LaTeX is the target format, raw HTML is\n typically irrelevant. By default, this is `False`.\n\n<code>[footnotes]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Enable footnote syntax parsing. By default, this is `False`.\n\n<code>[extensions]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [Sequence[str]]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [()<br>]{.doc-parameter-default}</code>\n\n: A sequence of GFM extension names to enable. Valid names are `\"table\"`,\n `\"strikethrough\"`, `\"autolink\"`, `\"tagfilter\"`, and `\"tasklist\"`.\n\n<code>[width]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [int]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[0]{.dv}]{.doc-parameter-default}</code>\n\n: The column at which to wrap output lines. Set to `0` (the default) to disable\n line wrapping entirely. A value like `80` produces lines of at most 80\n characters where possible.\n\n<code>[options]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [int]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[0]{.dv}]{.doc-parameter-default}</code>\n\n: An integer bitmask of `Options` flags (e.g., `Options.SMART | Options.UNSAFE`).\n Merged via OR with any boolean keyword arguments set to `True`.\n Defaults to `0`.\n:::\n\n## Keyword Arguments Vs. Options Flags {.doc-keyword-arguments-vs-options-flags}\n\nThe boolean keyword arguments (`smart`, `unsafe`, `hardbreaks`, etc.) are convenience\nshortcuts for the most common `Options` flags. When both styles are provided, they\nare merged via OR. See `markdown_to_html()` for a detailed explanation.\n\n## Returns {.doc-returns}\n\n::: {.doc-definition-items}\n<code> [str]{.doc-parameter-annotation}</code>\n\n: The rendered LaTeX string.\n:::\n\n## Examples {.doc-examples}\n\nRender inline formatting:\n\n::: {#19d00450 .cell execution_count=1}\n``` {.python .cell-code}\nfrom multimark import markdown_to_latex\n\nmarkdown_to_latex(\"**bold** and *italic*\")\n```\n\n::: {.cell-output .cell-output-display execution_count=1}\n```\n'\\\\textbf{bold} and \\\\emph{italic}\\n'\n```\n:::\n:::\n\n\nRender a heading:\n\n::: {#8b187a3d .cell execution_count=2}\n``` {.python .cell-code}\nmarkdown_to_latex(\"# Introduction\")\n```\n\n::: {.cell-output .cell-output-display execution_count=2}\n```\n'\\\\section{Introduction}\\n'\n```\n:::\n:::\n\n\nEnable line wrapping at 72 columns:\n\n::: {#230ea992 .cell execution_count=3}\n``` {.python .cell-code}\nlong_text = \"This is a very long paragraph. \" * 10\nprint(markdown_to_latex(long_text, width=72))\n```\n\n::: {.cell-output .cell-output-stdout}\n```\nThis is a very long paragraph. This is a very long paragraph. This is a\nvery long paragraph. This is a very long paragraph. This is a very long\nparagraph. This is a very long paragraph. This is a very long paragraph.\nThis is a very long paragraph. This is a very long paragraph. This is a\nvery long paragraph.\n\n```\n:::\n:::\n\n\nUse smart punctuation for typographic output:\n\n::: {#f317a4df .cell execution_count=4}\n``` {.python .cell-code}\nmarkdown_to_latex('\"Hello,\" she said --- \"goodbye.\"', smart=True)\n```\n\n::: {.cell-output .cell-output-display execution_count=4}\n```\n\"``Hello,'' she said --- ``goodbye.''\\n\"\n```\n:::\n:::\n\n\n",
|
|
6
|
+
"supporting": [
|
|
7
|
+
"markdown_to_latex_files"
|
|
8
|
+
],
|
|
9
|
+
"filters": [],
|
|
10
|
+
"includes": {}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hash": "790461a9040615c8871c67d92cbe0b9a",
|
|
3
|
+
"result": {
|
|
4
|
+
"engine": "jupyter",
|
|
5
|
+
"markdown": "---\ntitle: \"[markdown_to_man()]{.doc-object-name .doc-function .doc-label .doc-label-function}\"\nbody-classes: doc-api-page\npage-navigation: false\nhtml-table-processing: none\n---\n\n::: {.doc-subject}\n\nParse CommonMark/GFM and render as a groff man page.\n:::\n\n::: {.doc-usage-source}\nUsage\n\n[Source](https://github.com/posit-dev/multimark/blob/main/src/multimark/_cmark.py#L477-L595){target=\"_blank\" rel=\"noopener\"}\n:::\n\n::: {.doc-signature .doc-Kind.FUNCTION}\n```python\nmarkdown_to_man(\n text,\n *,\n hardbreaks=False,\n smart=False,\n normalize=False,\n unsafe=False,\n footnotes=False,\n extensions=(),\n width=0,\n options=0\n)\n```\n:::\n\n::: {.doc-text}\n\nProduces groff-format output suitable for use with the `man` command or inclusion\nin manual page source files. Inline formatting maps to font switching requests\n(`\\f[B]`, `\\f[I]`, `\\f[CR]`), paragraphs use `.PP`, and headings use `.SH` or\n`.SS` macros.\n\nThe output is a fragment and does not include a `.TH` title header. Wrap it in your\nown man page structure to produce a complete manual page.\n:::\n\n## Parameters {.doc-parameters}\n\n::: {.doc-definition-items}\n<code>[text]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [str]{.doc-parameter-annotation}</code>\n\n: The Markdown string to parse and render. Must be a Python `str`.\n\n<code>[hardbreaks]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Render soft line breaks as hard breaks (`.br`). By default, this is `False`.\n\n<code>[smart]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Convert straight quotes to curly quotes, `--` to en-dashes, `---` to em-dashes,\n and `...` to ellipses. By default, this is `False`.\n\n<code>[normalize]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Consolidate adjacent text nodes in the parsed AST. By default, this is `False`.\n\n<code>[unsafe]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Allow raw HTML to pass through. Since groff is the target format, raw HTML is\n typically irrelevant. By default, this is `False`.\n\n<code>[footnotes]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Enable footnote syntax parsing. By default, this is `False`.\n\n<code>[extensions]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [Sequence[str]]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [()<br>]{.doc-parameter-default}</code>\n\n: A sequence of GFM extension names to enable. Valid names are `\"table\"`,\n `\"strikethrough\"`, `\"autolink\"`, `\"tagfilter\"`, and `\"tasklist\"`.\n\n<code>[width]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [int]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[0]{.dv}]{.doc-parameter-default}</code>\n\n: The column at which to wrap output lines. Set to `0` (the default) to disable\n line wrapping entirely.\n\n<code>[options]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [int]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[0]{.dv}]{.doc-parameter-default}</code>\n\n: An integer bitmask of `Options` flags (e.g., `Options.SMART | Options.UNSAFE`).\n Merged via OR with any boolean keyword arguments set to `True`.\n Defaults to `0`.\n:::\n\n## Keyword Arguments Vs. Options Flags {.doc-keyword-arguments-vs-options-flags}\n\nThe boolean keyword arguments (`smart`, `unsafe`, `hardbreaks`, etc.) are convenience\nshortcuts for the most common `Options` flags. When both styles are provided, they\nare merged via OR. See `markdown_to_html()` for a detailed explanation.\n\n## Returns {.doc-returns}\n\n::: {.doc-definition-items}\n<code> [str]{.doc-parameter-annotation}</code>\n\n: The rendered groff man page string.\n:::\n\n## Examples {.doc-examples}\n\nRender a paragraph with bold and italic:\n\n::: {#88e363be .cell execution_count=1}\n``` {.python .cell-code}\nfrom multimark import markdown_to_man\n\nmarkdown_to_man(\"**bold** and *italic*\")\n```\n\n::: {.cell-output .cell-output-display execution_count=1}\n```\n'.PP\\n\\\\f[B]bold\\\\f[] and \\\\f[I]italic\\\\f[]\\n'\n```\n:::\n:::\n\n\nRender a heading:\n\n::: {#ce6c93ce .cell execution_count=2}\n``` {.python .cell-code}\nmarkdown_to_man(\"## Options\")\n```\n\n::: {.cell-output .cell-output-display execution_count=2}\n```\n'.SS\\nOptions\\n'\n```\n:::\n:::\n\n\nWrap at 72 columns:\n\n::: {#706522ae .cell execution_count=3}\n``` {.python .cell-code}\nlong_paragraph = \"This is a long paragraph of text. \" * 10\nprint(markdown_to_man(long_paragraph, width=72))\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n.PP\nThis is a long paragraph of text. This is a long paragraph of text. This\nis a long paragraph of text. This is a long paragraph of text. This is a\nlong paragraph of text. This is a long paragraph of text. This is a long\nparagraph of text. This is a long paragraph of text. This is a long\nparagraph of text. This is a long paragraph of text.\n\n```\n:::\n:::\n\n\n",
|
|
6
|
+
"supporting": [
|
|
7
|
+
"markdown_to_man_files"
|
|
8
|
+
],
|
|
9
|
+
"filters": [],
|
|
10
|
+
"includes": {}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hash": "0ed18dda64f753582a9c273e25ee232b",
|
|
3
|
+
"result": {
|
|
4
|
+
"engine": "jupyter",
|
|
5
|
+
"markdown": "---\ntitle: \"[markdown_to_xml()]{.doc-object-name .doc-function .doc-label .doc-label-function}\"\nbody-classes: doc-api-page\npage-navigation: false\nhtml-table-processing: none\n---\n\n::: {.doc-subject}\n\nParse CommonMark/GFM and render as XML.\n:::\n\n::: {.doc-usage-source}\nUsage\n\n[Source](https://github.com/posit-dev/multimark/blob/main/src/multimark/_cmark.py#L235-L345){target=\"_blank\" rel=\"noopener\"}\n:::\n\n::: {.doc-signature .doc-Kind.FUNCTION}\n```python\nmarkdown_to_xml(\n text,\n *,\n hardbreaks=False,\n smart=False,\n normalize=False,\n sourcepos=False,\n unsafe=False,\n footnotes=False,\n extensions=(),\n options=0\n)\n```\n:::\n\n::: {.doc-text}\n\nProduces an XML representation of the parsed abstract syntax tree (AST). Each\nMarkdown construct is represented as a named element (e.g., `<paragraph>`,\n`<strong>`, `<code_block>`), with text content preserved in `<text>` elements.\n\nThe XML output conforms to the CommonMark DTD and includes an XML declaration and\nDOCTYPE. This format is useful for debugging, AST inspection, or piping into\nXML-based toolchains.\n:::\n\n## Parameters {.doc-parameters}\n\n::: {.doc-definition-items}\n<code>[text]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [str]{.doc-parameter-annotation}</code>\n\n: The Markdown string to parse and render. Must be a Python `str`.\n\n<code>[hardbreaks]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Render soft line breaks as hard breaks in the AST. By default, this is `False`.\n\n<code>[smart]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Convert straight quotes to curly quotes, `--` to en-dashes, `---` to em-dashes,\n and `...` to ellipses. By default, this is `False`.\n\n<code>[normalize]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Consolidate adjacent text nodes in the parsed AST. By default, this is `False`.\n\n<code>[sourcepos]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Include `sourcepos` attributes on elements indicating their line/column\n positions in the original Markdown source. By default, this is `False`.\n\n<code>[unsafe]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Allow raw HTML to pass through. By default, this is `False`.\n\n<code>[footnotes]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [bool]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[False]{.va}]{.doc-parameter-default}</code>\n\n: Enable footnote syntax parsing. By default, this is `False`.\n\n<code>[extensions]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [Sequence[str]]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [()<br>]{.doc-parameter-default}</code>\n\n: A sequence of GFM extension names to enable. Valid names are `\"table\"`,\n `\"strikethrough\"`, `\"autolink\"`, `\"tagfilter\"`, and `\"tasklist\"`.\n\n<code>[options]{.doc-parameter-name}[:]{.doc-parameter-annotation-sep} [int]{.doc-parameter-annotation} [=]{.doc-parameter-default-sep .op} [[0]{.dv}]{.doc-parameter-default}</code>\n\n: An integer bitmask of `Options` flags (e.g., `Options.SMART | Options.UNSAFE`).\n Merged via OR with any boolean keyword arguments set to `True`.\n Defaults to `0`.\n:::\n\n## Keyword Arguments Vs. Options Flags {.doc-keyword-arguments-vs-options-flags}\n\nThe boolean keyword arguments (`smart`, `unsafe`, `hardbreaks`, etc.) are convenience\nshortcuts for the most common `Options` flags. When both styles are provided, they\nare merged via OR. See `markdown_to_html()` for a detailed explanation.\n\n## Returns {.doc-returns}\n\n::: {.doc-definition-items}\n<code> [str]{.doc-parameter-annotation}</code>\n\n: The rendered XML string, including the XML declaration and DOCTYPE.\n:::\n\n## Examples {.doc-examples}\n\nInspect the AST structure of a simple document:\n\n::: {#18de299e .cell execution_count=1}\n``` {.python .cell-code}\nfrom multimark import markdown_to_xml\n\nprint(markdown_to_xml(\"**hello**\"))\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n<document xmlns=\"http://commonmark.org/xml/1.0\">\n <paragraph>\n <strong>\n <text xml:space=\"preserve\">hello</text>\n </strong>\n </paragraph>\n</document>\n\n```\n:::\n:::\n\n\nAdd source position information:\n\n::: {#695b81c3 .cell execution_count=2}\n``` {.python .cell-code}\nmarkdown_to_xml(\"# Title\\n\\nBody text\\n\", sourcepos=True)\n```\n\n::: {.cell-output .cell-output-display execution_count=2}\n```\n'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\\n<document sourcepos=\"1:1-3:9\" xmlns=\"http://commonmark.org/xml/1.0\">\\n <heading sourcepos=\"1:1-1:7\" level=\"1\">\\n <text sourcepos=\"1:3-1:7\" xml:space=\"preserve\">Title</text>\\n </heading>\\n <paragraph sourcepos=\"3:1-3:9\">\\n <text sourcepos=\"3:1-3:9\" xml:space=\"preserve\">Body text</text>\\n </paragraph>\\n</document>\\n'\n```\n:::\n:::\n\n\n",
|
|
6
|
+
"supporting": [
|
|
7
|
+
"markdown_to_xml_files"
|
|
8
|
+
],
|
|
9
|
+
"filters": [],
|
|
10
|
+
"includes": {}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Licensed MIT © Zeno Rocha
|
|
6
6
|
*/
|
|
7
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof t?n=o(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?n=o(t.value,e):(n=r()(t),c("copy")),n};function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==l(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?f(t,{container:o}):e?"cut"===n?a(e):f(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=v(n);return t=o?(t=v(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var b=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return f(t,e)}},{key:"cut",value:function(t){return a(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:this.container,target:this.target(e),text:this.text(e)});this.emit(t?"success":"error",{action:n,text:t,trigger:e,clearSelection:function(){e&&e.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return m("action",t)}},{key:"defaultTarget",value:function(t){t=m("target",t);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(t){return m("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}])&&d(t.prototype,e),n&&d(t,n),r}()},828:function(t){var e;"undefined"==typeof Element||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,n){var u=n(828);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=u(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},879:function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,n){var f=n(879),l=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!f.string(e))throw new TypeError("Second argument must be a String");if(!f.fn(n))throw new TypeError("Third argument must be a Function");if(f.node(t))return c=e,a=n,(u=t).addEventListener(c,a),{destroy:function(){u.removeEventListener(c,a)}};if(f.nodeList(t))return o=t,r=e,i=n,Array.prototype.forEach.call(o,function(t){t.addEventListener(r,i)}),{destroy:function(){Array.prototype.forEach.call(o,function(t){t.removeEventListener(r,i)})}};if(f.string(t))return t=t,e=e,n=n,l(document.body,t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,u,c,a}},817:function(t){t.exports=function(t){var e,n="SELECT"===t.nodeName?(t.focus(),t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?((e=t.hasAttribute("readonly"))||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),e||t.removeAttribute("readonly"),t.value):(t.hasAttribute("contenteditable")&&t.focus(),n=window.getSelection(),(e=document.createRange()).selectNodeContents(t),n.removeAllRanges(),n.addRange(e),n.toString());return n}},279:function(t){function e(){}e.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,u=o.length;i<u;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e}},r={},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o(686).default;function o(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return n[t](e,e.exports,o),e.exports}var n,r});
|
|
7
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof t?n=o(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?n=o(t.value,e):(n=r()(t),c("copy")),n};function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==l(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?f(t,{container:o}):e?"cut"===n?a(e):f(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=v(n);return t=o?(t=v(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var b=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return f(t,e)}},{key:"cut",value:function(t){return a(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:this.container,target:this.target(e),text:this.text(e)});this.emit(t?"success":"error",{action:n,text:t,trigger:e,clearSelection:function(){e&&e.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return m("action",t)}},{key:"defaultTarget",value:function(t){t=m("target",t);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(t){return m("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}])&&d(t.prototype,e),n&&d(t,n),r}()},828:function(t){var e;"undefined"==typeof Element||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,n){var u=n(828);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=u(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},879:function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,n){var f=n(879),l=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!f.string(e))throw new TypeError("Second argument must be a String");if(!f.fn(n))throw new TypeError("Third argument must be a Function");if(f.node(t))return c=e,a=n,(u=t).addEventListener(c,a),{destroy:function(){u.removeEventListener(c,a)}};if(f.nodeList(t))return o=t,r=e,i=n,Array.prototype.forEach.call(o,function(t){t.addEventListener(r,i)}),{destroy:function(){Array.prototype.forEach.call(o,function(t){t.removeEventListener(r,i)})}};if(f.string(t))return t=t,e=e,n=n,l(document.body,t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,u,c,a}},817:function(t){t.exports=function(t){var e,n="SELECT"===t.nodeName?(t.focus(),t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?((e=t.hasAttribute("readonly"))||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),e||t.removeAttribute("readonly"),t.value):(t.hasAttribute("contenteditable")&&t.focus(),n=window.getSelection(),(e=document.createRange()).selectNodeContents(t),n.removeAllRanges(),n.addRange(e),n.toString());return n}},279:function(t){function e(){}e.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,u=o.length;i<u;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e}},r={},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o(686).default;function o(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return n[t](e,e.exports,o),e.exports}var n,r});
|