mathml2docx 0.1.3__tar.gz → 1.0.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.
- mathml2docx-1.0.0/.github/workflows/docs.yml +44 -0
- mathml2docx-1.0.0/.github/workflows/publish.yml +83 -0
- mathml2docx-1.0.0/.github/workflows/python-app.yml +121 -0
- mathml2docx-1.0.0/.github/workflows/testpypi.yml +90 -0
- mathml2docx-1.0.0/.python-version +1 -0
- mathml2docx-1.0.0/CHANGELOG.md +60 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/LICENSE +1 -1
- mathml2docx-1.0.0/PKG-INFO +154 -0
- mathml2docx-1.0.0/README.ko.md +113 -0
- mathml2docx-1.0.0/README.md +115 -0
- mathml2docx-1.0.0/THIRD_PARTY_NOTICES.md +92 -0
- mathml2docx-1.0.0/docs/01-getting-started.md +56 -0
- mathml2docx-1.0.0/docs/02-api.md +64 -0
- mathml2docx-1.0.0/docs/03-mathematics.md +172 -0
- mathml2docx-1.0.0/docs/04-publishing.md +52 -0
- mathml2docx-1.0.0/docs/05-migration.md +122 -0
- mathml2docx-1.0.0/docs/06-xsl-provenance.md +28 -0
- mathml2docx-1.0.0/docs/07-upstream-audit.md +99 -0
- mathml2docx-1.0.0/docs/08-recipes.md +165 -0
- mathml2docx-1.0.0/docs/09-development-release.md +190 -0
- mathml2docx-1.0.0/docs/10-licensing.md +41 -0
- mathml2docx-1.0.0/docs/11-validation.md +129 -0
- mathml2docx-1.0.0/docs/12-choosing.md +16 -0
- mathml2docx-1.0.0/docs/assets/previews/01_quickstart.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/02_files_unicode.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/03_existing_document.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/04_inline_formatting.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/05_stylesheets.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/06_word_styles.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/07_page_layout.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/08_tables.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/09_lists.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/10_data_images.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/11_local_images.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/12_asset_loader.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/13_mathml.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/14_latex.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/15_markers.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/16_bookmarks.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/17_docxtpl.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/18_options.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/19_style_helpers.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/20_links.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/21_report.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/22_markdown.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/23_complex_equations.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/24_dense_report.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/25_research_report.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/26_template_workbook.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/27_advanced_latex.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/28_chemistry_enclosures.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/29_math_fallbacks.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/30_mathml_fidelity.pdf +0 -0
- mathml2docx-1.0.0/docs/assets/previews/renderer.json +157 -0
- mathml2docx-1.0.0/docs/examples/00-index.md +45 -0
- mathml2docx-1.0.0/docs/examples/01_quickstart.md +28 -0
- mathml2docx-1.0.0/docs/examples/02_files_unicode.md +32 -0
- mathml2docx-1.0.0/docs/examples/03_existing_document.md +35 -0
- mathml2docx-1.0.0/docs/examples/04_inline_formatting.md +30 -0
- mathml2docx-1.0.0/docs/examples/05_stylesheets.md +34 -0
- mathml2docx-1.0.0/docs/examples/06_word_styles.md +41 -0
- mathml2docx-1.0.0/docs/examples/07_page_layout.md +28 -0
- mathml2docx-1.0.0/docs/examples/08_tables.md +32 -0
- mathml2docx-1.0.0/docs/examples/09_lists.md +28 -0
- mathml2docx-1.0.0/docs/examples/10_data_images.md +33 -0
- mathml2docx-1.0.0/docs/examples/11_local_images.md +29 -0
- mathml2docx-1.0.0/docs/examples/12_asset_loader.md +35 -0
- mathml2docx-1.0.0/docs/examples/13_mathml.md +34 -0
- mathml2docx-1.0.0/docs/examples/14_latex.md +30 -0
- mathml2docx-1.0.0/docs/examples/15_markers.md +40 -0
- mathml2docx-1.0.0/docs/examples/16_bookmarks.md +41 -0
- mathml2docx-1.0.0/docs/examples/17_docxtpl.md +39 -0
- mathml2docx-1.0.0/docs/examples/18_options.md +31 -0
- mathml2docx-1.0.0/docs/examples/19_style_helpers.md +35 -0
- mathml2docx-1.0.0/docs/examples/20_links.md +28 -0
- mathml2docx-1.0.0/docs/examples/21_report.md +52 -0
- mathml2docx-1.0.0/docs/examples/22_markdown.md +42 -0
- mathml2docx-1.0.0/docs/examples/23_complex_equations.md +49 -0
- mathml2docx-1.0.0/docs/examples/24_dense_report.md +49 -0
- mathml2docx-1.0.0/docs/examples/25_research_report.md +79 -0
- mathml2docx-1.0.0/docs/examples/26_template_workbook.md +89 -0
- mathml2docx-1.0.0/docs/examples/27_advanced_latex.md +79 -0
- mathml2docx-1.0.0/docs/examples/28_chemistry_enclosures.md +43 -0
- mathml2docx-1.0.0/docs/examples/29_math_fallbacks.md +58 -0
- mathml2docx-1.0.0/docs/examples/30_mathml_fidelity.md +121 -0
- mathml2docx-1.0.0/docs/index.md +37 -0
- mathml2docx-1.0.0/docs/ko/01-getting-started.md +56 -0
- mathml2docx-1.0.0/docs/ko/02-api.md +65 -0
- mathml2docx-1.0.0/docs/ko/03-mathematics.md +163 -0
- mathml2docx-1.0.0/docs/ko/04-publishing.md +48 -0
- mathml2docx-1.0.0/docs/ko/05-migration.md +115 -0
- mathml2docx-1.0.0/docs/ko/06-xsl-provenance.md +28 -0
- mathml2docx-1.0.0/docs/ko/07-upstream-audit.md +83 -0
- mathml2docx-1.0.0/docs/ko/08-recipes.md +159 -0
- mathml2docx-1.0.0/docs/ko/09-development-release.md +182 -0
- mathml2docx-1.0.0/docs/ko/10-licensing.md +39 -0
- mathml2docx-1.0.0/docs/ko/11-validation.md +122 -0
- mathml2docx-1.0.0/docs/ko/12-choosing.md +15 -0
- mathml2docx-1.0.0/docs/ko/examples/00-index.md +45 -0
- mathml2docx-1.0.0/docs/ko/examples/01_quickstart.md +28 -0
- mathml2docx-1.0.0/docs/ko/examples/02_files_unicode.md +32 -0
- mathml2docx-1.0.0/docs/ko/examples/03_existing_document.md +35 -0
- mathml2docx-1.0.0/docs/ko/examples/04_inline_formatting.md +30 -0
- mathml2docx-1.0.0/docs/ko/examples/05_stylesheets.md +34 -0
- mathml2docx-1.0.0/docs/ko/examples/06_word_styles.md +41 -0
- mathml2docx-1.0.0/docs/ko/examples/07_page_layout.md +28 -0
- mathml2docx-1.0.0/docs/ko/examples/08_tables.md +32 -0
- mathml2docx-1.0.0/docs/ko/examples/09_lists.md +28 -0
- mathml2docx-1.0.0/docs/ko/examples/10_data_images.md +33 -0
- mathml2docx-1.0.0/docs/ko/examples/11_local_images.md +29 -0
- mathml2docx-1.0.0/docs/ko/examples/12_asset_loader.md +35 -0
- mathml2docx-1.0.0/docs/ko/examples/13_mathml.md +34 -0
- mathml2docx-1.0.0/docs/ko/examples/14_latex.md +30 -0
- mathml2docx-1.0.0/docs/ko/examples/15_markers.md +40 -0
- mathml2docx-1.0.0/docs/ko/examples/16_bookmarks.md +41 -0
- mathml2docx-1.0.0/docs/ko/examples/17_docxtpl.md +39 -0
- mathml2docx-1.0.0/docs/ko/examples/18_options.md +31 -0
- mathml2docx-1.0.0/docs/ko/examples/19_style_helpers.md +35 -0
- mathml2docx-1.0.0/docs/ko/examples/20_links.md +28 -0
- mathml2docx-1.0.0/docs/ko/examples/21_report.md +52 -0
- mathml2docx-1.0.0/docs/ko/examples/22_markdown.md +42 -0
- mathml2docx-1.0.0/docs/ko/examples/23_complex_equations.md +49 -0
- mathml2docx-1.0.0/docs/ko/examples/24_dense_report.md +49 -0
- mathml2docx-1.0.0/docs/ko/examples/25_research_report.md +79 -0
- mathml2docx-1.0.0/docs/ko/examples/26_template_workbook.md +89 -0
- mathml2docx-1.0.0/docs/ko/examples/27_advanced_latex.md +79 -0
- mathml2docx-1.0.0/docs/ko/examples/28_chemistry_enclosures.md +43 -0
- mathml2docx-1.0.0/docs/ko/examples/29_math_fallbacks.md +58 -0
- mathml2docx-1.0.0/docs/ko/examples/30_mathml_fidelity.md +121 -0
- mathml2docx-1.0.0/docs/ko/index.md +37 -0
- mathml2docx-1.0.0/docs_site/navigation.json +408 -0
- mathml2docx-1.0.0/docs_site/page.html +53 -0
- mathml2docx-1.0.0/docs_site/site.css +116 -0
- mathml2docx-1.0.0/docs_site/site.js +100 -0
- mathml2docx-1.0.0/examples/01_quickstart.py +10 -0
- mathml2docx-1.0.0/examples/02_files_unicode.py +14 -0
- mathml2docx-1.0.0/examples/03_existing_document.py +17 -0
- mathml2docx-1.0.0/examples/04_inline_formatting.py +12 -0
- mathml2docx-1.0.0/examples/05_stylesheets.py +16 -0
- mathml2docx-1.0.0/examples/06_word_styles.py +23 -0
- mathml2docx-1.0.0/examples/07_page_layout.py +10 -0
- mathml2docx-1.0.0/examples/08_tables.py +14 -0
- mathml2docx-1.0.0/examples/09_lists.py +10 -0
- mathml2docx-1.0.0/examples/10_data_images.py +15 -0
- mathml2docx-1.0.0/examples/11_local_images.py +11 -0
- mathml2docx-1.0.0/examples/12_asset_loader.py +17 -0
- mathml2docx-1.0.0/examples/13_mathml.py +16 -0
- mathml2docx-1.0.0/examples/14_latex.py +12 -0
- mathml2docx-1.0.0/examples/15_markers.py +22 -0
- mathml2docx-1.0.0/examples/16_bookmarks.py +23 -0
- mathml2docx-1.0.0/examples/17_docxtpl.py +21 -0
- mathml2docx-1.0.0/examples/18_options.py +13 -0
- mathml2docx-1.0.0/examples/19_style_helpers.py +17 -0
- mathml2docx-1.0.0/examples/20_links.py +10 -0
- mathml2docx-1.0.0/examples/21_report.py +11 -0
- mathml2docx-1.0.0/examples/22_markdown.py +24 -0
- mathml2docx-1.0.0/examples/23_complex_equations.py +25 -0
- mathml2docx-1.0.0/examples/24_dense_report.py +31 -0
- mathml2docx-1.0.0/examples/25_research_report.py +46 -0
- mathml2docx-1.0.0/examples/26_template_workbook.py +56 -0
- mathml2docx-1.0.0/examples/27_advanced_latex.py +48 -0
- mathml2docx-1.0.0/examples/28_chemistry_enclosures.py +25 -0
- mathml2docx-1.0.0/examples/29_math_fallbacks.py +40 -0
- mathml2docx-1.0.0/examples/30_mathml_fidelity.py +97 -0
- mathml2docx-1.0.0/examples/__init__.py +1 -0
- mathml2docx-1.0.0/examples/advanced_math.py +11 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A01.html +64 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A02.html +170 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A03.html +97 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A04.html +103 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A05.html +67 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A06.html +66 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A07.html +81 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A08.html +73 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A09.html +113 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/A10.html +106 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/B01.tex +1 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/B02.tex +1 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/B03.tex +1 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/B04.tex +1 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/B05.tex +1 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/B06.tex +1 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/B07.tex +1 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/B08.tex +1 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/README.md +19 -0
- mathml2docx-1.0.0/examples/assets/advanced-math/catalog.json +110 -0
- mathml2docx-1.0.0/examples/assets/boxed-x.png +0 -0
- mathml2docx-1.0.0/examples/assets/circled-x.png +0 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L01.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L02.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L03.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L04.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L05.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L06.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L07.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L08.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L09.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L10.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L11.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L12.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L13.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L14.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L15.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L16.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L17.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L18.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L19.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L20.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L21.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L22.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L23.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/L24.tex +1 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M01.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M02.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M03.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M04.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M05.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M06.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M07.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M08.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M09.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M10.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M11.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M12.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M13.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M14.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M15.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M16.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M17.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M18.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M19.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/M20.html +3 -0
- mathml2docx-1.0.0/examples/assets/math-corpus/catalog.json +266 -0
- mathml2docx-1.0.0/examples/assets/mixed_math.html +16 -0
- mathml2docx-1.0.0/examples/assets/report.html +17 -0
- mathml2docx-1.0.0/examples/assets/swatch.png +0 -0
- mathml2docx-1.0.0/examples/catalog.json +122 -0
- mathml2docx-1.0.0/examples/catalog.ko.json +122 -0
- mathml2docx-1.0.0/examples/math_corpus.py +95 -0
- mathml2docx-1.0.0/examples/run_all.py +15 -0
- mathml2docx-1.0.0/examples/support.py +15 -0
- mathml2docx-1.0.0/mathml2docx/__init__.py +17 -0
- mathml2docx-1.0.0/mathml2docx/__main__.py +54 -0
- mathml2docx-1.0.0/mathml2docx/config.py +32 -0
- mathml2docx-1.0.0/mathml2docx/css.py +143 -0
- mathml2docx-1.0.0/mathml2docx/h2d.py +832 -0
- mathml2docx-1.0.0/mathml2docx/markdown.py +22 -0
- mathml2docx-1.0.0/mathml2docx/math.py +1253 -0
- mathml2docx-1.0.0/mathml2docx/math_styles.py +110 -0
- mathml2docx-1.0.0/mathml2docx/styles.py +178 -0
- mathml2docx-1.0.0/mathml2docx/templates.py +289 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/mathml2docx/utils.py +15 -20
- mathml2docx-1.0.0/mathml2docx/wrapper.py +154 -0
- mathml2docx-1.0.0/pyproject.toml +81 -0
- mathml2docx-1.0.0/scripts/build_docs.py +249 -0
- mathml2docx-1.0.0/scripts/check_dist.py +85 -0
- mathml2docx-1.0.0/scripts/check_math_mutations.py +191 -0
- mathml2docx-1.0.0/scripts/check_release.py +56 -0
- mathml2docx-1.0.0/scripts/check_testpypi_install.py +125 -0
- mathml2docx-1.0.0/scripts/check_testpypi_run.py +64 -0
- mathml2docx-1.0.0/scripts/check_wheel_install.py +46 -0
- mathml2docx-1.0.0/scripts/check_word.py +731 -0
- mathml2docx-1.0.0/scripts/prepare_ecma_schema.py +45 -0
- mathml2docx-1.0.0/scripts/prepare_testpypi.py +56 -0
- mathml2docx-1.0.0/scripts/render_examples.py +213 -0
- mathml2docx-1.0.0/scripts/site_builder.py +383 -0
- mathml2docx-1.0.0/scripts/smoke_distribution.py +102 -0
- mathml2docx-1.0.0/scripts/test_legacy.sh +30 -0
- mathml2docx-1.0.0/scripts/validate_math_schema.py +111 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/__init__.py +0 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/context.py +0 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/dataset/code.html +0 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/dataset/mathml.html +0 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/dataset/tables1.html +0 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/dataset/tables2.html +0 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/dataset/tables3.html +0 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/dataset/testimg.png +0 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/dataset/text1.html +0 -0
- mathml2docx-1.0.0/tests/docx_oracle.py +564 -0
- mathml2docx-1.0.0/tests/fixtures/README.md +104 -0
- mathml2docx-1.0.0/tests/fixtures/advanced_math_expectations.json +2441 -0
- mathml2docx-1.0.0/tests/fixtures/example_equation_counts.json +125 -0
- mathml2docx-1.0.0/tests/fixtures/math_expectations.json +1296 -0
- mathml2docx-1.0.0/tests/fixtures/mathml_fidelity_expectations.json +198 -0
- mathml2docx-1.0.0/tests/fixtures/mixed_math_expectation.json +335 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/test.py +1 -1
- mathml2docx-1.0.0/tests/test_advanced_documents.py +240 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/test_code.py +0 -0
- mathml2docx-1.0.0/tests/test_docx_oracles.py +252 -0
- mathml2docx-1.0.0/tests/test_examples.py +69 -0
- mathml2docx-1.0.0/tests/test_existing_fixes.py +60 -0
- mathml2docx-1.0.0/tests/test_extended.py +213 -0
- mathml2docx-1.0.0/tests/test_math_audit_regressions.py +439 -0
- mathml2docx-1.0.0/tests/test_math_html_regressions.py +208 -0
- mathml2docx-1.0.0/tests/test_math_oracle_regressions.py +201 -0
- mathml2docx-1.0.0/tests/test_math_policies.py +294 -0
- mathml2docx-1.0.0/tests/test_math_template_regressions.py +290 -0
- mathml2docx-1.0.0/tests/test_math_validation.py +362 -0
- mathml2docx-1.0.0/tests/test_regressions.py +73 -0
- mathml2docx-1.0.0/tests/test_release_metadata.py +207 -0
- mathml2docx-1.0.0/tests/test_rendering.py +26 -0
- {mathml2docx-0.1.3 → mathml2docx-1.0.0}/tests/test_tables.py +0 -0
- mathml2docx-1.0.0/tests/test_v1.py +307 -0
- mathml2docx-1.0.0/tests/test_word_comparison_regressions.py +446 -0
- mathml2docx-1.0.0/uv.lock +3225 -0
- mathml2docx-0.1.3/.github/workflows/python-app.yml +0 -47
- mathml2docx-0.1.3/.gitignore +0 -7
- mathml2docx-0.1.3/PKG-INFO +0 -125
- mathml2docx-0.1.3/README.md +0 -88
- mathml2docx-0.1.3/mathml2docx/MML2OMML.XSL +0 -3822
- mathml2docx-0.1.3/mathml2docx/__init__.py +0 -4
- mathml2docx-0.1.3/mathml2docx/config.py +0 -37
- mathml2docx-0.1.3/mathml2docx/h2d.py +0 -697
- mathml2docx-0.1.3/mathml2docx/wrapper.py +0 -202
- mathml2docx-0.1.3/mathml2docx.egg-info/PKG-INFO +0 -125
- mathml2docx-0.1.3/mathml2docx.egg-info/SOURCES.txt +0 -29
- mathml2docx-0.1.3/mathml2docx.egg-info/dependency_links.txt +0 -1
- mathml2docx-0.1.3/mathml2docx.egg-info/requires.txt +0 -2
- mathml2docx-0.1.3/mathml2docx.egg-info/top_level.txt +0 -1
- mathml2docx-0.1.3/pyproject.toml +0 -33
- mathml2docx-0.1.3/requirements.txt +0 -2
- mathml2docx-0.1.3/setup.cfg +0 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, develop, compat/python36-uv]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master, develop]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: docs-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v6
|
|
22
|
+
- uses: astral-sh/setup-uv@v7
|
|
23
|
+
with:
|
|
24
|
+
version: '0.13.7'
|
|
25
|
+
- run: uv sync --locked --extra latex --extra markdown --group docs --group examples
|
|
26
|
+
- run: uv run --no-sync python scripts/build_docs.py
|
|
27
|
+
- uses: actions/upload-pages-artifact@v4
|
|
28
|
+
with:
|
|
29
|
+
path: site
|
|
30
|
+
|
|
31
|
+
deploy:
|
|
32
|
+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
|
33
|
+
needs: build
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
permissions:
|
|
36
|
+
pages: write
|
|
37
|
+
id-token: write
|
|
38
|
+
environment:
|
|
39
|
+
name: github-pages
|
|
40
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/configure-pages@v5
|
|
43
|
+
- uses: actions/deploy-pages@v4
|
|
44
|
+
id: deployment
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ['v*']
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
actions: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: pypi-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: false
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
gate:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v6
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
persist-credentials: false
|
|
24
|
+
- uses: astral-sh/setup-uv@v7
|
|
25
|
+
with:
|
|
26
|
+
version: '0.13.7'
|
|
27
|
+
- name: Verify tag version and source on master
|
|
28
|
+
env:
|
|
29
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
30
|
+
RELEASE_EVENT: ${{ github.event_name }}
|
|
31
|
+
run: |
|
|
32
|
+
if [ "$RELEASE_EVENT" = push ]; then
|
|
33
|
+
uv run --no-project --python 3.14 --with 'packaging>=24,<27' python scripts/check_release.py --tag "$RELEASE_TAG"
|
|
34
|
+
else
|
|
35
|
+
uv run --no-project --python 3.14 --with 'packaging>=24,<27' python scripts/check_release.py
|
|
36
|
+
fi
|
|
37
|
+
- name: Require TestPyPI upload and installation for this exact commit
|
|
38
|
+
if: github.event_name == 'push'
|
|
39
|
+
env:
|
|
40
|
+
GH_TOKEN: ${{ github.token }}
|
|
41
|
+
run: uv run --no-project --python 3.14 python scripts/check_testpypi_run.py
|
|
42
|
+
|
|
43
|
+
checks:
|
|
44
|
+
needs: gate
|
|
45
|
+
uses: ./.github/workflows/python-app.yml
|
|
46
|
+
|
|
47
|
+
build:
|
|
48
|
+
needs: checks
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v6
|
|
52
|
+
with:
|
|
53
|
+
persist-credentials: false
|
|
54
|
+
- uses: astral-sh/setup-uv@v7
|
|
55
|
+
with:
|
|
56
|
+
version: '0.13.7'
|
|
57
|
+
- run: uv build
|
|
58
|
+
- run: uv run --no-project --python 3.14 python scripts/check_dist.py
|
|
59
|
+
- run: uv run --no-project --python 3.14 --with 'twine>=6,<7' twine check dist/*
|
|
60
|
+
- run: uv run --no-project --python 3.14 python scripts/check_wheel_install.py
|
|
61
|
+
- uses: actions/upload-artifact@v4
|
|
62
|
+
with:
|
|
63
|
+
name: pypi-distributions
|
|
64
|
+
overwrite: true
|
|
65
|
+
path: dist/
|
|
66
|
+
|
|
67
|
+
publish:
|
|
68
|
+
# Creating a GitHub Release does not upload again. Only a validated final tag
|
|
69
|
+
# can publish; workflow_dispatch validates/builds without uploading.
|
|
70
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
71
|
+
needs: build
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
environment:
|
|
74
|
+
name: pypi
|
|
75
|
+
url: https://pypi.org/p/mathml2docx
|
|
76
|
+
permissions:
|
|
77
|
+
id-token: write
|
|
78
|
+
steps:
|
|
79
|
+
- uses: actions/download-artifact@v4
|
|
80
|
+
with:
|
|
81
|
+
name: pypi-distributions
|
|
82
|
+
path: dist/
|
|
83
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
name: Python package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [develop, compat/python36-uv]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master, develop]
|
|
8
|
+
workflow_call:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
legacy:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
image: ['python:3.6.15-slim-buster', 'python:3.7.17-slim-bullseye']
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v6
|
|
22
|
+
with:
|
|
23
|
+
persist-credentials: false
|
|
24
|
+
- name: Test legacy source and installed wheel
|
|
25
|
+
run: bash scripts/test_legacy.sh '${{ matrix.image }}'
|
|
26
|
+
|
|
27
|
+
test:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
strategy:
|
|
30
|
+
fail-fast: false
|
|
31
|
+
matrix:
|
|
32
|
+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v6
|
|
35
|
+
with:
|
|
36
|
+
persist-credentials: false
|
|
37
|
+
- uses: astral-sh/setup-uv@v7
|
|
38
|
+
with:
|
|
39
|
+
version: '0.13.7'
|
|
40
|
+
- run: uv sync --locked --no-default-groups --python '${{ matrix.python-version }}' --extra latex --extra markdown --extra test
|
|
41
|
+
- run: .venv/bin/python -m unittest discover -v
|
|
42
|
+
- run: .venv/bin/python -m pytest -q tests/test_math_audit_regressions.py tests/test_math_html_regressions.py
|
|
43
|
+
- name: Check utility docstrings through package imports
|
|
44
|
+
run: |
|
|
45
|
+
.venv/bin/python - <<'PY'
|
|
46
|
+
import doctest
|
|
47
|
+
from mathml2docx import utils
|
|
48
|
+
result = doctest.testmod(utils, verbose=True)
|
|
49
|
+
raise SystemExit(bool(result.failed))
|
|
50
|
+
PY
|
|
51
|
+
|
|
52
|
+
platforms:
|
|
53
|
+
runs-on: ${{ matrix.os }}
|
|
54
|
+
strategy:
|
|
55
|
+
fail-fast: false
|
|
56
|
+
matrix:
|
|
57
|
+
include:
|
|
58
|
+
- {os: windows-latest, python-version: '3.8'}
|
|
59
|
+
- {os: windows-latest, python-version: '3.14'}
|
|
60
|
+
- {os: macos-15-intel, python-version: '3.14'}
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v6
|
|
63
|
+
with:
|
|
64
|
+
persist-credentials: false
|
|
65
|
+
- uses: astral-sh/setup-uv@v7
|
|
66
|
+
with:
|
|
67
|
+
version: '0.13.7'
|
|
68
|
+
- run: uv sync --locked --no-default-groups --python '${{ matrix.python-version }}' --extra latex --extra markdown --extra test
|
|
69
|
+
- run: uv run --no-sync --no-default-groups --python '${{ matrix.python-version }}' python -m unittest discover -v
|
|
70
|
+
- run: uv run --no-sync --no-default-groups --python '${{ matrix.python-version }}' python -m pytest -q tests/test_math_audit_regressions.py tests/test_math_html_regressions.py
|
|
71
|
+
|
|
72
|
+
quality:
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/checkout@v6
|
|
76
|
+
with:
|
|
77
|
+
persist-credentials: false
|
|
78
|
+
- uses: astral-sh/setup-uv@v7
|
|
79
|
+
with:
|
|
80
|
+
version: '0.13.7'
|
|
81
|
+
- run: uv sync --locked --all-extras --group docs --group examples
|
|
82
|
+
- run: uv run --no-sync python -m pytest -q
|
|
83
|
+
- run: uv run --no-sync python scripts/check_math_mutations.py
|
|
84
|
+
- run: uv run --no-sync ruff check mathml2docx tests/test_v1.py tests/test_regressions.py tests/test_existing_fixes.py tests/test_extended.py tests/test_examples.py tests/test_math_validation.py tests/test_advanced_documents.py tests/test_math_policies.py tests/test_math_audit_regressions.py tests/test_math_html_regressions.py tests/test_math_template_regressions.py tests/test_math_oracle_regressions.py tests/test_word_comparison_regressions.py tests/test_rendering.py tests/test_docx_oracles.py tests/test_release_metadata.py tests/docx_oracle.py examples scripts
|
|
85
|
+
- run: uv run --no-sync ruff format --check mathml2docx tests/test_v1.py tests/test_regressions.py tests/test_existing_fixes.py tests/test_extended.py tests/test_examples.py tests/test_math_validation.py tests/test_advanced_documents.py tests/test_math_policies.py tests/test_math_audit_regressions.py tests/test_math_html_regressions.py tests/test_math_template_regressions.py tests/test_math_oracle_regressions.py tests/test_word_comparison_regressions.py tests/test_rendering.py tests/test_docx_oracles.py tests/test_release_metadata.py tests/docx_oracle.py examples scripts
|
|
86
|
+
- run: uv run --no-sync python scripts/build_docs.py
|
|
87
|
+
- name: Validate mathematical and document structure against official schemas
|
|
88
|
+
run: |
|
|
89
|
+
uv run --no-sync python scripts/prepare_ecma_schema.py "$RUNNER_TEMP/ecma376"
|
|
90
|
+
uv run --no-sync python scripts/validate_math_schema.py --schemas "$RUNNER_TEMP/ecma376" --docx-dir site/downloads/examples
|
|
91
|
+
- run: uv build
|
|
92
|
+
- run: uv run --no-sync python scripts/check_dist.py
|
|
93
|
+
- run: uv run --no-sync twine check dist/*
|
|
94
|
+
- uses: actions/upload-artifact@v4
|
|
95
|
+
with:
|
|
96
|
+
name: package-distributions
|
|
97
|
+
overwrite: true
|
|
98
|
+
path: dist/
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
libreoffice:
|
|
102
|
+
runs-on: ubuntu-24.04
|
|
103
|
+
steps:
|
|
104
|
+
- uses: actions/checkout@v6
|
|
105
|
+
with:
|
|
106
|
+
persist-credentials: false
|
|
107
|
+
- uses: astral-sh/setup-uv@v7
|
|
108
|
+
with:
|
|
109
|
+
version: '0.13.7'
|
|
110
|
+
- name: Install Writer, Math and fonts
|
|
111
|
+
run: |
|
|
112
|
+
sudo apt-get update
|
|
113
|
+
sudo apt-get install -y --no-install-recommends libreoffice-writer libreoffice-math poppler-utils fonts-noto-cjk fonts-stix
|
|
114
|
+
- run: uv sync --locked --no-default-groups --extra latex --extra markdown --group examples
|
|
115
|
+
- run: uv run --no-sync python -m examples.run_all
|
|
116
|
+
- name: Verify formula import and actual PDF math rendering
|
|
117
|
+
run: uv run --no-sync python scripts/render_examples.py --output examples/output/libreoffice-review
|
|
118
|
+
- uses: actions/upload-artifact@v4
|
|
119
|
+
with:
|
|
120
|
+
name: libreoffice-previews
|
|
121
|
+
path: examples/output/libreoffice-review/
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: TestPyPI candidate
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: testpypi-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: false
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
checks:
|
|
17
|
+
if: github.ref == 'refs/heads/master'
|
|
18
|
+
uses: ./.github/workflows/python-app.yml
|
|
19
|
+
|
|
20
|
+
build:
|
|
21
|
+
needs: checks
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
outputs:
|
|
24
|
+
version: ${{ steps.candidate.outputs.version }}
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v6
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
- uses: astral-sh/setup-uv@v7
|
|
30
|
+
with:
|
|
31
|
+
version: '0.13.7'
|
|
32
|
+
- name: Assign a unique development version in this checkout only
|
|
33
|
+
id: candidate
|
|
34
|
+
env:
|
|
35
|
+
CANDIDATE_RUN_ID: ${{ github.run_id }}
|
|
36
|
+
CANDIDATE_ATTEMPT: ${{ github.run_attempt }}
|
|
37
|
+
run: |
|
|
38
|
+
uv run --no-project --python 3.14 --with 'packaging>=24,<27' python -m scripts.prepare_testpypi --run-id "$CANDIDATE_RUN_ID" --attempt "$CANDIDATE_ATTEMPT" --output "$GITHUB_OUTPUT"
|
|
39
|
+
uv lock
|
|
40
|
+
- run: uv build
|
|
41
|
+
- run: uv run --no-project --python 3.14 python scripts/check_dist.py
|
|
42
|
+
- run: uv run --no-project --python 3.14 --with 'twine>=6,<7' twine check dist/*
|
|
43
|
+
- run: uv run --no-project --python 3.14 python scripts/check_wheel_install.py
|
|
44
|
+
- uses: actions/upload-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
name: testpypi-distributions
|
|
47
|
+
overwrite: true
|
|
48
|
+
path: dist/
|
|
49
|
+
- name: Report candidate version
|
|
50
|
+
env:
|
|
51
|
+
CANDIDATE_VERSION: ${{ steps.candidate.outputs.version }}
|
|
52
|
+
run: echo "TestPyPI candidate version is $CANDIDATE_VERSION" >> "$GITHUB_STEP_SUMMARY"
|
|
53
|
+
|
|
54
|
+
upload:
|
|
55
|
+
needs: build
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
environment:
|
|
58
|
+
name: testpypi
|
|
59
|
+
url: https://test.pypi.org/p/mathml2docx
|
|
60
|
+
permissions:
|
|
61
|
+
id-token: write
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/download-artifact@v4
|
|
64
|
+
with:
|
|
65
|
+
name: testpypi-distributions
|
|
66
|
+
path: dist/
|
|
67
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
68
|
+
with:
|
|
69
|
+
repository-url: https://test.pypi.org/legacy/
|
|
70
|
+
|
|
71
|
+
install:
|
|
72
|
+
needs: [build, upload]
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
strategy:
|
|
75
|
+
fail-fast: false
|
|
76
|
+
matrix:
|
|
77
|
+
python-version: ['3.8', '3.14']
|
|
78
|
+
steps:
|
|
79
|
+
- uses: actions/checkout@v6
|
|
80
|
+
with:
|
|
81
|
+
persist-credentials: false
|
|
82
|
+
- uses: astral-sh/setup-uv@v7
|
|
83
|
+
with:
|
|
84
|
+
version: '0.13.7'
|
|
85
|
+
- uses: actions/download-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: testpypi-distributions
|
|
88
|
+
path: dist/
|
|
89
|
+
- name: Install the exact published wheel and test public APIs
|
|
90
|
+
run: uv run --no-project --python 3.14 python scripts/check_testpypi_install.py --wheel dist/*.whl --python '${{ matrix.python-version }}'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.14
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0 — Unreleased
|
|
4
|
+
|
|
5
|
+
### Conversion and integration
|
|
6
|
+
|
|
7
|
+
- Replace the bundled Office XSL with a native Presentation MathML-to-OMML converter.
|
|
8
|
+
- Rework HTML traversal for merged/nested tables, inline assets, lists, links, and static CSS.
|
|
9
|
+
- Add optional LaTeX/Markdown frontends, a CLI, public Word style constants, class mappings,
|
|
10
|
+
and marker/bookmark replacement in existing documents.
|
|
11
|
+
- Preserve the Python 3.6 core runtime. LaTeX requires Python 3.6.2+ and latex2mathml 3.64+.
|
|
12
|
+
- Preserve adjacent matrix fence groups, complete parenthesized script bases, and
|
|
13
|
+
prefixed cases on older LaTeX backends. Apply explicit CSS fonts to East Asian
|
|
14
|
+
and complex-script slots as well as Latin text.
|
|
15
|
+
- Correct fraction types, mathematical alphabets, accents, delimiters, cases tables,
|
|
16
|
+
limit grouping, per-operator layout directives, inline spacing, and OOXML property order.
|
|
17
|
+
|
|
18
|
+
- Follow MathML inline defaults, with configurable missing-display layout and CSS precedence.
|
|
19
|
+
- Support selected enclosures and chemical prescripts, and explicit preprocessing, source/image
|
|
20
|
+
fallback, and LibreOffice compatibility policies. Avoid empty postscript placeholders.
|
|
21
|
+
|
|
22
|
+
- Honor scoped MathML defaults, compact movable limits, XML whitespace, Unicode input
|
|
23
|
+
declarations and quoted strings. Validate known arities before unsupported-element recovery.
|
|
24
|
+
- Recover explicitly for unsupported merged/ragged matrices, forced breaks, RTL and complex
|
|
25
|
+
accents instead of silently changing their meaning. Preserve supported MathML CSS and anchors.
|
|
26
|
+
- Preserve equations around template markers and within bookmark replacement boundaries.
|
|
27
|
+
- Preserve linked display equations and mixed math styles through Word resaving; align
|
|
28
|
+
native OMML properties with Unicode mathematical alphabets already emitted by LaTeX backends.
|
|
29
|
+
|
|
30
|
+
### Compatibility changes
|
|
31
|
+
|
|
32
|
+
- URL images and external stylesheets require explicit loaders; local images are limited
|
|
33
|
+
to a configured base directory.
|
|
34
|
+
- File conversion adds `.docx` once and returns the output Path.
|
|
35
|
+
- `fix_html` is retained for call compatibility; HTML always uses tree parsing.
|
|
36
|
+
- Style helpers require explicit run/paragraph targets. Unsupported MathML is reported
|
|
37
|
+
rather than silently dropped. Full browser CSS and complete MathML/LaTeX are not promised.
|
|
38
|
+
|
|
39
|
+
### Validation and packaging
|
|
40
|
+
|
|
41
|
+
- Replace MkDocs with a custom Markdown/Jinja static site, responsive navigation, bilingual
|
|
42
|
+
search and code copying. Rewrite reader-facing guides and remove session status reports.
|
|
43
|
+
- Check independently authored source equation counts before rendering, compare math run
|
|
44
|
+
styles and explicit display layout, and detect lost internal-link targets.
|
|
45
|
+
- Verify LibreOffice formula import counts and a real PDF math probe; fail when Math is missing.
|
|
46
|
+
Add a dedicated CI job and explicit Writer/Math/font setup instructions.
|
|
47
|
+
|
|
48
|
+
- Add text equation inputs and independent JSON answers for inspecting saved DOCX structures.
|
|
49
|
+
- Add 30 runnable examples, schema validation, mixed-document checks, and targeted corruption tests.
|
|
50
|
+
- Provide English-default and Korean READMEs and documentation, with equivalent-page
|
|
51
|
+
language switching and localized search.
|
|
52
|
+
- Add 18 advanced authored inputs with independent answers and optional Windows
|
|
53
|
+
Word open/PDF-export/resave checks, with 224 native equations across 30 examples.
|
|
54
|
+
- Exclude XSL and generated DOCX files from new package distributions; retain inherited MIT notices.
|
|
55
|
+
- Manage dependencies with uv and verify legacy/modern Python plus Windows/macOS in CI.
|
|
56
|
+
- Use develop for daily work, master pushes for unique TestPyPI candidates and remote
|
|
57
|
+
installation checks, and verified final tags for PyPI publishing through OIDC.
|
|
58
|
+
|
|
59
|
+
Historical XSL redistribution rights and application-specific visual review remain separate concerns.
|
|
60
|
+
See the migration, licensing, validation, and publishing documentation before release.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2019 pqzx
|
|
4
|
-
Copyright (c) 2024 joongi007
|
|
4
|
+
Copyright (c) 2024-2026 joongi007
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mathml2docx
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Convert HTML, MathML and optional LaTeX/Markdown to Word documents
|
|
5
|
+
Keywords: html,mathml,docx,convert
|
|
6
|
+
Author: joongi007
|
|
7
|
+
Requires-Python: >=3.6
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
22
|
+
Requires-Dist: beautifulsoup4>=4.12,<5
|
|
23
|
+
Requires-Dist: python-docx>=0.8.11,<2
|
|
24
|
+
Requires-Dist: lxml>=4.9,<7
|
|
25
|
+
Requires-Dist: tinycss2>=1.1,<2
|
|
26
|
+
Requires-Dist: Pillow>=8.4,<13
|
|
27
|
+
Requires-Dist: cssselect2>=0.4,<1
|
|
28
|
+
Requires-Dist: latex2mathml>=3.64,<4 ; extra == "latex" and ( python_full_version >= '3.6.2')
|
|
29
|
+
Requires-Dist: Markdown>=3.3,<4 ; extra == "markdown"
|
|
30
|
+
Requires-Dist: pytest>=6.2,<10 ; extra == "test"
|
|
31
|
+
Requires-Dist: docxtpl>=0.16,<1 ; extra == "test"
|
|
32
|
+
Requires-Dist: Markdown>=3.3,<4 ; extra == "test"
|
|
33
|
+
Project-URL: Documentation, https://joongi007.github.io/mathml2docx/
|
|
34
|
+
Project-URL: Repository, https://github.com/joongi007/mathml2docx
|
|
35
|
+
Provides-Extra: latex
|
|
36
|
+
Provides-Extra: markdown
|
|
37
|
+
Provides-Extra: test
|
|
38
|
+
|
|
39
|
+
# mathml2docx
|
|
40
|
+
|
|
41
|
+
[English](README.md) · [한국어](README.ko.md) · [Documentation](https://joongi007.github.io/mathml2docx/)
|
|
42
|
+
|
|
43
|
+
Convert HTML and MathML into Word documents with Python. Create reports, worksheets
|
|
44
|
+
and templates with **editable equations**, formatted text, tables and images.
|
|
45
|
+
Microsoft Office is not required to generate a document.
|
|
46
|
+
|
|
47
|
+
Python 3.6+ · Optional LaTeX and Markdown inputs · MIT license
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
This README describes the 1.0 API. Install the repository version while 1.0 is
|
|
52
|
+
unreleased on PyPI:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
python -m pip install 'git+https://github.com/joongi007/mathml2docx.git@master'
|
|
56
|
+
# With optional LaTeX and Markdown support:
|
|
57
|
+
python -m pip install 'mathml2docx[latex,markdown] @ git+https://github.com/joongi007/mathml2docx.git@master'
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Python 3.6.2+ is required for the optional LaTeX frontend. Library users do not need uv.
|
|
61
|
+
For a reproducible installation, replace `master` with a reviewed commit or release tag.
|
|
62
|
+
|
|
63
|
+
## Your first Word document
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from mathml2docx import convert
|
|
67
|
+
|
|
68
|
+
convert('''
|
|
69
|
+
<h1>Lesson notes</h1>
|
|
70
|
+
<p>The value <math><mfrac><mn>1</mn><mn>2</mn></mfrac></math> is one half.</p>
|
|
71
|
+
<math display="block"><msup><mi>x</mi><mn>2</mn></msup></math>
|
|
72
|
+
''', 'lesson.docx')
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Open `lesson.docx` in Word to edit its text and equations. `convert()` also returns
|
|
76
|
+
a python-docx `Document`; omit the output path to continue editing it in Python.
|
|
77
|
+
|
|
78
|
+
## What it supports
|
|
79
|
+
|
|
80
|
+
| Input or task | Features |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| HTML | Headings, paragraphs, links, nested lists and text formatting |
|
|
83
|
+
| Tables | Merged cells, nested tables and Word table styles |
|
|
84
|
+
| Images | Data URLs, configured local files and explicit application loaders |
|
|
85
|
+
| CSS | Supported selectors, fonts, colors, alignment and page breaks |
|
|
86
|
+
| MathML | Fractions, roots, scripts, limits, accents, matrices, selected enclosures and isotope scripts |
|
|
87
|
+
| LaTeX / Markdown | Optional frontends using latex2mathml and Python-Markdown |
|
|
88
|
+
| Templates | Add to an existing document or cell; replace markers and bookmarks |
|
|
89
|
+
|
|
90
|
+
The converter implements a documented subset of HTML, CSS and Presentation MathML.
|
|
91
|
+
It does not reproduce a complete browser layout.
|
|
92
|
+
|
|
93
|
+
## Equation layout and unsupported input
|
|
94
|
+
|
|
95
|
+
`<math>` is **inline by default**, following MathML. Use `display="block"` for a
|
|
96
|
+
separate display equation. To retain block behavior for input that omits `display`:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from mathml2docx import MathmlToDocx
|
|
100
|
+
|
|
101
|
+
parser = MathmlToDocx(default_math_display='block')
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Unsupported mathematical structures raise `UnsupportedMathMLError` by default.
|
|
105
|
+
Applications handling mixed input can select `unsupported_math='text'` to preserve
|
|
106
|
+
the formula's XML visibly, provide `mathml_fallback(source, error)` returning text
|
|
107
|
+
or an image, or normalize input with `mathml_preprocessor(source)`. Recovery emits
|
|
108
|
+
`MathMLFallbackWarning`; invalid XML still raises an error.
|
|
109
|
+
See [equation handling](https://joongi007.github.io/mathml2docx/03-mathematics/)
|
|
110
|
+
for supported notations and complete examples.
|
|
111
|
+
|
|
112
|
+
## LaTeX, Markdown and command line
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from mathml2docx import MathmlToDocx
|
|
116
|
+
|
|
117
|
+
parser = MathmlToDocx()
|
|
118
|
+
parser.parse_latex(r'\frac{1}{2} + x_1^2').save('equation.docx')
|
|
119
|
+
parser.parse_markdown('# Notes\n\n**Bold** and ~~removed~~ text.').save('notes.docx')
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
mathml2docx input.html output.docx
|
|
124
|
+
mathml2docx equation.tex equation.docx --format latex
|
|
125
|
+
mathml2docx input.html output.docx --default-math-display block --unsupported-math text
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Use `--force` to replace an existing output file. HTML dollar delimiters are not
|
|
129
|
+
interpreted as LaTeX. Network images and stylesheets require explicit loaders.
|
|
130
|
+
|
|
131
|
+
## Guides and examples
|
|
132
|
+
|
|
133
|
+
- [Getting started](https://joongi007.github.io/mathml2docx/01-getting-started/) · [API and options](https://joongi007.github.io/mathml2docx/02-api/) · [Recipes](https://joongi007.github.io/mathml2docx/08-recipes/)
|
|
134
|
+
- [Runnable examples and DOCX downloads](https://joongi007.github.io/mathml2docx/examples/00-index/): formatting, templates, scientific reports, chemistry and fallback rendering.
|
|
135
|
+
- [MathML fidelity example](https://joongi007.github.io/mathml2docx/examples/30_mathml_fidelity/): inherited defaults, accents, equation styles, links and template replacement.
|
|
136
|
+
- [Migration from 0.x](https://joongi007.github.io/mathml2docx/05-migration/) · [Compatibility and validation](https://joongi007.github.io/mathml2docx/11-validation/)
|
|
137
|
+
- [한국어 문서](https://joongi007.github.io/mathml2docx/ko/)
|
|
138
|
+
|
|
139
|
+
For headless PDF conversion with LibreOffice, install **Writer and Math**, plus
|
|
140
|
+
appropriate fonts. Writer-only installations can leave equations blank. The
|
|
141
|
+
[rendering guide](https://joongi007.github.io/mathml2docx/11-validation/#libreoffice)
|
|
142
|
+
includes installation and verification commands. Use `math_target='libreoffice'`
|
|
143
|
+
with an explicit fallback for known enclosure differences.
|
|
144
|
+
|
|
145
|
+
## Contributing and license
|
|
146
|
+
|
|
147
|
+
Work from `develop`; see [development and releases](https://joongi007.github.io/mathml2docx/09-development-release/)
|
|
148
|
+
for setup, tests and publishing. Changes are listed in [CHANGELOG.md](CHANGELOG.md).
|
|
149
|
+
|
|
150
|
+
[MIT](LICENSE), derived from [html2docx](https://github.com/pqzx/html2docx).
|
|
151
|
+
Dependencies retain their own licenses; see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
152
|
+
The 1.0 converter constructs OMML directly and includes no Office XSL. Historical
|
|
153
|
+
0.x distributions are covered separately in the [provenance record](https://joongi007.github.io/mathml2docx/06-xsl-provenance/).
|
|
154
|
+
|