docvortex 0.2.1__py3-none-any.whl
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.
- docvortex/__init__.py +21 -0
- docvortex/analyzers/__init__.py +3 -0
- docvortex/analyzers/native/__init__.py +37 -0
- docvortex/analyzers/native/_shared/__init__.py +3 -0
- docvortex/analyzers/native/_shared/hyperlink.py +16 -0
- docvortex/analyzers/native/_shared/image.py +8 -0
- docvortex/analyzers/native/_shared/markup/__init__.py +47 -0
- docvortex/analyzers/native/_shared/markup/anchors.py +30 -0
- docvortex/analyzers/native/_shared/markup/formula.py +37 -0
- docvortex/analyzers/native/_shared/markup/projector.py +57 -0
- docvortex/analyzers/native/_shared/markup/styles.py +19 -0
- docvortex/analyzers/native/_shared/mathml.py +17 -0
- docvortex/analyzers/native/_shared/names.py +7 -0
- docvortex/analyzers/native/_shared/xycut.py +414 -0
- docvortex/analyzers/native/contracts.py +44 -0
- docvortex/analyzers/native/csv.py +351 -0
- docvortex/analyzers/native/epub/__init__.py +18 -0
- docvortex/analyzers/native/epub/constants.py +45 -0
- docvortex/analyzers/native/epub/converter.py +80 -0
- docvortex/analyzers/native/epub/errors.py +20 -0
- docvortex/analyzers/native/epub/metadata.py +31 -0
- docvortex/analyzers/native/epub/package.py +649 -0
- docvortex/analyzers/native/epub/xhtml.py +306 -0
- docvortex/analyzers/native/html/__init__.py +6 -0
- docvortex/analyzers/native/html/anchors.py +271 -0
- docvortex/analyzers/native/html/constants.py +25 -0
- docvortex/analyzers/native/html/contracts.py +7 -0
- docvortex/analyzers/native/html/converter.py +117 -0
- docvortex/analyzers/native/html/document.py +389 -0
- docvortex/analyzers/native/html/errors.py +12 -0
- docvortex/analyzers/native/html/resources.py +365 -0
- docvortex/analyzers/native/html/selector.py +421 -0
- docvortex/analyzers/native/models.py +209 -0
- docvortex/analyzers/native/ofd/__init__.py +14 -0
- docvortex/analyzers/native/ofd/constants.py +59 -0
- docvortex/analyzers/native/ofd/converter.py +31 -0
- docvortex/analyzers/native/ofd/errors.py +16 -0
- docvortex/analyzers/native/ofd/geometry.py +215 -0
- docvortex/analyzers/native/ofd/images.py +124 -0
- docvortex/analyzers/native/ofd/metadata.py +53 -0
- docvortex/analyzers/native/ofd/models.py +170 -0
- docvortex/analyzers/native/ofd/package.py +346 -0
- docvortex/analyzers/native/ofd/path.py +201 -0
- docvortex/analyzers/native/ofd/reading_order.py +293 -0
- docvortex/analyzers/native/ofd/resources.py +122 -0
- docvortex/analyzers/native/ofd/scene.py +347 -0
- docvortex/analyzers/native/ofd/table.py +240 -0
- docvortex/analyzers/native/ofd/text.py +521 -0
- docvortex/analyzers/native/office/__init__.py +3 -0
- docvortex/analyzers/native/office/doc/__init__.py +3 -0
- docvortex/analyzers/native/office/doc/bookmarks.py +81 -0
- docvortex/analyzers/native/office/doc/doc_converter.py +573 -0
- docvortex/analyzers/native/office/doc/fib.py +261 -0
- docvortex/analyzers/native/office/doc/fields.py +101 -0
- docvortex/analyzers/native/office/doc/formatting.py +171 -0
- docvortex/analyzers/native/office/doc/images.py +162 -0
- docvortex/analyzers/native/office/doc/lists.py +356 -0
- docvortex/analyzers/native/office/doc/models.py +164 -0
- docvortex/analyzers/native/office/doc/parser.py +851 -0
- docvortex/analyzers/native/office/doc/pieces.py +256 -0
- docvortex/analyzers/native/office/doc/records.py +40 -0
- docvortex/analyzers/native/office/doc/sprm.py +269 -0
- docvortex/analyzers/native/office/doc/styles.py +215 -0
- docvortex/analyzers/native/office/docx/__init__.py +3 -0
- docvortex/analyzers/native/office/docx/context.py +71 -0
- docvortex/analyzers/native/office/docx/docx_converter.py +614 -0
- docvortex/analyzers/native/office/docx/equationxml.py +119 -0
- docvortex/analyzers/native/office/docx/fields.py +816 -0
- docvortex/analyzers/native/office/docx/formatting_types.py +23 -0
- docvortex/analyzers/native/office/docx/main.py +50 -0
- docvortex/analyzers/native/office/docx/numbering.py +491 -0
- docvortex/analyzers/native/office/docx/office_xml.py +57 -0
- docvortex/analyzers/native/office/docx/package_normalizer.py +248 -0
- docvortex/analyzers/native/office/docx/resources.py +526 -0
- docvortex/analyzers/native/office/docx/styles.py +693 -0
- docvortex/analyzers/native/office/docx/tables.py +515 -0
- docvortex/analyzers/native/office/equation/__init__.py +3 -0
- docvortex/analyzers/native/office/equation/image.py +470 -0
- docvortex/analyzers/native/office/equation/latex_dict.py +324 -0
- docvortex/analyzers/native/office/equation/mtef.py +885 -0
- docvortex/analyzers/native/office/equation/mtef_v5.py +941 -0
- docvortex/analyzers/native/office/equation/omml.py +561 -0
- docvortex/analyzers/native/office/equation/ooxml.py +62 -0
- docvortex/analyzers/native/office/errors.py +33 -0
- docvortex/analyzers/native/office/image.py +307 -0
- docvortex/analyzers/native/office/legacy/__init__.py +3 -0
- docvortex/analyzers/native/office/legacy/binary.py +43 -0
- docvortex/analyzers/native/office/legacy/officeart.py +362 -0
- docvortex/analyzers/native/office/legacy/ole.py +110 -0
- docvortex/analyzers/native/office/limits.py +12 -0
- docvortex/analyzers/native/office/odf/__init__.py +3 -0
- docvortex/analyzers/native/office/odf/chart.py +76 -0
- docvortex/analyzers/native/office/odf/constants.py +70 -0
- docvortex/analyzers/native/office/odf/converters.py +403 -0
- docvortex/analyzers/native/office/odf/errors.py +18 -0
- docvortex/analyzers/native/office/odf/metadata.py +91 -0
- docvortex/analyzers/native/office/odf/models.py +176 -0
- docvortex/analyzers/native/office/odf/package.py +270 -0
- docvortex/analyzers/native/office/odf/styles.py +329 -0
- docvortex/analyzers/native/office/odf/table.py +469 -0
- docvortex/analyzers/native/office/odf/text.py +1002 -0
- docvortex/analyzers/native/office/ooxml_chart.py +1016 -0
- docvortex/analyzers/native/office/opc.py +38 -0
- docvortex/analyzers/native/office/ppt/__init__.py +3 -0
- docvortex/analyzers/native/office/ppt/models.py +118 -0
- docvortex/analyzers/native/office/ppt/parser.py +1895 -0
- docvortex/analyzers/native/office/ppt/ppt_converter.py +292 -0
- docvortex/analyzers/native/office/ppt/records.py +131 -0
- docvortex/analyzers/native/office/ppt/style_text.py +247 -0
- docvortex/analyzers/native/office/pptx/__init__.py +3 -0
- docvortex/analyzers/native/office/pptx/context.py +113 -0
- docvortex/analyzers/native/office/pptx/lists.py +558 -0
- docvortex/analyzers/native/office/pptx/main.py +20 -0
- docvortex/analyzers/native/office/pptx/package_normalizer.py +321 -0
- docvortex/analyzers/native/office/pptx/pptx_converter.py +323 -0
- docvortex/analyzers/native/office/pptx/resources.py +329 -0
- docvortex/analyzers/native/office/pptx/shapes.py +393 -0
- docvortex/analyzers/native/office/pptx/text_styles.py +625 -0
- docvortex/analyzers/native/office/pptx/titles.py +178 -0
- docvortex/analyzers/native/office/rich_text.py +420 -0
- docvortex/analyzers/native/office/rtf/__init__.py +3 -0
- docvortex/analyzers/native/office/rtf/converter.py +708 -0
- docvortex/analyzers/native/office/rtf/lexer.py +213 -0
- docvortex/analyzers/native/office/rtf/math.py +339 -0
- docvortex/analyzers/native/office/rtf/models.py +185 -0
- docvortex/analyzers/native/office/rtf/parser.py +1553 -0
- docvortex/analyzers/native/office/spreadsheet/__init__.py +3 -0
- docvortex/analyzers/native/office/spreadsheet/html.py +81 -0
- docvortex/analyzers/native/office/spreadsheet/models.py +79 -0
- docvortex/analyzers/native/office/spreadsheet/projector.py +928 -0
- docvortex/analyzers/native/office/streams.py +18 -0
- docvortex/analyzers/native/office/xls/__init__.py +3 -0
- docvortex/analyzers/native/office/xls/chart.py +132 -0
- docvortex/analyzers/native/office/xls/embedded_chart.py +299 -0
- docvortex/analyzers/native/office/xls/models.py +109 -0
- docvortex/analyzers/native/office/xls/number_format.py +521 -0
- docvortex/analyzers/native/office/xls/parser.py +1145 -0
- docvortex/analyzers/native/office/xls/records.py +201 -0
- docvortex/analyzers/native/office/xls/strings.py +205 -0
- docvortex/analyzers/native/office/xls/xls_converter.py +354 -0
- docvortex/analyzers/native/office/xlsx/__init__.py +3 -0
- docvortex/analyzers/native/office/xlsx/main.py +20 -0
- docvortex/analyzers/native/office/xlsx/ooxml_ole.py +522 -0
- docvortex/analyzers/native/office/xlsx/package_normalizer.py +310 -0
- docvortex/analyzers/native/office/xlsx/xlsx_converter.py +716 -0
- docvortex/analyzers/native/pdf/__init__.py +3 -0
- docvortex/analyzers/native/pdf/auxiliary_text.py +1671 -0
- docvortex/analyzers/native/pdf/char_geometry.py +1662 -0
- docvortex/analyzers/native/pdf/code_blocks.py +535 -0
- docvortex/analyzers/native/pdf/formulas.py +1985 -0
- docvortex/analyzers/native/pdf/geometry.py +281 -0
- docvortex/analyzers/native/pdf/graphics.py +1501 -0
- docvortex/analyzers/native/pdf/index_blocks.py +268 -0
- docvortex/analyzers/native/pdf/inline/__init__.py +3 -0
- docvortex/analyzers/native/pdf/inline/common.py +112 -0
- docvortex/analyzers/native/pdf/inline/detection.py +590 -0
- docvortex/analyzers/native/pdf/inline/matching.py +1185 -0
- docvortex/analyzers/native/pdf/inline/materialize.py +457 -0
- docvortex/analyzers/native/pdf/inline/scripts.py +975 -0
- docvortex/analyzers/native/pdf/inline/types.py +385 -0
- docvortex/analyzers/native/pdf/line_layout.py +1106 -0
- docvortex/analyzers/native/pdf/line_merging.py +1223 -0
- docvortex/analyzers/native/pdf/models.py +246 -0
- docvortex/analyzers/native/pdf/native_text.py +1004 -0
- docvortex/analyzers/native/pdf/pipeline.py +1390 -0
- docvortex/analyzers/native/pdf/script_geometry.py +636 -0
- docvortex/analyzers/native/pdf/shared.py +30 -0
- docvortex/analyzers/native/pdf/spatial_text.py +383 -0
- docvortex/analyzers/native/pdf/table_annotations.py +446 -0
- docvortex/analyzers/native/pdf/table_constants.py +48 -0
- docvortex/analyzers/native/pdf/table_detection.py +227 -0
- docvortex/analyzers/native/pdf/table_filled_grid.py +218 -0
- docvortex/analyzers/native/pdf/table_geometry.py +40 -0
- docvortex/analyzers/native/pdf/table_materialization.py +444 -0
- docvortex/analyzers/native/pdf/table_recovery/__init__.py +15 -0
- docvortex/analyzers/native/pdf/table_recovery/candidate.py +356 -0
- docvortex/analyzers/native/pdf/table_recovery/contracts.py +154 -0
- docvortex/analyzers/native/pdf/table_recovery/engine.py +609 -0
- docvortex/analyzers/native/pdf/table_recovery/geometry.py +164 -0
- docvortex/analyzers/native/pdf/table_recovery/sparse_common.py +85 -0
- docvortex/analyzers/native/pdf/table_recovery/sparse_hybrid.py +804 -0
- docvortex/analyzers/native/pdf/table_recovery/sparse_multiline.py +1122 -0
- docvortex/analyzers/native/pdf/table_recovery/text.py +414 -0
- docvortex/analyzers/native/pdf/table_recovery/text_grid.py +618 -0
- docvortex/analyzers/native/pdf/table_recovery/vector.py +1931 -0
- docvortex/analyzers/native/pdf/table_rows.py +34 -0
- docvortex/analyzers/native/pdf/table_rules.py +1129 -0
- docvortex/analyzers/native/pdf/table_text_styles.py +283 -0
- docvortex/analyzers/native/pdf/tables.py +147 -0
- docvortex/analyzers/native/pdf/text_assembly/__init__.py +3 -0
- docvortex/analyzers/native/pdf/text_assembly/annotations.py +581 -0
- docvortex/analyzers/native/pdf/text_assembly/assembly.py +292 -0
- docvortex/analyzers/native/pdf/text_assembly/common.py +477 -0
- docvortex/analyzers/native/pdf/text_assembly/footnotes.py +394 -0
- docvortex/analyzers/native/pdf/text_assembly/merging.py +1274 -0
- docvortex/analyzers/native/pdf/text_assembly/rows.py +692 -0
- docvortex/analyzers/native/pdf/text_blocks.py +82 -0
- docvortex/analyzers/native/pdf/text_styles.py +55 -0
- docvortex/analyzers/native/pdf/title_analysis/__init__.py +3 -0
- docvortex/analyzers/native/pdf/title_analysis/body_profile.py +215 -0
- docvortex/analyzers/native/pdf/title_analysis/common.py +117 -0
- docvortex/analyzers/native/pdf/title_analysis/document_profile.py +164 -0
- docvortex/analyzers/native/pdf/title_analysis/lane_titles.py +758 -0
- docvortex/analyzers/native/pdf/title_analysis/page_titles.py +1024 -0
- docvortex/analyzers/native/pdf/title_analysis/prototype.py +194 -0
- docvortex/analyzers/native/pdf/title_analysis/structural.py +1081 -0
- docvortex/analyzers/native/pdf/titles.py +75 -0
- docvortex/analyzers/native/pdf/typography.py +19 -0
- docvortex/analyzers/native/pdf/visual_annotations.py +1262 -0
- docvortex/api.py +180 -0
- docvortex/assets/__init__.py +5 -0
- docvortex/assets/store.py +51 -0
- docvortex/cli.py +54 -0
- docvortex/codecs/__init__.py +3 -0
- docvortex/codecs/html/__init__.py +22 -0
- docvortex/codecs/html/contracts.py +236 -0
- docvortex/codecs/html/materializer.py +331 -0
- docvortex/codecs/html/parser.py +763 -0
- docvortex/codecs/html/resources.py +34 -0
- docvortex/codecs/json.py +17 -0
- docvortex/content/__init__.py +5 -0
- docvortex/content/inline.py +248 -0
- docvortex/content/markup/__init__.py +44 -0
- docvortex/content/markup/anchors.py +188 -0
- docvortex/content/markup/formula.py +280 -0
- docvortex/content/markup/projector.py +1237 -0
- docvortex/content/markup/styles.py +327 -0
- docvortex/content/mathml.py +167 -0
- docvortex/content/normalization.py +188 -0
- docvortex/content/spans.py +183 -0
- docvortex/content/table/__init__.py +18 -0
- docvortex/content/table/blocks.py +152 -0
- docvortex/content/table/content.py +425 -0
- docvortex/content/table/document.py +104 -0
- docvortex/content/table/html.py +399 -0
- docvortex/content/table/models.py +76 -0
- docvortex/content/table/rules.py +42 -0
- docvortex/content/table/structure.py +221 -0
- docvortex/content/tree.py +5 -0
- docvortex/document/__init__.py +3 -0
- docvortex/document/contracts.py +22 -0
- docvortex/document/detection.py +389 -0
- docvortex/document/filetypes.py +175 -0
- docvortex/document/page_range.py +167 -0
- docvortex/document/pdf/__init__.py +19 -0
- docvortex/document/pdf/classify.py +1138 -0
- docvortex/document/pdf/constants.py +132 -0
- docvortex/document/pdf/diagnostics.py +350 -0
- docvortex/document/pdf/document.py +582 -0
- docvortex/document/pdf/font_runtime.py +335 -0
- docvortex/document/pdf/geometry.py +31 -0
- docvortex/document/pdf/images.py +654 -0
- docvortex/document/pdf/native_annotations.py +367 -0
- docvortex/document/pdf/native_contracts.py +169 -0
- docvortex/document/pdf/native_coordinates.py +216 -0
- docvortex/document/pdf/native_lifecycle.py +16 -0
- docvortex/document/pdf/native_objects.py +902 -0
- docvortex/document/pdf/native_text_geometry.py +315 -0
- docvortex/document/pdf/pdfium.py +325 -0
- docvortex/document/pdf/raster.py +46 -0
- docvortex/document/pdf/text/__init__.py +62 -0
- docvortex/document/pdf/text/contracts.py +211 -0
- docvortex/document/pdf/text/extract.py +165 -0
- docvortex/document/pdf/text/geometry.py +16 -0
- docvortex/document/pdf/text/groups.py +162 -0
- docvortex/document/pdf/visual_geometry.py +201 -0
- docvortex/document/pdf/visuals.py +343 -0
- docvortex/document/source.py +92 -0
- docvortex/errors.py +21 -0
- docvortex/export/__init__.py +3 -0
- docvortex/export/bundle.py +98 -0
- docvortex/export/files.py +66 -0
- docvortex/export/middle.py +208 -0
- docvortex/foundation/__init__.py +3 -0
- docvortex/foundation/geometry.py +125 -0
- docvortex/foundation/hyperlink.py +65 -0
- docvortex/foundation/image.py +48 -0
- docvortex/foundation/image_encoding.py +30 -0
- docvortex/foundation/image_payload.py +280 -0
- docvortex/foundation/language.py +92 -0
- docvortex/foundation/platform.py +38 -0
- docvortex/foundation/text.py +153 -0
- docvortex/foundation/type_identity.py +20 -0
- docvortex/foundation/xml_names.py +20 -0
- docvortex/options.py +30 -0
- docvortex/postprocess/__init__.py +3 -0
- docvortex/postprocess/content.py +53 -0
- docvortex/postprocess/document.py +19 -0
- docvortex/postprocess/lists.py +236 -0
- docvortex/postprocess/page_blocks.py +214 -0
- docvortex/postprocess/pages.py +95 -0
- docvortex/postprocess/paragraphs.py +580 -0
- docvortex/postprocess/visual.py +715 -0
- docvortex/render/__init__.py +48 -0
- docvortex/render/_internal/__init__.py +3 -0
- docvortex/render/_internal/common/__init__.py +3 -0
- docvortex/render/_internal/common/context.py +43 -0
- docvortex/render/_internal/common/html_table.py +178 -0
- docvortex/render/_internal/common/index.py +33 -0
- docvortex/render/_internal/common/list_items.py +158 -0
- docvortex/render/_internal/common/planner.py +140 -0
- docvortex/render/_internal/docx/__init__.py +3 -0
- docvortex/render/_internal/docx/assets.py +202 -0
- docvortex/render/_internal/docx/inline.py +434 -0
- docvortex/render/_internal/docx/math.py +220 -0
- docvortex/render/_internal/docx/renderer.py +905 -0
- docvortex/render/_internal/docx/styles.py +195 -0
- docvortex/render/_internal/docx/table.py +442 -0
- docvortex/render/_internal/epub/__init__.py +5 -0
- docvortex/render/_internal/epub/assets.py +173 -0
- docvortex/render/_internal/epub/package.py +249 -0
- docvortex/render/_internal/epub/renderer.py +1156 -0
- docvortex/render/_internal/html/__init__.py +3 -0
- docvortex/render/_internal/html/inline.py +346 -0
- docvortex/render/_internal/html/renderer.py +1041 -0
- docvortex/render/_internal/html/sanitizer.py +478 -0
- docvortex/render/_internal/html/table.py +121 -0
- docvortex/render/_internal/latex/__init__.py +1 -0
- docvortex/render/_internal/latex/assets.py +85 -0
- docvortex/render/_internal/latex/inline.py +145 -0
- docvortex/render/_internal/latex/renderer.py +506 -0
- docvortex/render/_internal/latex/table.py +347 -0
- docvortex/render/_internal/markdown/__init__.py +3 -0
- docvortex/render/_internal/markdown/assets.py +78 -0
- docvortex/render/_internal/markdown/blocks.py +635 -0
- docvortex/render/_internal/markdown/escaping.py +51 -0
- docvortex/render/_internal/markdown/inline.py +260 -0
- docvortex/render/_internal/markdown/renderer.py +93 -0
- docvortex/render/_internal/markdown/table.py +281 -0
- docvortex/render/_internal/pdf/__init__.py +3 -0
- docvortex/render/_internal/pdf/assets.py +197 -0
- docvortex/render/_internal/pdf/formula.py +417 -0
- docvortex/render/_internal/pdf/inline.py +343 -0
- docvortex/render/_internal/pdf/renderer.py +734 -0
- docvortex/render/_internal/pdf/styles.py +206 -0
- docvortex/render/_internal/pdf/table.py +272 -0
- docvortex/render/_internal/structured_content/__init__.py +3 -0
- docvortex/render/_internal/structured_content/renderer.py +193 -0
- docvortex/render/api.py +199 -0
- docvortex/render/contracts.py +205 -0
- docvortex/render/docx.py +38 -0
- docvortex/render/epub.py +35 -0
- docvortex/render/fragments.py +70 -0
- docvortex/render/html.py +29 -0
- docvortex/render/latex.py +24 -0
- docvortex/render/markdown.py +50 -0
- docvortex/render/pdf.py +25 -0
- docvortex/render/structured_content.py +23 -0
- docvortex/resources/epub/docvortex.css +91 -0
- docvortex/resources/fasttext-langdetect/lid.176.ftz +0 -0
- docvortex/resources/fonts/DroidSansFallbackFull.ttf +0 -0
- docvortex/resources/fonts/NOTICE +190 -0
- docvortex/resources/fonts/manifest.json +9 -0
- docvortex/resources/html/docvortex.css +601 -0
- docvortex/resources/html/docvortex.min.css +1 -0
- docvortex/result.py +91 -0
- docvortex/schema.py +1141 -0
- docvortex/version.py +3 -0
- docvortex-0.2.1.dist-info/METADATA +193 -0
- docvortex-0.2.1.dist-info/RECORD +364 -0
- docvortex-0.2.1.dist-info/WHEEL +5 -0
- docvortex-0.2.1.dist-info/entry_points.txt +2 -0
- docvortex-0.2.1.dist-info/licenses/LICENSE.md +21 -0
- docvortex-0.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
/* DocVortex 独立 HTML 主题。所有文档规则均限定在 DocVortex 根节点内。 */
|
|
2
|
+
.docvortex-html-body {
|
|
3
|
+
background: #ffffff;
|
|
4
|
+
margin: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.docvortex-html-body > .docvortex-document {
|
|
8
|
+
margin: 0 auto;
|
|
9
|
+
max-width: 60rem;
|
|
10
|
+
min-height: 100vh;
|
|
11
|
+
padding: 2rem;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.docvortex-document {
|
|
15
|
+
--docvortex-accent: #0b6fc2;
|
|
16
|
+
--docvortex-accent-hover: #075a9c;
|
|
17
|
+
--docvortex-background: #ffffff;
|
|
18
|
+
--docvortex-border: #d1d5db;
|
|
19
|
+
--docvortex-muted: #6b7280;
|
|
20
|
+
--docvortex-surface: #f8fafc;
|
|
21
|
+
--docvortex-text: #1f2937;
|
|
22
|
+
background: var(--docvortex-background);
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
color: var(--docvortex-text);
|
|
25
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
line-height: 1.65;
|
|
28
|
+
overflow-wrap: break-word;
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.docvortex-document *,
|
|
33
|
+
.docvortex-document *::before,
|
|
34
|
+
.docvortex-document *::after {
|
|
35
|
+
box-sizing: inherit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* 标题与正文使用紧凑但稳定的阅读节奏。 */
|
|
39
|
+
.docvortex-document :is(h1, h2, h3, h4, h5, h6) {
|
|
40
|
+
color: var(--docvortex-text);
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
line-height: 1.3;
|
|
43
|
+
margin: 1.5em 0 0.65em;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.docvortex-document h1 {
|
|
47
|
+
font-size: 2rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.docvortex-document h2 {
|
|
51
|
+
font-size: 1.5rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.docvortex-document h3 {
|
|
55
|
+
font-size: 1.25rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.docvortex-document h4 {
|
|
59
|
+
font-size: 1.125rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.docvortex-document h5 {
|
|
63
|
+
font-size: 1rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.docvortex-document h6 {
|
|
67
|
+
color: var(--docvortex-muted);
|
|
68
|
+
font-size: 0.875rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.docvortex-document .docvortex-block:first-child > :first-child,
|
|
72
|
+
.docvortex-document .docvortex-page > .docvortex-block:first-child > :first-child {
|
|
73
|
+
margin-top: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.docvortex-document p {
|
|
77
|
+
margin: 0 0 1rem;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.docvortex-document :is(strong, b) {
|
|
81
|
+
font-weight: 700;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.docvortex-document :is(s, del) {
|
|
85
|
+
color: var(--docvortex-muted);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.docvortex-document a {
|
|
89
|
+
color: var(--docvortex-accent);
|
|
90
|
+
text-decoration: none;
|
|
91
|
+
text-underline-offset: 0.15em;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.docvortex-document a:hover {
|
|
95
|
+
color: var(--docvortex-accent-hover);
|
|
96
|
+
text-decoration: underline;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.docvortex-document a:focus-visible {
|
|
100
|
+
border-radius: 0.15rem;
|
|
101
|
+
outline: 2px solid var(--docvortex-accent);
|
|
102
|
+
outline-offset: 2px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.docvortex-document blockquote {
|
|
106
|
+
background: var(--docvortex-surface);
|
|
107
|
+
border-left: 0.25rem solid var(--docvortex-accent);
|
|
108
|
+
color: var(--docvortex-muted);
|
|
109
|
+
margin: 1rem 0;
|
|
110
|
+
padding: 0.75rem 1rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.docvortex-document blockquote > :first-child {
|
|
114
|
+
margin-top: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.docvortex-document blockquote > :last-child {
|
|
118
|
+
margin-bottom: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* 普通列表使用浏览器语义,混合标记列表使用 renderer 输出的显式网格。 */
|
|
122
|
+
.docvortex-document :is(ol, ul) {
|
|
123
|
+
margin: 0 0 1rem;
|
|
124
|
+
padding-left: 1.75rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.docvortex-document ul {
|
|
128
|
+
list-style: disc;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.docvortex-document ul ul {
|
|
132
|
+
list-style: circle;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.docvortex-document ul ul ul {
|
|
136
|
+
list-style: square;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.docvortex-document ol {
|
|
140
|
+
list-style: decimal;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.docvortex-document :is(ol, ul) ol {
|
|
144
|
+
list-style-type: lower-roman;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.docvortex-document :is(ol, ul) :is(ol, ul) ol {
|
|
148
|
+
list-style-type: lower-alpha;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.docvortex-document li + li {
|
|
152
|
+
margin-top: 0.25rem;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.docvortex-document li > :is(ol, ul) {
|
|
156
|
+
margin-bottom: 0;
|
|
157
|
+
margin-top: 0.25rem;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.docvortex-document .docvortex-list--explicit {
|
|
161
|
+
list-style: none;
|
|
162
|
+
padding-left: 1.5rem;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.docvortex-document .docvortex-list--unmarked {
|
|
166
|
+
list-style: none;
|
|
167
|
+
padding-left: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.docvortex-document .docvortex-list-item--explicit {
|
|
171
|
+
align-items: start;
|
|
172
|
+
display: grid;
|
|
173
|
+
gap: 0.5em;
|
|
174
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.docvortex-document .docvortex-list-item--orphan {
|
|
178
|
+
display: grid;
|
|
179
|
+
grid-template-columns: 0 minmax(0, 1fr);
|
|
180
|
+
list-style: none;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.docvortex-document .docvortex-list-item--markerless {
|
|
184
|
+
list-style: none;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.docvortex-document .docvortex-list-marker {
|
|
188
|
+
font-variant-numeric: tabular-nums;
|
|
189
|
+
text-align: right;
|
|
190
|
+
user-select: none;
|
|
191
|
+
white-space: pre;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.docvortex-document .docvortex-list-content {
|
|
195
|
+
min-width: 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.docvortex-document .docvortex-list-item--orphan > .docvortex-list-marker {
|
|
199
|
+
visibility: hidden;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.docvortex-document .docvortex-list-item--orphan > :is(ol, ul),
|
|
203
|
+
.docvortex-document .docvortex-list-item--explicit > :is(ol, ul) {
|
|
204
|
+
grid-column: 2;
|
|
205
|
+
margin-bottom: 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.docvortex-document .docvortex-index,
|
|
209
|
+
.docvortex-document .docvortex-index ul {
|
|
210
|
+
list-style: none;
|
|
211
|
+
padding-left: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.docvortex-document .docvortex-index ul ul {
|
|
215
|
+
padding-left: 1.5rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.docvortex-document .docvortex-index a {
|
|
219
|
+
overflow-wrap: anywhere;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* 表格在屏幕内独立滚动,打印时恢复为完整 table。 */
|
|
223
|
+
.docvortex-document table {
|
|
224
|
+
border-collapse: collapse;
|
|
225
|
+
border-spacing: 0;
|
|
226
|
+
display: block;
|
|
227
|
+
margin: 1rem 0;
|
|
228
|
+
max-width: 100%;
|
|
229
|
+
overflow-x: auto;
|
|
230
|
+
width: 100%;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.docvortex-document :is(th, td) {
|
|
234
|
+
border: 1px solid var(--docvortex-border);
|
|
235
|
+
padding: 0.5rem 0.75rem;
|
|
236
|
+
text-align: left;
|
|
237
|
+
vertical-align: top;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.docvortex-document th {
|
|
241
|
+
background: var(--docvortex-surface);
|
|
242
|
+
font-weight: 600;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.docvortex-document caption {
|
|
246
|
+
color: var(--docvortex-muted);
|
|
247
|
+
margin-bottom: 0.5rem;
|
|
248
|
+
text-align: left;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.docvortex-document :is(th, td).docvortex-align-left {
|
|
252
|
+
text-align: left;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.docvortex-document :is(th, td).docvortex-align-center {
|
|
256
|
+
text-align: center;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.docvortex-document :is(th, td).docvortex-align-right {
|
|
260
|
+
text-align: right;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* 图片、图表及说明共享同一视觉容器。 */
|
|
264
|
+
.docvortex-document img {
|
|
265
|
+
height: auto;
|
|
266
|
+
max-width: 100%;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.docvortex-document .docvortex-figure {
|
|
270
|
+
margin: 1.5rem 0;
|
|
271
|
+
max-width: 100%;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.docvortex-document .docvortex-figure > img,
|
|
275
|
+
.docvortex-document .docvortex-visual-body > img {
|
|
276
|
+
display: block;
|
|
277
|
+
margin-inline: 0;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/* Mermaid 成功后替换 raster;无 JS、加载或语法失败时保留图片/源码回退。 */
|
|
281
|
+
.docvortex-document .docvortex-flowchart {
|
|
282
|
+
margin: 1rem 0;
|
|
283
|
+
max-width: 100%;
|
|
284
|
+
overflow-x: auto;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.docvortex-document .docvortex-flowchart-canvas {
|
|
288
|
+
display: none;
|
|
289
|
+
min-width: 0;
|
|
290
|
+
text-align: left;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.docvortex-document .docvortex-flowchart-canvas svg {
|
|
294
|
+
display: block;
|
|
295
|
+
height: auto;
|
|
296
|
+
margin-inline: 0;
|
|
297
|
+
max-width: 100%;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.docvortex-document .docvortex-flowchart-fallback {
|
|
301
|
+
display: block;
|
|
302
|
+
margin-inline: 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.docvortex-document .docvortex-flowchart[data-mermaid-state="rendered"] .docvortex-flowchart-canvas {
|
|
306
|
+
display: block;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.docvortex-document .docvortex-flowchart[data-mermaid-state="rendered"] .docvortex-flowchart-fallback {
|
|
310
|
+
display: none;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.docvortex-document .docvortex-flowchart-details {
|
|
314
|
+
max-width: 100%;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.docvortex-document .docvortex-flowchart-source {
|
|
318
|
+
max-height: 24rem;
|
|
319
|
+
text-align: left;
|
|
320
|
+
white-space: pre;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.docvortex-document .docvortex-caption {
|
|
324
|
+
color: var(--docvortex-muted);
|
|
325
|
+
font-size: 0.9em;
|
|
326
|
+
margin-top: 0.5rem;
|
|
327
|
+
text-align: left;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.docvortex-document .docvortex-footnote,
|
|
331
|
+
.docvortex-document .docvortex-page-footnote {
|
|
332
|
+
color: var(--docvortex-muted);
|
|
333
|
+
font-size: 0.875em;
|
|
334
|
+
margin-top: 0.4rem;
|
|
335
|
+
text-align: left;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.docvortex-document .docvortex-details {
|
|
339
|
+
border: 1px solid var(--docvortex-border);
|
|
340
|
+
border-radius: 0.375rem;
|
|
341
|
+
margin: 1rem 0;
|
|
342
|
+
padding: 0.65rem 0.85rem;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.docvortex-document .docvortex-details > summary {
|
|
346
|
+
cursor: pointer;
|
|
347
|
+
font-weight: 600;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.docvortex-document .docvortex-page-aux {
|
|
351
|
+
color: var(--docvortex-muted);
|
|
352
|
+
font-size: 0.875rem;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/* 行内代码、预格式内容和 Prism token 采用 DocVortex 自有配色。 */
|
|
356
|
+
.docvortex-document code,
|
|
357
|
+
.docvortex-document pre,
|
|
358
|
+
.docvortex-document .docvortex-algorithm {
|
|
359
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.docvortex-document code {
|
|
363
|
+
background: var(--docvortex-surface);
|
|
364
|
+
border-radius: 0.25rem;
|
|
365
|
+
font-size: 0.875em;
|
|
366
|
+
padding: 0.15em 0.35em;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.docvortex-document pre {
|
|
370
|
+
background: var(--docvortex-surface);
|
|
371
|
+
border: 1px solid var(--docvortex-border);
|
|
372
|
+
border-radius: 0.375rem;
|
|
373
|
+
line-height: 1.5;
|
|
374
|
+
margin: 1rem 0;
|
|
375
|
+
max-width: 100%;
|
|
376
|
+
overflow: auto;
|
|
377
|
+
padding: 1rem;
|
|
378
|
+
tab-size: 4;
|
|
379
|
+
white-space: pre;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.docvortex-document pre > code {
|
|
383
|
+
background: transparent;
|
|
384
|
+
border-radius: 0;
|
|
385
|
+
display: inline;
|
|
386
|
+
font-size: inherit;
|
|
387
|
+
line-height: inherit;
|
|
388
|
+
padding: 0;
|
|
389
|
+
white-space: inherit;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.docvortex-document :is(code, pre)[class*="language-"] {
|
|
393
|
+
color: #374151;
|
|
394
|
+
text-align: left;
|
|
395
|
+
text-shadow: none;
|
|
396
|
+
word-break: normal;
|
|
397
|
+
word-spacing: normal;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.docvortex-document .token.comment,
|
|
401
|
+
.docvortex-document .token.prolog,
|
|
402
|
+
.docvortex-document .token.doctype,
|
|
403
|
+
.docvortex-document .token.cdata {
|
|
404
|
+
color: #6b7280;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.docvortex-document .token.punctuation {
|
|
408
|
+
color: #374151;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.docvortex-document .token.namespace {
|
|
412
|
+
opacity: 0.75;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.docvortex-document .token.keyword,
|
|
416
|
+
.docvortex-document .token.operator,
|
|
417
|
+
.docvortex-document .token.important,
|
|
418
|
+
.docvortex-document .token.atrule {
|
|
419
|
+
color: #7c3aed;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.docvortex-document .token.string,
|
|
423
|
+
.docvortex-document .token.attr-value,
|
|
424
|
+
.docvortex-document .token.regex,
|
|
425
|
+
.docvortex-document .token.url {
|
|
426
|
+
color: #047857;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.docvortex-document .token.number,
|
|
430
|
+
.docvortex-document .token.boolean,
|
|
431
|
+
.docvortex-document .token.constant,
|
|
432
|
+
.docvortex-document .token.property,
|
|
433
|
+
.docvortex-document .token.symbol {
|
|
434
|
+
color: #0369a1;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.docvortex-document .token.tag,
|
|
438
|
+
.docvortex-document .token.selector,
|
|
439
|
+
.docvortex-document .token.builtin {
|
|
440
|
+
color: #b45309;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.docvortex-document .token.function,
|
|
444
|
+
.docvortex-document .token.class-name,
|
|
445
|
+
.docvortex-document .token.attr-name {
|
|
446
|
+
color: #be123c;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.docvortex-document .token.important,
|
|
450
|
+
.docvortex-document .token.bold {
|
|
451
|
+
font-weight: 700;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.docvortex-document .token.italic {
|
|
455
|
+
font-style: italic;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.docvortex-document .token.inserted {
|
|
459
|
+
background: #ecfdf5;
|
|
460
|
+
color: #047857;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.docvortex-document .token.deleted {
|
|
464
|
+
background: #fff1f2;
|
|
465
|
+
color: #be123c;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.docvortex-document .token.entity {
|
|
469
|
+
cursor: help;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.docvortex-document .docvortex-algorithm {
|
|
473
|
+
max-width: 100%;
|
|
474
|
+
overflow-x: auto;
|
|
475
|
+
tab-size: 4;
|
|
476
|
+
white-space: pre-wrap;
|
|
477
|
+
word-break: normal;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/* 空间投影表格和无法结构化的原文保留空白与换行。 */
|
|
481
|
+
.docvortex-document .docvortex-table-text,
|
|
482
|
+
.docvortex-document .docvortex-raw-fallback {
|
|
483
|
+
overflow: auto;
|
|
484
|
+
tab-size: 4;
|
|
485
|
+
white-space: pre-wrap;
|
|
486
|
+
word-break: break-word;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.docvortex-document .docvortex-table-text {
|
|
490
|
+
white-space: pre;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.docvortex-document .docvortex-raw-fallback {
|
|
494
|
+
border-left: 0.2rem solid var(--docvortex-border);
|
|
495
|
+
color: var(--docvortex-muted);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/* MathJax 接管前保持 TeX 可见,长公式只在自身容器内滚动。 */
|
|
499
|
+
.docvortex-document .docvortex-math {
|
|
500
|
+
overflow-wrap: anywhere;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.docvortex-document .docvortex-math--block {
|
|
504
|
+
display: block;
|
|
505
|
+
margin: 1rem 0;
|
|
506
|
+
max-width: 100%;
|
|
507
|
+
overflow-x: auto;
|
|
508
|
+
overflow-y: hidden;
|
|
509
|
+
text-align: center;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.docvortex-document mjx-container[display="true"] {
|
|
513
|
+
max-width: 100%;
|
|
514
|
+
overflow-x: auto;
|
|
515
|
+
overflow-y: hidden;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.docvortex-document .docvortex-preserve-whitespace {
|
|
519
|
+
white-space: pre-wrap;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.docvortex-document .docvortex-text-emphasis {
|
|
523
|
+
-webkit-text-emphasis: dot;
|
|
524
|
+
-webkit-text-emphasis-position: under right;
|
|
525
|
+
text-emphasis: dot;
|
|
526
|
+
text-emphasis-position: under right;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/* FULL 模式在屏幕上显示页间边界,在打印时改用硬分页。 */
|
|
530
|
+
.docvortex-document .docvortex-page {
|
|
531
|
+
min-width: 0;
|
|
532
|
+
position: relative;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.docvortex-document--full .docvortex-page {
|
|
536
|
+
min-height: 1.5rem;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.docvortex-document .docvortex-page-break {
|
|
540
|
+
background: transparent;
|
|
541
|
+
border: 0;
|
|
542
|
+
border-top: 1px dashed var(--docvortex-border);
|
|
543
|
+
height: 0;
|
|
544
|
+
margin: 2rem 0;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
@media screen and (max-width: 40rem) {
|
|
548
|
+
.docvortex-html-body > .docvortex-document {
|
|
549
|
+
padding: 1rem;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.docvortex-document h1 {
|
|
553
|
+
font-size: 1.75rem;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.docvortex-document :is(th, td) {
|
|
557
|
+
padding: 0.4rem 0.55rem;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
@media print {
|
|
562
|
+
.docvortex-html-body {
|
|
563
|
+
background: #ffffff;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.docvortex-html-body > .docvortex-document {
|
|
567
|
+
max-width: none;
|
|
568
|
+
min-height: 0;
|
|
569
|
+
padding: 0;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.docvortex-document .docvortex-page-break {
|
|
573
|
+
display: none;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.docvortex-document--full .docvortex-page {
|
|
577
|
+
break-after: page;
|
|
578
|
+
page-break-after: always;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.docvortex-document--full .docvortex-page:last-child {
|
|
582
|
+
break-after: auto;
|
|
583
|
+
page-break-after: auto;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.docvortex-document .docvortex-figure {
|
|
587
|
+
break-inside: avoid;
|
|
588
|
+
page-break-inside: avoid;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.docvortex-document table {
|
|
592
|
+
display: table;
|
|
593
|
+
overflow: visible;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.docvortex-document pre {
|
|
597
|
+
overflow: visible;
|
|
598
|
+
white-space: pre-wrap;
|
|
599
|
+
word-break: break-word;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.docvortex-html-body{background:#ffffff;margin:0}.docvortex-html-body>.docvortex-document{margin:0 auto;max-width:60rem;min-height:100vh;padding:2rem}.docvortex-document{--docvortex-accent:#0b6fc2;--docvortex-accent-hover:#075a9c;--docvortex-background:#ffffff;--docvortex-border:#d1d5db;--docvortex-muted:#6b7280;--docvortex-surface:#f8fafc;--docvortex-text:#1f2937;background:var(--docvortex-background);box-sizing:border-box;color:var(--docvortex-text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;line-height:1.65;overflow-wrap:break-word;width:100%}.docvortex-document *,.docvortex-document *::before,.docvortex-document *::after{box-sizing:inherit}.docvortex-document :is(h1,h2,h3,h4,h5,h6){color:var(--docvortex-text);font-weight:600;line-height:1.3;margin:1.5em 0 0.65em}.docvortex-document h1{font-size:2rem}.docvortex-document h2{font-size:1.5rem}.docvortex-document h3{font-size:1.25rem}.docvortex-document h4{font-size:1.125rem}.docvortex-document h5{font-size:1rem}.docvortex-document h6{color:var(--docvortex-muted);font-size:0.875rem}.docvortex-document .docvortex-block:first-child>:first-child,.docvortex-document .docvortex-page>.docvortex-block:first-child>:first-child{margin-top:0}.docvortex-document p{margin:0 0 1rem}.docvortex-document :is(strong,b){font-weight:700}.docvortex-document :is(s,del){color:var(--docvortex-muted)}.docvortex-document a{color:var(--docvortex-accent);text-decoration:none;text-underline-offset:0.15em}.docvortex-document a:hover{color:var(--docvortex-accent-hover);text-decoration:underline}.docvortex-document a:focus-visible{border-radius:0.15rem;outline:2px solid var(--docvortex-accent);outline-offset:2px}.docvortex-document blockquote{background:var(--docvortex-surface);border-left:0.25rem solid var(--docvortex-accent);color:var(--docvortex-muted);margin:1rem 0;padding:0.75rem 1rem}.docvortex-document blockquote>:first-child{margin-top:0}.docvortex-document blockquote>:last-child{margin-bottom:0}.docvortex-document :is(ol,ul){margin:0 0 1rem;padding-left:1.75rem}.docvortex-document ul{list-style:disc}.docvortex-document ul ul{list-style:circle}.docvortex-document ul ul ul{list-style:square}.docvortex-document ol{list-style:decimal}.docvortex-document :is(ol,ul) ol{list-style-type:lower-roman}.docvortex-document :is(ol,ul) :is(ol,ul) ol{list-style-type:lower-alpha}.docvortex-document li + li{margin-top:0.25rem}.docvortex-document li>:is(ol,ul){margin-bottom:0;margin-top:0.25rem}.docvortex-document .docvortex-list--explicit{list-style:none;padding-left:1.5rem}.docvortex-document .docvortex-list--unmarked{list-style:none;padding-left:0}.docvortex-document .docvortex-list-item--explicit{align-items:start;display:grid;gap:0.5em;grid-template-columns:max-content minmax(0,1fr)}.docvortex-document .docvortex-list-item--orphan{display:grid;grid-template-columns:0 minmax(0,1fr);list-style:none}.docvortex-document .docvortex-list-item--markerless{list-style:none}.docvortex-document .docvortex-list-marker{font-variant-numeric:tabular-nums;text-align:right;user-select:none;white-space:pre}.docvortex-document .docvortex-list-content{min-width:0}.docvortex-document .docvortex-list-item--orphan>.docvortex-list-marker{visibility:hidden}.docvortex-document .docvortex-list-item--orphan>:is(ol,ul),.docvortex-document .docvortex-list-item--explicit>:is(ol,ul){grid-column:2;margin-bottom:0}.docvortex-document .docvortex-index,.docvortex-document .docvortex-index ul{list-style:none;padding-left:0}.docvortex-document .docvortex-index ul ul{padding-left:1.5rem}.docvortex-document .docvortex-index a{overflow-wrap:anywhere}.docvortex-document table{border-collapse:collapse;border-spacing:0;display:block;margin:1rem 0;max-width:100%;overflow-x:auto;width:100%}.docvortex-document :is(th,td){border:1px solid var(--docvortex-border);padding:0.5rem 0.75rem;text-align:left;vertical-align:top}.docvortex-document th{background:var(--docvortex-surface);font-weight:600}.docvortex-document caption{color:var(--docvortex-muted);margin-bottom:0.5rem;text-align:left}.docvortex-document :is(th,td).docvortex-align-left{text-align:left}.docvortex-document :is(th,td).docvortex-align-center{text-align:center}.docvortex-document :is(th,td).docvortex-align-right{text-align:right}.docvortex-document img{height:auto;max-width:100%}.docvortex-document .docvortex-figure{margin:1.5rem 0;max-width:100%}.docvortex-document .docvortex-figure>img,.docvortex-document .docvortex-visual-body>img{display:block;margin-inline:0}.docvortex-document .docvortex-flowchart{margin:1rem 0;max-width:100%;overflow-x:auto}.docvortex-document .docvortex-flowchart-canvas{display:none;min-width:0;text-align:left}.docvortex-document .docvortex-flowchart-canvas svg{display:block;height:auto;margin-inline:0;max-width:100%}.docvortex-document .docvortex-flowchart-fallback{display:block;margin-inline:0}.docvortex-document .docvortex-flowchart[data-mermaid-state="rendered"] .docvortex-flowchart-canvas{display:block}.docvortex-document .docvortex-flowchart[data-mermaid-state="rendered"] .docvortex-flowchart-fallback{display:none}.docvortex-document .docvortex-flowchart-details{max-width:100%}.docvortex-document .docvortex-flowchart-source{max-height:24rem;text-align:left;white-space:pre}.docvortex-document .docvortex-caption{color:var(--docvortex-muted);font-size:0.9em;margin-top:0.5rem;text-align:left}.docvortex-document .docvortex-footnote,.docvortex-document .docvortex-page-footnote{color:var(--docvortex-muted);font-size:0.875em;margin-top:0.4rem;text-align:left}.docvortex-document .docvortex-details{border:1px solid var(--docvortex-border);border-radius:0.375rem;margin:1rem 0;padding:0.65rem 0.85rem}.docvortex-document .docvortex-details>summary{cursor:pointer;font-weight:600}.docvortex-document .docvortex-page-aux{color:var(--docvortex-muted);font-size:0.875rem}.docvortex-document code,.docvortex-document pre,.docvortex-document .docvortex-algorithm{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}.docvortex-document code{background:var(--docvortex-surface);border-radius:0.25rem;font-size:0.875em;padding:0.15em 0.35em}.docvortex-document pre{background:var(--docvortex-surface);border:1px solid var(--docvortex-border);border-radius:0.375rem;line-height:1.5;margin:1rem 0;max-width:100%;overflow:auto;padding:1rem;tab-size:4;white-space:pre}.docvortex-document pre>code{background:transparent;border-radius:0;display:inline;font-size:inherit;line-height:inherit;padding:0;white-space:inherit}.docvortex-document :is(code,pre)[class*="language-"]{color:#374151;text-align:left;text-shadow:none;word-break:normal;word-spacing:normal}.docvortex-document .token.comment,.docvortex-document .token.prolog,.docvortex-document .token.doctype,.docvortex-document .token.cdata{color:#6b7280}.docvortex-document .token.punctuation{color:#374151}.docvortex-document .token.namespace{opacity:0.75}.docvortex-document .token.keyword,.docvortex-document .token.operator,.docvortex-document .token.important,.docvortex-document .token.atrule{color:#7c3aed}.docvortex-document .token.string,.docvortex-document .token.attr-value,.docvortex-document .token.regex,.docvortex-document .token.url{color:#047857}.docvortex-document .token.number,.docvortex-document .token.boolean,.docvortex-document .token.constant,.docvortex-document .token.property,.docvortex-document .token.symbol{color:#0369a1}.docvortex-document .token.tag,.docvortex-document .token.selector,.docvortex-document .token.builtin{color:#b45309}.docvortex-document .token.function,.docvortex-document .token.class-name,.docvortex-document .token.attr-name{color:#be123c}.docvortex-document .token.important,.docvortex-document .token.bold{font-weight:700}.docvortex-document .token.italic{font-style:italic}.docvortex-document .token.inserted{background:#ecfdf5;color:#047857}.docvortex-document .token.deleted{background:#fff1f2;color:#be123c}.docvortex-document .token.entity{cursor:help}.docvortex-document .docvortex-algorithm{max-width:100%;overflow-x:auto;tab-size:4;white-space:pre-wrap;word-break:normal}.docvortex-document .docvortex-table-text,.docvortex-document .docvortex-raw-fallback{overflow:auto;tab-size:4;white-space:pre-wrap;word-break:break-word}.docvortex-document .docvortex-table-text{white-space:pre}.docvortex-document .docvortex-raw-fallback{border-left:0.2rem solid var(--docvortex-border);color:var(--docvortex-muted)}.docvortex-document .docvortex-math{overflow-wrap:anywhere}.docvortex-document .docvortex-math--block{display:block;margin:1rem 0;max-width:100%;overflow-x:auto;overflow-y:hidden;text-align:center}.docvortex-document mjx-container[display="true"]{max-width:100%;overflow-x:auto;overflow-y:hidden}.docvortex-document .docvortex-preserve-whitespace{white-space:pre-wrap}.docvortex-document .docvortex-text-emphasis{-webkit-text-emphasis:dot;-webkit-text-emphasis-position:under right;text-emphasis:dot;text-emphasis-position:under right}.docvortex-document .docvortex-page{min-width:0;position:relative}.docvortex-document--full .docvortex-page{min-height:1.5rem}.docvortex-document .docvortex-page-break{background:transparent;border:0;border-top:1px dashed var(--docvortex-border);height:0;margin:2rem 0}@media screen and (max-width:40rem){.docvortex-html-body>.docvortex-document{padding:1rem}.docvortex-document h1{font-size:1.75rem}.docvortex-document :is(th,td){padding:0.4rem 0.55rem}}@media print{.docvortex-html-body{background:#ffffff}.docvortex-html-body>.docvortex-document{max-width:none;min-height:0;padding:0}.docvortex-document .docvortex-page-break{display:none}.docvortex-document--full .docvortex-page{break-after:page;page-break-after:always}.docvortex-document--full .docvortex-page:last-child{break-after:auto;page-break-after:auto}.docvortex-document .docvortex-figure{break-inside:avoid;page-break-inside:avoid}.docvortex-document table{display:table;overflow:visible}.docvortex-document pre{overflow:visible;white-space:pre-wrap;word-break:break-word}}
|
docvortex/result.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""完整文档结果与渲染产物;便捷方法显式委托对应处理层。"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass, field
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from .assets import AssetStore
|
|
10
|
+
from .schema import MiddleJson, ModelJson
|
|
11
|
+
from .render.contracts import RenderFormat, RenderOptions
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(frozen=True, slots=True)
|
|
15
|
+
class Diagnostic:
|
|
16
|
+
"""记录可定位的非致命文档处理信息。"""
|
|
17
|
+
|
|
18
|
+
code: str
|
|
19
|
+
message: str
|
|
20
|
+
page_index: int | None = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass(slots=True)
|
|
24
|
+
class AnalysisResult:
|
|
25
|
+
"""原生分析输出,允许独立进行后处理或交给其他消费者。"""
|
|
26
|
+
|
|
27
|
+
model_json: ModelJson
|
|
28
|
+
assets: AssetStore = field(default_factory=AssetStore)
|
|
29
|
+
diagnostics: tuple[Diagnostic, ...] = ()
|
|
30
|
+
elapsed_seconds: float = 0.0
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@dataclass(frozen=True, slots=True)
|
|
34
|
+
class ExportResult:
|
|
35
|
+
"""返回实际写出的主文件及素材路径。"""
|
|
36
|
+
|
|
37
|
+
path: Path
|
|
38
|
+
asset_paths: tuple[Path, ...] = ()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(slots=True)
|
|
42
|
+
class RenderArtifact:
|
|
43
|
+
"""可独立写出的主文件内容和全部旁文件。"""
|
|
44
|
+
|
|
45
|
+
content: bytes
|
|
46
|
+
output_format: RenderFormat
|
|
47
|
+
mime_type: str
|
|
48
|
+
assets: AssetStore = field(default_factory=AssetStore)
|
|
49
|
+
diagnostics: tuple[Diagnostic, ...] = ()
|
|
50
|
+
|
|
51
|
+
def write(self, path: str | Path, *, overwrite: bool = False) -> ExportResult:
|
|
52
|
+
"""预检全部文件后原子提交,不在渲染期间执行文件写入。"""
|
|
53
|
+
from .export.files import write_artifact
|
|
54
|
+
|
|
55
|
+
return write_artifact(self, Path(path), overwrite=overwrite)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@dataclass(slots=True)
|
|
59
|
+
class DocumentResult:
|
|
60
|
+
"""持有语义文档与素材,解析结束后无需保留源文档。"""
|
|
61
|
+
|
|
62
|
+
middle_json: MiddleJson
|
|
63
|
+
assets: AssetStore = field(default_factory=AssetStore)
|
|
64
|
+
model_json: ModelJson | None = None
|
|
65
|
+
diagnostics: tuple[Diagnostic, ...] = ()
|
|
66
|
+
|
|
67
|
+
def export(
|
|
68
|
+
self,
|
|
69
|
+
path: str | Path,
|
|
70
|
+
*,
|
|
71
|
+
output_format: RenderFormat | str = RenderFormat.MARKDOWN,
|
|
72
|
+
options: RenderOptions | None = None,
|
|
73
|
+
overwrite: bool = False,
|
|
74
|
+
) -> ExportResult:
|
|
75
|
+
"""复用当前解析结果渲染指定格式,不重新分析输入。"""
|
|
76
|
+
from .api import render
|
|
77
|
+
|
|
78
|
+
return render(self.middle_json, output_format, assets=self.assets, options=options).write(path, overwrite=overwrite)
|
|
79
|
+
|
|
80
|
+
def save_bundle(self, path: str | Path, *, overwrite: bool = False) -> ExportResult:
|
|
81
|
+
"""把当前文档、可选分析结果与素材保存成可移植结果包。"""
|
|
82
|
+
from .export.bundle import save_bundle
|
|
83
|
+
|
|
84
|
+
return save_bundle(self, Path(path), overwrite=overwrite)
|
|
85
|
+
|
|
86
|
+
def to_dict(self) -> dict[str, Any]:
|
|
87
|
+
"""仅返回中性语义协议;素材通过结果包或显式接口保存。"""
|
|
88
|
+
return self.middle_json.to_dict()
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
__all__ = ["Diagnostic", "AnalysisResult", "DocumentResult", "RenderArtifact", "ExportResult"]
|