@dooc-dev/dooc 0.0.6 → 0.0.8
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.
- package/dist/client.global.js +1 -0
- package/dist/code-worker.global.js +11 -11
- package/dist/code.global.js +75 -75
- package/dist/edit.global.js +234 -231
- package/dist/{compiler → engine/compiler}/bundle-urls.js +1 -4
- package/dist/{compiler → engine/compiler}/check-prose.d.ts +1 -1
- package/dist/{compiler → engine/compiler}/check-prose.js +1 -1
- package/dist/{compiler → engine/compiler}/check.js +15 -27
- package/dist/{compiler → engine/compiler}/code-blocks.js +3 -1
- package/dist/{compiler → engine/compiler}/code-languages.js +1 -2
- package/dist/{compiler → engine/compiler}/compile.d.ts +5 -4
- package/dist/{compiler → engine/compiler}/compile.js +91 -32
- package/dist/{compiler → engine/compiler}/config.js +1 -3
- package/dist/{compiler → engine/compiler}/dialect.d.ts +1 -3
- package/dist/{compiler → engine/compiler}/dialect.js +8 -52
- package/dist/{compiler → engine/compiler}/dxf.js +1 -1
- package/dist/{compiler → engine/compiler}/export.js +15 -8
- package/dist/{compiler → engine/compiler}/figures.js +26 -22
- package/dist/{compiler → engine/compiler}/file-cache.d.ts +1 -2
- package/dist/{compiler → engine/compiler}/file-cache.js +8 -15
- package/dist/{compiler → engine/compiler}/files.js +49 -38
- package/dist/{compiler → engine/compiler}/fonts.js +1 -3
- package/dist/{compiler → engine/compiler}/from-mdast.js +1 -1
- package/dist/engine/compiler/host.d.ts +10 -0
- package/dist/engine/compiler/host.js +16 -0
- package/dist/{compiler → engine/compiler}/icons.d.ts +3 -0
- package/dist/{compiler → engine/compiler}/icons.js +28 -10
- package/dist/{compiler → engine/compiler}/ignored-files.d.ts +2 -0
- package/dist/{compiler → engine/compiler}/ignored-files.js +12 -3
- package/dist/{compiler → engine/compiler}/locales.js +2 -8
- package/dist/{compiler → engine/compiler}/manifest.d.ts +3 -2
- package/dist/engine/compiler/manifest.js +46 -0
- package/dist/{compiler → engine/compiler}/ops.d.ts +4 -1
- package/dist/{compiler → engine/compiler}/ops.js +36 -21
- package/dist/engine/compiler/schema-file-references.d.ts +2 -0
- package/dist/engine/compiler/schema-file-references.js +82 -0
- package/dist/engine/compiler/serialize.d.ts +2 -0
- package/dist/engine/compiler/serialize.js +5 -0
- package/dist/{compiler → engine/compiler}/subformat-schema.js +1 -3
- package/dist/{compiler → engine/compiler}/subformats.d.ts +10 -0
- package/dist/{compiler → engine/compiler}/subformats.js +122 -18
- package/dist/{compiler → engine/compiler}/textfile-remote.js +1 -2
- package/dist/{compiler → engine/compiler}/textfile.js +4 -6
- package/dist/{compiler → engine/compiler}/theme-variants.js +1 -1
- package/dist/{compiler → engine/compiler}/zip.js +1 -1
- package/dist/{core → engine/core}/blocks.d.ts +6 -4
- package/dist/{core → engine/core}/content-metadata.d.ts +6 -1
- package/dist/{core → engine/core}/content-metadata.js +84 -18
- package/dist/{core → engine/core}/content-types.d.ts +4 -2
- package/dist/{core → engine/core}/html.d.ts +7 -0
- package/dist/{core → engine/core}/html.js +44 -3
- package/dist/{core → engine/core}/icons.d.ts +3 -0
- package/dist/engine/core/icons.js +20 -0
- package/dist/{core → engine/core}/routing.d.ts +2 -0
- package/dist/{core → engine/core}/routing.js +9 -0
- package/dist/{core → engine/core}/schema-refs.d.ts +1 -1
- package/dist/{core → engine/core}/schema-refs.js +3 -1
- package/dist/engine/core/subformat-references.d.ts +5 -0
- package/dist/engine/core/subformat-references.js +33 -0
- package/dist/{core → engine/core}/subformats.d.ts +7 -0
- package/dist/{core → engine/core}/subformats.js +5 -1
- package/dist/{core → engine/core}/taxonomy.d.ts +2 -3
- package/dist/{core → engine/core}/taxonomy.js +1 -5
- package/dist/flow.global.js +1031 -1057
- package/dist/frontend/application-request.d.ts +14 -0
- package/dist/frontend/application-request.js +36 -0
- package/dist/frontend/document-application.d.ts +200 -0
- package/dist/{viewer/serve.js → frontend/document-application.js} +1611 -1670
- package/dist/frontend/figure-preview.d.ts +4 -0
- package/dist/{viewer → frontend}/figure-preview.js +4 -4
- package/dist/{viewer → frontend}/file-references.d.ts +1 -1
- package/dist/{viewer → frontend}/file-references.js +3 -3
- package/dist/{viewer → frontend}/font-picker.d.ts +1 -1
- package/dist/{viewer → frontend}/font-settings.d.ts +1 -1
- package/dist/{viewer → frontend}/language-picker.js +112 -18
- package/dist/{viewer → frontend}/locales/eng.json +16 -2
- package/dist/{viewer → frontend}/locales/jpn.json +16 -2
- package/dist/{viewer → frontend}/locales/zho.json +16 -2
- package/dist/{viewer → frontend}/nav-focus.js +2 -0
- package/dist/{viewer → frontend}/plugin-blocks.js +2 -2
- package/dist/{viewer → frontend}/resize.js +14 -2
- package/dist/frontend/resource-download.d.ts +2 -0
- package/dist/frontend/resource-download.js +43 -0
- package/dist/{viewer → frontend}/resource-library.d.ts +9 -2
- package/dist/{viewer → frontend}/resource-library.js +133 -37
- package/dist/{core → frontend}/schema-graph-flow.d.ts +1 -1
- package/dist/{core → frontend}/schema-graph-flow.js +1 -1
- package/dist/{viewer → frontend}/search.d.ts +2 -2
- package/dist/{viewer → frontend}/search.js +26 -8
- package/dist/graph/{abnfDiagram-S7VZAUFO-ASBULSKE.js → abnfDiagram-S7VZAUFO-GAGCW2J5.js} +1 -1
- package/dist/graph/{architecture-WOLXFQ4H-V57EDXXY.js → architecture-WOLXFQ4H-AWAC3VBS.js} +1 -1
- package/dist/graph/{architectureDiagram-YGSQEFNW-GIMP347N.js → architectureDiagram-YGSQEFNW-WQ7QKSUJ.js} +1 -1
- package/dist/graph/{blockDiagram-APKKGZFW-RDL2T4JW.js → blockDiagram-APKKGZFW-H7ZNJMOM.js} +1 -1
- package/dist/graph/{bpmnIcons-APHXDYXF-TWOSQNUQ.js → bpmnIcons-APHXDYXF-EAVPNTFE.js} +1 -1
- package/dist/graph/{c4Diagram-KJ2TOQU5-75LIUC4F.js → c4Diagram-KJ2TOQU5-3IYS34YL.js} +1 -1
- package/dist/graph/{chunk-KU6GTEMS.js → chunk-3CJU2RDX.js} +1 -1
- package/dist/graph/{chunk-ISO77HML.js → chunk-5N2X2DXU.js} +1 -1
- package/dist/graph/{chunk-YCRLJT2S.js → chunk-67BPVAXC.js} +1 -1
- package/dist/graph/{chunk-26TUJSYJ.js → chunk-6CDZONCA.js} +1 -1
- package/dist/graph/{chunk-I3DMZIHV.js → chunk-7ASYMKN2.js} +1 -1
- package/dist/graph/{chunk-K2KLZU7M.js → chunk-7JQUFVT4.js} +2 -2
- package/dist/graph/{chunk-BBD5CEDC.js → chunk-7LSMJ4VU.js} +1 -1
- package/dist/graph/{chunk-EG5UVNOC.js → chunk-7UKJADAE.js} +1 -1
- package/dist/graph/{chunk-BZAMCJ6B.js → chunk-AARGNXTW.js} +1 -1
- package/dist/graph/{chunk-HOPPTA6H.js → chunk-BOXAA5AP.js} +2 -2
- package/dist/graph/{chunk-N3OHKGRZ.js → chunk-BTMPKSGF.js} +1 -1
- package/dist/graph/{chunk-QCJUF4YA.js → chunk-DIDARDST.js} +1 -1
- package/dist/graph/{chunk-R63JUMUK.js → chunk-EWYECPNJ.js} +1 -1
- package/dist/graph/{chunk-3YJHMOOA.js → chunk-FD7ZFC7R.js} +1 -1
- package/dist/graph/chunk-GWYODWCE.js +1 -0
- package/dist/graph/{chunk-IC23EEF6.js → chunk-HKRJKXEE.js} +1 -1
- package/dist/graph/{chunk-PW2RGZ3O.js → chunk-I5LEUF24.js} +1 -1
- package/dist/graph/{chunk-OFZLK5G4.js → chunk-ICJPOOXG.js} +1 -1
- package/dist/graph/{chunk-KT4VPQD5.js → chunk-IVZHB6RS.js} +2 -2
- package/dist/graph/{chunk-VM2H7G2R.js → chunk-JZGXHT3J.js} +1 -1
- package/dist/graph/{chunk-HJG2HUYJ.js → chunk-LSRL537V.js} +1 -1
- package/dist/graph/{chunk-C6J4A356.js → chunk-N44XPVUD.js} +1 -1
- package/dist/graph/{chunk-JD7ZBJD2.js → chunk-NDAMZVXQ.js} +1 -1
- package/dist/graph/{chunk-QEEA3KYY.js → chunk-QLS7NIYR.js} +1 -1
- package/dist/graph/{chunk-JRSH5GNS.js → chunk-QQIGL7OP.js} +1 -1
- package/dist/graph/chunk-SQE76S5B.js +1 -0
- package/dist/graph/{chunk-ZMCB7VP2.js → chunk-WQHTQAFY.js} +1 -1
- package/dist/graph/{classDiagram-v2-L25IHNXF-JL7LVDZH.js → classDiagram-v2-L25IHNXF-HNTCDTNK.js} +1 -1
- package/dist/graph/{cose-bilkent-JH36ORCC-PNM3EYPB.js → cose-bilkent-JH36ORCC-2GVA7XKO.js} +1 -1
- package/dist/graph/{cynefin-EF2NZ3EQ-PSXP3DXL.js → cynefin-EF2NZ3EQ-TCI65RAQ.js} +1 -1
- package/dist/graph/{cynefinDiagram-L36ESFBY-QVY54CXO.js → cynefinDiagram-L36ESFBY-OKQ5BLVF.js} +1 -1
- package/dist/graph/{dagre-SPEB5RXH-HPGQXBZJ.js → dagre-SPEB5RXH-KZEBD52K.js} +1 -1
- package/dist/graph/{diagram-3B7GL73J-DWH5WS2P.js → diagram-3B7GL73J-ESCBJM3O.js} +1 -1
- package/dist/graph/{diagram-DNEMPZML-TEGH2U5I.js → diagram-DNEMPZML-ZIBUSQZI.js} +1 -1
- package/dist/graph/{diagram-L3MUGCDN-X4MREUWR.js → diagram-L3MUGCDN-IGK62IPN.js} +1 -1
- package/dist/graph/{diagram-LA4NIPWU-NXT746HG.js → diagram-LA4NIPWU-2KZCOFJ5.js} +1 -1
- package/dist/graph/{diagram-MHCOC4E2-JGHXSAGS.js → diagram-MHCOC4E2-EYAAB236.js} +1 -1
- package/dist/graph/{diagram-XPFHEONP-ZHZPBLT4.js → diagram-XPFHEONP-OZ5ARGMG.js} +1 -1
- package/dist/graph/{ebnfDiagram-UZSYDL2S-SMF6KJ43.js → ebnfDiagram-UZSYDL2S-M3XJHARD.js} +1 -1
- package/dist/graph/{erDiagram-EYBAPDEH-B3JNJ357.js → erDiagram-EYBAPDEH-Y7KUBH7A.js} +1 -1
- package/dist/graph/{eventmodeling-K75KTNOO-WG6DDYMC.js → eventmodeling-K75KTNOO-ROLYRDEP.js} +1 -1
- package/dist/graph/flowDiagram-MALGAFMO-AAUEIPCR.js +1 -0
- package/dist/graph/{ganttDiagram-23REXITY-YXBYWFOJ.js → ganttDiagram-23REXITY-JSBTFSSJ.js} +1 -1
- package/dist/graph/{gitGraph-VSP46ZUC-VBFWJBBT.js → gitGraph-VSP46ZUC-ZCBCDVNF.js} +1 -1
- package/dist/graph/{gitGraphDiagram-STJD7YCW-4FZDCFGV.js → gitGraphDiagram-STJD7YCW-3ZA5FT3G.js} +1 -1
- package/dist/graph/{info-OHQRW6UA-ALVDUVYV.js → info-OHQRW6UA-JKJGOQNY.js} +1 -1
- package/dist/graph/infoDiagram-KBXO4MBG-6LFMPP2O.js +2 -0
- package/dist/graph/{ishikawaDiagram-M35NCXHK-FRZD2PWQ.js → ishikawaDiagram-M35NCXHK-YLEU44DY.js} +1 -1
- package/dist/graph/{journeyDiagram-OPLOXDXO-7Z66JCPR.js → journeyDiagram-OPLOXDXO-ZHJV66ZT.js} +1 -1
- package/dist/graph/{kanban-definition-BZKZHSQY-NN5AIKTE.js → kanban-definition-BZKZHSQY-SDU25WUM.js} +1 -1
- package/dist/graph/{katex-DXDNVO6V.js → katex-WSLZOTY7.js} +1 -1
- package/dist/graph/{mindmap-definition-I2QAS2VK-HDPCABN2.js → mindmap-definition-I2QAS2VK-XQNBCYHN.js} +1 -1
- package/dist/graph/{packet-JDAUHWVQ-5MQIBWAH.js → packet-JDAUHWVQ-Y3H77ERD.js} +1 -1
- package/dist/graph/{pegDiagram-FD4XPPHP-H2BFNCKT.js → pegDiagram-FD4XPPHP-YO4VWH6V.js} +1 -1
- package/dist/graph/{pie-XZMESJXO-T5VRKHVT.js → pie-XZMESJXO-PRER4XL5.js} +1 -1
- package/dist/graph/{pieDiagram-J4AKIIQI-O3NJSVD3.js → pieDiagram-J4AKIIQI-TJ5WOOSV.js} +1 -1
- package/dist/graph/{quadrantDiagram-XTYBLID2-TMTZJI3P.js → quadrantDiagram-XTYBLID2-G6MSSZLW.js} +1 -1
- package/dist/graph/{radar-ABXABTNO-C6FXIBYW.js → radar-ABXABTNO-M6MV34GM.js} +1 -1
- package/dist/graph/{railroad-I3PHUGI6-ZSO5JXB3.js → railroad-I3PHUGI6-YIWPGN6Q.js} +1 -1
- package/dist/graph/{railroad-abnf-LNEFI6M7-CI4GQRHB.js → railroad-abnf-LNEFI6M7-7JHLZ2R7.js} +1 -1
- package/dist/graph/{railroad-ebnf-DWYD2UWJ-MUENNCGK.js → railroad-ebnf-DWYD2UWJ-V55BXEWY.js} +1 -1
- package/dist/graph/{railroad-peg-JR7BVNR7-N3X5GGIX.js → railroad-peg-JR7BVNR7-XCGKDRMK.js} +1 -1
- package/dist/graph/{railroadDiagram-MRQ6NCDL-JHWS23UO.js → railroadDiagram-MRQ6NCDL-RACSFXC4.js} +1 -1
- package/dist/graph/{requirementDiagram-Y7LWUY3S-7DVLPO4B.js → requirementDiagram-Y7LWUY3S-4LQIQWHQ.js} +1 -1
- package/dist/graph/{sankeyDiagram-WGJFYUXA-Z5L4R5TR.js → sankeyDiagram-WGJFYUXA-K3RXG5FB.js} +1 -1
- package/dist/graph/schema-graph-global.js +17 -17
- package/dist/graph/{sequenceDiagram-5NDRBG5M-RCTU25NT.js → sequenceDiagram-5NDRBG5M-Y6RBHRS3.js} +1 -1
- package/dist/graph/{sizeCapture-INFHLROL-RROY32P5.js → sizeCapture-INFHLROL-TJW3VUGH.js} +1 -1
- package/dist/graph/{stateDiagram-v2-FJ4FJNEA-BXUSPWDK.js → stateDiagram-v2-FJ4FJNEA-4M5WZORG.js} +1 -1
- package/dist/graph/swimlanes-UMQ2AFYF-O4W6U4RO.js +1 -0
- package/dist/graph/swimlanesDiagram-OMPLPG4O-HZAKM45N.js +8 -0
- package/dist/graph/{timeline-definition-SEUHKTQE-ZQSMIVAS.js → timeline-definition-SEUHKTQE-IHISQ4Q7.js} +1 -1
- package/dist/graph/{treeView-D4JQ5SDB-42S7U73N.js → treeView-D4JQ5SDB-EVGY4VYS.js} +1 -1
- package/dist/graph/{treemap-SAJKECNS-RUBYQ7XF.js → treemap-SAJKECNS-LN3SMFRX.js} +1 -1
- package/dist/graph/{usecaseDiagram-AFA6YXN4-57RDRYXF.js → usecaseDiagram-AFA6YXN4-B645A3J6.js} +1 -1
- package/dist/graph/{vennDiagram-NNMJR3RB-5C3LVAV6.js → vennDiagram-NNMJR3RB-K3HWMON6.js} +1 -1
- package/dist/graph/{wardley-7MLQ67FV-NV5HXTTC.js → wardley-7MLQ67FV-RRWOELC6.js} +1 -1
- package/dist/graph/{wardleyDiagram-S7YFUSEH-6D5BKXHM.js → wardleyDiagram-S7YFUSEH-DMMWKJEK.js} +1 -1
- package/dist/graph/{xychartDiagram-GGNKY7IX-6ET3ZM67.js → xychartDiagram-GGNKY7IX-K6MUQVXR.js} +1 -1
- package/dist/install.sh +68 -0
- package/dist/plugins.global.js +62 -62
- package/dist/{viewer → server}/assets.d.ts +2 -0
- package/dist/server/assets.js +7 -0
- package/dist/{viewer → server}/build-plugins.js +4 -4
- package/dist/{viewer → server}/build.d.ts +2 -1
- package/dist/{viewer → server}/build.js +31 -15
- package/dist/{cli.js → server/cli.js} +223 -56
- package/dist/server/editor-tools.d.ts +1 -0
- package/dist/server/editor-tools.js +1 -0
- package/dist/{viewer → server}/extension-pack.js +2 -2
- package/dist/{viewer → server}/extensions.d.ts +1 -1
- package/dist/{viewer → server}/extensions.js +3 -3
- package/dist/server/git-diff.d.ts +10 -0
- package/dist/{viewer → server}/git-diff.js +45 -10
- package/dist/server/git-origin.d.ts +4 -0
- package/dist/server/git-origin.js +103 -0
- package/dist/server/git.d.ts +9 -0
- package/dist/{viewer → server}/git.js +50 -6
- package/dist/server/history.d.ts +14 -0
- package/dist/server/history.js +205 -0
- package/dist/{viewer → server}/hmr.d.ts +0 -22
- package/dist/server/hmr.js +168 -0
- package/dist/server/index.d.ts +17 -0
- package/dist/{index.js → server/index.js} +16 -16
- package/dist/{viewer → server}/ja-lint.d.ts +1 -1
- package/dist/{viewer → server}/languages.d.ts +1 -1
- package/dist/{viewer → server}/languages.js +3 -3
- package/dist/{mcp.d.ts → server/mcp.d.ts} +2 -2
- package/dist/{mcp.js → server/mcp.js} +60 -21
- package/dist/{viewer → server}/plugin-config.d.ts +2 -2
- package/dist/{viewer → server}/plugin-config.js +2 -2
- package/dist/{plugins → server/plugins}/local-storage.d.ts +1 -1
- package/dist/{plugins → server/plugins}/local-storage.js +1 -1
- package/dist/{plugins → server/plugins}/runtime.d.ts +4 -4
- package/dist/{plugins → server/plugins}/runtime.js +4 -4
- package/dist/{viewer → server}/plugins.d.ts +3 -3
- package/dist/{viewer → server}/plugins.js +14 -13
- package/dist/server/resource-library.d.ts +1 -0
- package/dist/server/resource-library.js +1 -0
- package/dist/server/self.d.ts +5 -0
- package/dist/server/self.js +98 -0
- package/dist/server/serve.d.ts +61 -0
- package/dist/server/serve.js +503 -0
- package/dist/server/static-client.d.ts +4 -0
- package/dist/server/static-client.js +117 -0
- package/dist/server/workspace-server.d.ts +16 -0
- package/dist/server/workspace-server.js +266 -0
- package/dist/{viewer → server}/workspace.d.ts +6 -1
- package/dist/{viewer → server}/workspace.js +46 -0
- package/dist/subformats.global.js +92 -6
- package/dist/ui.global.js +85 -72
- package/dist/workspace/client.d.ts +13 -0
- package/dist/workspace/client.js +114 -0
- package/dist/{viewer → workspace}/code-file.d.ts +1 -1
- package/dist/{viewer → workspace}/code-file.js +7 -7
- package/dist/workspace/connection.d.ts +27 -0
- package/dist/workspace/connection.js +38 -0
- package/dist/{viewer → workspace}/editor-tools.d.ts +7 -1
- package/dist/{viewer → workspace}/editor-tools.js +12 -9
- package/dist/{viewer → workspace}/git-types.d.ts +7 -0
- package/dist/workspace/github.d.ts +4 -0
- package/dist/workspace/github.js +99 -0
- package/dist/workspace/history.d.ts +46 -0
- package/dist/workspace/history.js +86 -0
- package/dist/workspace/protocol.d.ts +38 -0
- package/dist/workspace/protocol.js +20 -0
- package/dist/workspace/resource-download.d.ts +1 -0
- package/dist/workspace/resource-download.js +8 -0
- package/dist/workspace/server.d.ts +9 -0
- package/dist/workspace/server.js +48 -0
- package/dist/{viewer → workspace}/site-icon.js +9 -10
- package/dist/{viewer → workspace}/site-title.js +6 -7
- package/dist/{viewer → workspace}/textfile.d.ts +1 -1
- package/dist/{viewer → workspace}/textfile.js +5 -5
- package/dist/workspace-worker.global.js +2859 -0
- package/package.json +43 -21
- package/dist/compiler/manifest.js +0 -37
- package/dist/compiler/serialize.d.ts +0 -3
- package/dist/compiler/serialize.js +0 -16
- package/dist/core/icons.js +0 -5
- package/dist/graph/chunk-3RNHDNP5.js +0 -1
- package/dist/graph/chunk-5UUEAHTN.js +0 -1
- package/dist/graph/chunk-6T55RVVR.js +0 -1
- package/dist/graph/elk-XV6XMXQE-AZ4HLCWI.js +0 -27
- package/dist/graph/flowDiagram-MALGAFMO-2R7EYAQI.js +0 -1
- package/dist/graph/infoDiagram-KBXO4MBG-7EHX2GQG.js +0 -2
- package/dist/graph/swimlanes-UMQ2AFYF-LDD74Q2S.js +0 -1
- package/dist/graph/swimlanesDiagram-OMPLPG4O-ZYULLJSU.js +0 -8
- package/dist/index.d.ts +0 -17
- package/dist/viewer/assets.js +0 -3
- package/dist/viewer/figure-preview.d.ts +0 -4
- package/dist/viewer/git-diff.d.ts +0 -6
- package/dist/viewer/git.d.ts +0 -5
- package/dist/viewer/hmr.js +0 -341
- package/dist/viewer/serve.d.ts +0 -216
- /package/dist/{compiler → engine/compiler}/asset-references.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/asset-references.js +0 -0
- /package/dist/{compiler → engine/compiler}/bundle-urls.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/check-types.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/check-types.js +0 -0
- /package/dist/{compiler → engine/compiler}/check.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/code-blocks.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/code-languages.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/config.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/drawio.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/drawio.js +0 -0
- /package/dist/{compiler → engine/compiler}/dxf.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/export.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/figures.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/files.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/fonts.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/format.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/format.js +0 -0
- /package/dist/{compiler → engine/compiler}/from-mdast.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/language-codes.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/language-codes.js +0 -0
- /package/dist/{compiler → engine/compiler}/locales.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/public-file.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/public-file.js +0 -0
- /package/dist/{compiler → engine/compiler}/subformat-schema.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/terms.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/terms.js +0 -0
- /package/dist/{compiler → engine/compiler}/textfile-remote.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/textfile.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/theme-variants.d.ts +0 -0
- /package/dist/{compiler → engine/compiler}/zip.d.ts +0 -0
- /package/dist/{core → engine/core}/blocks.js +0 -0
- /package/dist/{core → engine/core}/code-file.d.ts +0 -0
- /package/dist/{core → engine/core}/code-file.js +0 -0
- /package/dist/{core → engine/core}/code-grammars.d.ts +0 -0
- /package/dist/{core → engine/core}/code-grammars.js +0 -0
- /package/dist/{core → engine/core}/content-types.js +0 -0
- /package/dist/{core → engine/core}/escape-html.d.ts +0 -0
- /package/dist/{core → engine/core}/escape-html.js +0 -0
- /package/dist/{core → engine/core}/extension-package.d.ts +0 -0
- /package/dist/{core → engine/core}/extension-package.js +0 -0
- /package/dist/{core → engine/core}/figure-frame.d.ts +0 -0
- /package/dist/{core → engine/core}/figure-frame.js +0 -0
- /package/dist/{core → engine/core}/file-embed.d.ts +0 -0
- /package/dist/{core → engine/core}/file-embed.js +0 -0
- /package/dist/{core → engine/core}/files.d.ts +0 -0
- /package/dist/{core → engine/core}/files.js +0 -0
- /package/dist/{core → engine/core}/graph-common.d.ts +0 -0
- /package/dist/{core → engine/core}/graph-common.js +0 -0
- /package/dist/{core → engine/core}/graph.d.ts +0 -0
- /package/dist/{core → engine/core}/graph.js +0 -0
- /package/dist/{core → engine/core}/inline.d.ts +0 -0
- /package/dist/{core → engine/core}/inline.js +0 -0
- /package/dist/{core → engine/core}/json-tools.d.ts +0 -0
- /package/dist/{core → engine/core}/json-tools.js +0 -0
- /package/dist/{core → engine/core}/language.d.ts +0 -0
- /package/dist/{core → engine/core}/language.js +0 -0
- /package/dist/{core → engine/core}/languages/ja.d.ts +0 -0
- /package/dist/{core → engine/core}/languages/ja.js +0 -0
- /package/dist/{core → engine/core}/markdown.d.ts +0 -0
- /package/dist/{core → engine/core}/markdown.js +0 -0
- /package/dist/{core → engine/core}/previewers.d.ts +0 -0
- /package/dist/{core → engine/core}/previewers.js +0 -0
- /package/dist/{core → engine/core}/schema-comments.d.ts +0 -0
- /package/dist/{core → engine/core}/schema-comments.js +0 -0
- /package/dist/{core → engine/core}/schema-fields.d.ts +0 -0
- /package/dist/{core → engine/core}/schema-fields.js +0 -0
- /package/dist/{core → engine/core}/schema-graph.d.ts +0 -0
- /package/dist/{core → engine/core}/schema-graph.js +0 -0
- /package/dist/{core → engine/core}/subformat-record.d.ts +0 -0
- /package/dist/{core → engine/core}/subformat-record.js +0 -0
- /package/dist/{core → engine/core}/term-reference.d.ts +0 -0
- /package/dist/{core → engine/core}/term-reference.js +0 -0
- /package/dist/{core → engine/core}/textfile.d.ts +0 -0
- /package/dist/{core → engine/core}/textfile.js +0 -0
- /package/dist/{core → engine/core}/theme-variants.d.ts +0 -0
- /package/dist/{core → engine/core}/theme-variants.js +0 -0
- /package/dist/{core → engine/core}/workspace.d.ts +0 -0
- /package/dist/{core → engine/core}/workspace.js +0 -0
- /package/dist/{viewer → frontend}/bundle-network.d.ts +0 -0
- /package/dist/{viewer → frontend}/bundle-network.js +0 -0
- /package/dist/{core → frontend}/flow-base-css.generated.d.ts +0 -0
- /package/dist/{core → frontend}/flow-base-css.generated.js +0 -0
- /package/dist/{core → frontend}/flow-css.d.ts +0 -0
- /package/dist/{core → frontend}/flow-css.js +0 -0
- /package/dist/{viewer → frontend}/font-picker.js +0 -0
- /package/dist/{viewer → frontend}/font-settings.js +0 -0
- /package/dist/{viewer → frontend}/i18n.d.ts +0 -0
- /package/dist/{viewer → frontend}/i18n.js +0 -0
- /package/dist/{viewer → frontend}/language-picker.d.ts +0 -0
- /package/dist/{viewer → frontend}/lazy-preview.d.ts +0 -0
- /package/dist/{viewer → frontend}/lazy-preview.js +0 -0
- /package/dist/{viewer → frontend}/nav-focus.d.ts +0 -0
- /package/dist/{viewer → frontend}/nav-update.d.ts +0 -0
- /package/dist/{viewer → frontend}/nav-update.js +0 -0
- /package/dist/{viewer → frontend}/plugin-blocks.d.ts +0 -0
- /package/dist/{viewer → frontend}/plugin-style.d.ts +0 -0
- /package/dist/{viewer → frontend}/plugin-style.js +0 -0
- /package/dist/{viewer → frontend}/plugin-view.d.ts +0 -0
- /package/dist/{viewer → frontend}/plugin-view.js +0 -0
- /package/dist/{viewer → frontend}/resize.d.ts +0 -0
- /package/dist/{core → frontend}/schema-graph-mount.d.ts +0 -0
- /package/dist/{core → frontend}/schema-graph-mount.js +0 -0
- /package/dist/{core → frontend}/table-ui.d.ts +0 -0
- /package/dist/{core → frontend}/table-ui.js +0 -0
- /package/dist/{core → frontend}/terms-ui.d.ts +0 -0
- /package/dist/{core → frontend}/terms-ui.js +0 -0
- /package/dist/{viewer → frontend}/theme-picker.d.ts +0 -0
- /package/dist/{viewer → frontend}/theme-picker.js +0 -0
- /package/dist/{core → frontend}/toc-ui.d.ts +0 -0
- /package/dist/{core → frontend}/toc-ui.js +0 -0
- /package/dist/{core → frontend}/video-ui.d.ts +0 -0
- /package/dist/{core → frontend}/video-ui.js +0 -0
- /package/dist/graph/{chunk-GYT4IYBZ.js → chunk-RJFVWYCA.js} +0 -0
- /package/dist/{viewer → server}/build-plugins.d.ts +0 -0
- /package/dist/{cli.d.ts → server/cli.d.ts} +0 -0
- /package/dist/{viewer → server}/extension-pack.d.ts +0 -0
- /package/dist/{viewer → server}/fonts/LICENSE.txt +0 -0
- /package/dist/{viewer → server}/fonts/udev-gothic-regular.woff2 +0 -0
- /package/dist/{viewer → server}/fonts.d.ts +0 -0
- /package/dist/{viewer → server}/fonts.js +0 -0
- /package/dist/{viewer → server}/ja-lint.js +0 -0
- /package/dist/{viewer → workspace}/git-types.js +0 -0
- /package/dist/{viewer → workspace}/site-icon.d.ts +0 -0
- /package/dist/{viewer → workspace}/site-title.d.ts +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type FileLayout } from "./files.js";
|
|
2
2
|
import { type Subformat } from "./subformats.js";
|
|
3
3
|
export declare const MANIFEST_FILE = "dooc.yaml";
|
|
4
|
+
export declare const isManifestFile: (name: string) => boolean;
|
|
4
5
|
export interface DocNode {
|
|
5
6
|
id: string;
|
|
6
7
|
file?: string;
|
|
7
8
|
subformat?: string;
|
|
9
|
+
/** Library page: a block format (`schemath`), `urls` or `url-previews`. */
|
|
10
|
+
library?: string;
|
|
8
11
|
title?: string;
|
|
9
12
|
children: DocNode[];
|
|
10
13
|
}
|
|
@@ -28,6 +31,8 @@ export interface ParsedManifest {
|
|
|
28
31
|
}
|
|
29
32
|
export declare const DOC_ID_RE: RegExp;
|
|
30
33
|
export declare const isDocId: (s: string) => boolean;
|
|
34
|
+
export declare const libraryPageId: (view: string) => string;
|
|
35
|
+
export declare const isLibraryView: (view: unknown) => view is string;
|
|
31
36
|
export declare const subformatPageId: (ext: string) => string;
|
|
32
37
|
/** Doc file name directly under content/ (`<id>.md`) → id. undefined if the shape differs. */
|
|
33
38
|
export declare const docIdOfFile: (name: string) => string | undefined;
|
|
@@ -45,7 +50,7 @@ export declare const flattenTree: (tree: readonly DocNode[]) => (Omit<DocNode, "
|
|
|
45
50
|
depth: number;
|
|
46
51
|
})[];
|
|
47
52
|
/** Append a new doc to the end of parent's children. Duplicate id / missing parent → undefined. */
|
|
48
|
-
export declare const insertDoc: (tree: readonly DocNode[], id: string, parent?: string, page?: Pick<DocNode, "subformat" | "title">) => DocNode[] | undefined;
|
|
53
|
+
export declare const insertDoc: (tree: readonly DocNode[], id: string, parent?: string, page?: Pick<DocNode, "subformat" | "library" | "title">) => DocNode[] | undefined;
|
|
49
54
|
/**
|
|
50
55
|
* Move a doc (with its children) to position index under parent. It can't be moved under
|
|
51
56
|
* itself or its own descendants (that would create a cycle). An invalid move returns undefined
|
|
@@ -5,8 +5,11 @@ import { docFile, fileDocumentId, localFile, parseFileLayout } from "./files.js"
|
|
|
5
5
|
import { contentLanguageCode, DEFAULT_LANG, isLangTag } from "./language.js";
|
|
6
6
|
import { parseSubformats } from "./subformats.js";
|
|
7
7
|
export const MANIFEST_FILE = "dooc.yaml";
|
|
8
|
+
export const isManifestFile = (name) => /^(?:[^/\\]+\.)?dooc\.yaml$/.test(name);
|
|
8
9
|
export const DOC_ID_RE = /^[a-z0-9][a-z0-9-]*$/;
|
|
9
10
|
export const isDocId = (s) => DOC_ID_RE.test(s);
|
|
11
|
+
export const libraryPageId = (view) => `library-${fileDocumentId(view)}`;
|
|
12
|
+
export const isLibraryView = (view) => typeof view === "string" && /^[a-z0-9][a-z0-9+#-]*$/.test(view);
|
|
10
13
|
export const subformatPageId = (ext) => `subformat-${fileDocumentId(ext)}`;
|
|
11
14
|
/** Doc file name directly under content/ (`<id>.md`) → id. undefined if the shape differs. */
|
|
12
15
|
export const docIdOfFile = (name) => {
|
|
@@ -85,6 +88,7 @@ export const parseManifest = (value) => {
|
|
|
85
88
|
if (manifest.default_subformat_folder !== undefined) {
|
|
86
89
|
const folder = manifest.default_subformat_folder;
|
|
87
90
|
if (!localFile(folder) ||
|
|
91
|
+
isManifestFile(folder.split("/")[0] ?? "") ||
|
|
88
92
|
["node_modules", "dist", "locales", MANIFEST_FILE, "docs.config.mjs"].includes(folder.split("/")[0] ?? ""))
|
|
89
93
|
errors.push(`${MANIFEST_FILE}: default_subformat_folder must be a local project folder`);
|
|
90
94
|
else
|
|
@@ -133,6 +137,28 @@ export const parseManifest = (value) => {
|
|
|
133
137
|
const at = `${path}[${i}]`;
|
|
134
138
|
let id;
|
|
135
139
|
let children;
|
|
140
|
+
if (item && typeof item === "object" && !Array.isArray(item) && "library" in item) {
|
|
141
|
+
const id = isLibraryView(item.library) ? libraryPageId(item.library) : "";
|
|
142
|
+
if (!id ||
|
|
143
|
+
Object.keys(item).some((key) => !["library", "title", "children"].includes(key)) ||
|
|
144
|
+
(item.title !== undefined &&
|
|
145
|
+
(typeof item.title !== "string" || !item.title.trim()))) {
|
|
146
|
+
errors.push(`${MANIFEST_FILE}: ${at} requires a library view and a non-empty title`);
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (seen.has(id)) {
|
|
150
|
+
errors.push(`${MANIFEST_FILE}: duplicate id "${id}"`);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
seen.add(id);
|
|
154
|
+
nodes.push({
|
|
155
|
+
id,
|
|
156
|
+
library: item.library,
|
|
157
|
+
title: item.title?.trim() ?? item.library,
|
|
158
|
+
children: walk(item.children, `${at}.children`),
|
|
159
|
+
});
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
136
162
|
if (item && typeof item === "object" && !Array.isArray(item) && "subformat" in item) {
|
|
137
163
|
const config = subformats?.find((format) => format.ext === item.subformat);
|
|
138
164
|
if (!config ||
|
|
@@ -188,7 +214,7 @@ export const parseManifest = (value) => {
|
|
|
188
214
|
if (!seen.has(id))
|
|
189
215
|
errors.push(`${MANIFEST_FILE}: files references unknown document "${id}"`);
|
|
190
216
|
const paths = flattenTree(tree)
|
|
191
|
-
.filter((node) => !node.subformat)
|
|
217
|
+
.filter((node) => !node.subformat && !node.library)
|
|
192
218
|
.map(({ id }) => docFile(id, files));
|
|
193
219
|
if (new Set(paths).size !== paths.length)
|
|
194
220
|
errors.push(`${MANIFEST_FILE}: documents must use distinct files`);
|
|
@@ -257,10 +283,27 @@ const parseNestedManifest = (input) => {
|
|
|
257
283
|
if (!Array.isArray(value))
|
|
258
284
|
throw new Error("center_contents and children must be lists");
|
|
259
285
|
return value.map((entry) => {
|
|
260
|
-
const node = object(entry, ["file", "icon", "children", "subformat", "title"], "center_contents");
|
|
286
|
+
const node = object(entry, ["file", "icon", "children", "subformat", "library", "title"], "center_contents");
|
|
261
287
|
if (node.icon !== undefined &&
|
|
262
288
|
(!localFile(node.icon) || !node.icon.endsWith(".svg")))
|
|
263
289
|
throw new Error("Document icons must be local SVG files");
|
|
290
|
+
if (node.library !== undefined) {
|
|
291
|
+
if (!isLibraryView(node.library) ||
|
|
292
|
+
node.file !== undefined ||
|
|
293
|
+
node.subformat !== undefined ||
|
|
294
|
+
(node.title !== undefined &&
|
|
295
|
+
(typeof node.title !== "string" || !node.title.trim())))
|
|
296
|
+
throw new Error("Library pages require a view and a non-empty title");
|
|
297
|
+
const id = libraryPageId(node.library);
|
|
298
|
+
if (typeof node.icon === "string")
|
|
299
|
+
icons[id] = node.icon;
|
|
300
|
+
return {
|
|
301
|
+
id,
|
|
302
|
+
library: node.library,
|
|
303
|
+
title: typeof node.title === "string" ? node.title.trim() : node.library,
|
|
304
|
+
children: node.children === undefined ? [] : walk(node.children),
|
|
305
|
+
};
|
|
306
|
+
}
|
|
264
307
|
if (node.subformat !== undefined) {
|
|
265
308
|
const config = parseSubformats(root.json_subformats ?? []).find((format) => format.ext === node.subformat);
|
|
266
309
|
if (!config ||
|
|
@@ -280,6 +323,9 @@ const parseNestedManifest = (input) => {
|
|
|
280
323
|
}
|
|
281
324
|
if (!localFile(node.file) || !node.file.endsWith(".md"))
|
|
282
325
|
throw new Error("Each document requires a local .md file");
|
|
326
|
+
if (node.title !== undefined &&
|
|
327
|
+
(typeof node.title !== "string" || !node.title.trim()))
|
|
328
|
+
throw new Error("Document titles must be non-empty strings");
|
|
283
329
|
const id = fileDocumentId(node.file);
|
|
284
330
|
if (Object.hasOwn(documents, id))
|
|
285
331
|
throw new Error(`Duplicate document: ${node.file}`);
|
|
@@ -289,6 +335,7 @@ const parseNestedManifest = (input) => {
|
|
|
289
335
|
return {
|
|
290
336
|
id,
|
|
291
337
|
file: node.file,
|
|
338
|
+
...(typeof node.title === "string" ? { title: node.title.trim() } : {}),
|
|
292
339
|
children: node.children === undefined ? [] : walk(node.children),
|
|
293
340
|
};
|
|
294
341
|
});
|
|
@@ -300,15 +347,21 @@ const parseNestedManifest = (input) => {
|
|
|
300
347
|
const source = contentLanguageCode(language);
|
|
301
348
|
if (sidebar.title !== undefined && !titles[source])
|
|
302
349
|
throw new Error("left_sidebar.title must include system.default_lang");
|
|
303
|
-
const legacyTree = (nodes) => nodes.map((node) => node.
|
|
350
|
+
const legacyTree = (nodes) => nodes.map((node) => node.library
|
|
304
351
|
? {
|
|
305
|
-
|
|
352
|
+
library: node.library,
|
|
306
353
|
title: node.title,
|
|
307
|
-
children: legacyTree(node.children),
|
|
354
|
+
...(node.children.length ? { children: legacyTree(node.children) } : {}),
|
|
308
355
|
}
|
|
309
|
-
: node.
|
|
310
|
-
? {
|
|
311
|
-
|
|
356
|
+
: node.subformat
|
|
357
|
+
? {
|
|
358
|
+
subformat: node.subformat,
|
|
359
|
+
title: node.title,
|
|
360
|
+
children: legacyTree(node.children),
|
|
361
|
+
}
|
|
362
|
+
: node.children.length
|
|
363
|
+
? { [node.id]: legacyTree(node.children) }
|
|
364
|
+
: node.id);
|
|
312
365
|
const parsed = parseManifest({
|
|
313
366
|
docs: legacyTree(tree),
|
|
314
367
|
defaultLang: language,
|
|
@@ -349,9 +402,14 @@ const parseNestedManifest = (input) => {
|
|
|
349
402
|
export const serializeManifest = (tree, { format, titles, themeIcons, title, icon, defaultLang, licence, files, languages, themes, subformats, defaultSubformatFolder, } = {}) => {
|
|
350
403
|
if (format === "nested") {
|
|
351
404
|
const contents = (nodes) => nodes.map((node) => ({
|
|
352
|
-
...(node.
|
|
353
|
-
? {
|
|
354
|
-
:
|
|
405
|
+
...(node.library
|
|
406
|
+
? { library: node.library, title: node.title }
|
|
407
|
+
: node.subformat
|
|
408
|
+
? { subformat: node.subformat, title: node.title }
|
|
409
|
+
: {
|
|
410
|
+
file: docFile(node.id, files),
|
|
411
|
+
...(node.title ? { title: node.title } : {}),
|
|
412
|
+
}),
|
|
355
413
|
...(files?.icons?.[node.id] ? { icon: files.icons[node.id] } : {}),
|
|
356
414
|
...(node.children.length ? { children: contents(node.children) } : {}),
|
|
357
415
|
}));
|
|
@@ -392,16 +450,22 @@ export const serializeManifest = (tree, { format, titles, themeIcons, title, ico
|
|
|
392
450
|
: {}),
|
|
393
451
|
}, { lineWidth: 0 });
|
|
394
452
|
}
|
|
395
|
-
if (flattenTree(tree).some((node) => node.subformat)) {
|
|
396
|
-
const contents = (nodes) => nodes.map((node) => node.
|
|
453
|
+
if (flattenTree(tree).some((node) => node.subformat || node.library)) {
|
|
454
|
+
const contents = (nodes) => nodes.map((node) => node.library
|
|
397
455
|
? {
|
|
398
|
-
|
|
456
|
+
library: node.library,
|
|
399
457
|
title: node.title,
|
|
400
458
|
...(node.children.length ? { children: contents(node.children) } : {}),
|
|
401
459
|
}
|
|
402
|
-
: node.
|
|
403
|
-
? {
|
|
404
|
-
|
|
460
|
+
: node.subformat
|
|
461
|
+
? {
|
|
462
|
+
subformat: node.subformat,
|
|
463
|
+
title: node.title,
|
|
464
|
+
...(node.children.length ? { children: contents(node.children) } : {}),
|
|
465
|
+
}
|
|
466
|
+
: node.children.length
|
|
467
|
+
? { [node.id]: contents(node.children) }
|
|
468
|
+
: node.id);
|
|
405
469
|
return stringify({
|
|
406
470
|
...(title ? { title } : {}),
|
|
407
471
|
...(icon ? { icon } : {}),
|
|
@@ -440,7 +504,9 @@ export const flattenTree = (tree) => {
|
|
|
440
504
|
out.push({
|
|
441
505
|
id: n.id,
|
|
442
506
|
...(n.file ? { file: n.file } : {}),
|
|
443
|
-
...(n.subformat ? { subformat: n.subformat
|
|
507
|
+
...(n.subformat ? { subformat: n.subformat } : {}),
|
|
508
|
+
...(n.library ? { library: n.library } : {}),
|
|
509
|
+
...(n.title ? { title: n.title } : {}),
|
|
444
510
|
...(parent == null ? {} : { parent }),
|
|
445
511
|
depth,
|
|
446
512
|
});
|
|
@@ -26,15 +26,17 @@ export interface FigureEntry {
|
|
|
26
26
|
export type CompiledDoc = Frontmatter & {
|
|
27
27
|
id: string;
|
|
28
28
|
subformat?: SubformatCollection;
|
|
29
|
+
/** Library view shown by a display page (`schemath`, `urls`, ...). */
|
|
30
|
+
library?: string;
|
|
29
31
|
/** Parent doc id (SoT: dooc.yaml). Omitted = top level. docs[] is in pre-order. */
|
|
30
32
|
parent?: string;
|
|
31
33
|
/** Project-relative Markdown source path, or subformat:<ext> for a display page. */
|
|
32
34
|
file: string;
|
|
33
|
-
/** Resolved language (BCP 47):
|
|
35
|
+
/** Resolved language (BCP 47): the translation language, else the site default (language.ts). */
|
|
34
36
|
lang: string;
|
|
35
37
|
/** Sidebar icon (full content of icons/<id>.svg, 1:1). Omitted if there is none. */
|
|
36
38
|
icon?: string;
|
|
37
|
-
/** Source md
|
|
39
|
+
/** Source md. For MCP / copy; rendering uses blocks. */
|
|
38
40
|
body: string;
|
|
39
41
|
/** Normalized Block AST (the blocks.ts contract). Consumers just map it to rendering. */
|
|
40
42
|
blocks: Block[];
|
|
@@ -5,6 +5,7 @@ import { type LanguageAdapter } from "./language.js";
|
|
|
5
5
|
import { type Frontmatter } from "./taxonomy.js";
|
|
6
6
|
export { escapeHtml } from "./escape-html.js";
|
|
7
7
|
export interface RenderCtx {
|
|
8
|
+
downloads?: ReadonlyMap<string, string>;
|
|
8
9
|
/** Source file to published document route. */
|
|
9
10
|
docLinks?: ReadonlyMap<string, string>;
|
|
10
11
|
/** Figures including their markup (name → entry). */
|
|
@@ -17,6 +18,11 @@ export interface RenderCtx {
|
|
|
17
18
|
lang?: string;
|
|
18
19
|
/** Localized in-page table of contents title. Default: Contents. */
|
|
19
20
|
tocTitle?: string;
|
|
21
|
+
/** Download URL of the page's own source, shown beside its title. */
|
|
22
|
+
pageDownload?: {
|
|
23
|
+
file: string;
|
|
24
|
+
href: string;
|
|
25
|
+
};
|
|
20
26
|
/** Document URL for the viewer's section-copy buttons. */
|
|
21
27
|
sectionUrl?: string;
|
|
22
28
|
/**
|
|
@@ -28,5 +34,6 @@ export interface RenderCtx {
|
|
|
28
34
|
export declare const emptyCtx: RenderCtx;
|
|
29
35
|
/** Shared dictionary entries for definitions and the Resources list. */
|
|
30
36
|
export declare const termsHtml: (terms: readonly TermEntry[], language?: LanguageAdapter, sortable?: boolean) => string;
|
|
37
|
+
export declare const resourceDownloadHtml: (file: string, href: string) => string;
|
|
31
38
|
export declare const blocksHtml: (blocks: Block[], ctx?: RenderCtx) => string;
|
|
32
39
|
export declare const docHtml: (fm: Frontmatter, blocks: Block[], errors: string[], ctx?: RenderCtx, toc?: TocEntry[]) => string;
|
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
import { escapeHtml } from "./escape-html.js";
|
|
6
6
|
import { figureFrameHtml } from "./figure-frame.js";
|
|
7
7
|
import { parseFigureLink } from "./file-embed.js";
|
|
8
|
+
import { localFile } from "./files.js";
|
|
8
9
|
import { GRAPH_LAYOUT_MARGIN, GRAPH_LEGEND, graphUid, layoutGraph, } from "./graph.js";
|
|
9
10
|
import { CHECK_ICON } from "./icons.js";
|
|
10
11
|
import { inlineSegmenter, termMap } from "./inline.js";
|
|
11
12
|
import { termComparator } from "./language.js";
|
|
12
|
-
import { parseDocLink } from "./routing.js";
|
|
13
|
+
import { isReferenceUrl, parseDocLink } from "./routing.js";
|
|
13
14
|
import { layoutSchemaGraph, SCHEMA_LAYOUT_MARGIN, schemaGraphClientData, schemaGraphUid, } from "./schema-graph.js";
|
|
14
15
|
import { docDisplayName } from "./taxonomy.js";
|
|
15
16
|
import { termAnchor } from "./term-reference.js";
|
|
16
|
-
import { textfileName } from "./textfile.js";
|
|
17
|
+
import { parseFileReference, textfileName } from "./textfile.js";
|
|
17
18
|
export { escapeHtml } from "./escape-html.js";
|
|
18
19
|
export const emptyCtx = { figures: new Map(), terms: [] };
|
|
19
20
|
// File links open their resource page; SVGs and terms also have hover previews.
|
|
@@ -31,6 +32,8 @@ const inlineHtml = (segments, ctx) => segments
|
|
|
31
32
|
return `<em>${inlineHtml(s.children, ctx)}</em>`;
|
|
32
33
|
case "link": {
|
|
33
34
|
const label = s.children ? inlineHtml(s.children, ctx) : escapeHtml(s.text);
|
|
35
|
+
if (!isReferenceUrl(s.url))
|
|
36
|
+
return label;
|
|
34
37
|
let href = s.url;
|
|
35
38
|
try {
|
|
36
39
|
const ref = parseDocLink(s.url);
|
|
@@ -39,6 +42,15 @@ const inlineHtml = (segments, ctx) => segments
|
|
|
39
42
|
href =
|
|
40
43
|
target +
|
|
41
44
|
(ref.fragment ? `#${encodeURIComponent(ref.fragment)}` : "");
|
|
45
|
+
// Other local files open their resource page instead of a dead relative URL.
|
|
46
|
+
if (!ref && !/^(?:[a-z][a-z\d+.-]*:|[/#])/i.test(s.url)) {
|
|
47
|
+
const { file, range } = parseFileReference(s.url);
|
|
48
|
+
const local = file.replace(/^(\.\/)+/, "");
|
|
49
|
+
if (localFile(local))
|
|
50
|
+
href =
|
|
51
|
+
`/_files/file/${encodeURIComponent(local)}` +
|
|
52
|
+
(range ? `#${encodeURIComponent(range.slice(1))}` : "");
|
|
53
|
+
}
|
|
42
54
|
const figureRef = parseFigureLink(s.url);
|
|
43
55
|
const fig = figureRef &&
|
|
44
56
|
[...ctx.figures.values()].find((fig) => fig.file === figureRef.file);
|
|
@@ -334,7 +346,36 @@ export const termsHtml = (terms, language, sortable = false) => {
|
|
|
334
346
|
.map((e, i) => `<fieldset class="dict-card" data-source-order="${e.sourceOrder}" data-sort-order="${i}" data-term="${escapeHtml(e.id)}"><legend id="${termAnchor(e.id)}">${TERM_ICON}<a class="term-name" href="/_files/terms#${encodeURIComponent(termAnchor(e.id))}"${e.description ? ` aria-describedby="term-description-${encodeURIComponent(e.id)}"` : ""}>${escapeHtml(e.name)}${e.description ? `<span class="term-description" role="tooltip" id="term-description-${encodeURIComponent(e.id)}">${escapeHtml(e.description)}</span>` : ""}</a></legend><p class="term-definition">${escapeHtml(e.definition)}</p></fieldset>`)
|
|
335
347
|
.join("")}</div></section>`;
|
|
336
348
|
};
|
|
349
|
+
export const resourceDownloadHtml = (file, href) => `<a class="resource-download" href="${escapeHtml(href)}" download="${escapeHtml(textfileName(file))}" data-resource-download title="${escapeHtml(`Download ${textfileName(file)}`)}" aria-label="${escapeHtml(`Download ${textfileName(file)}`)}"><svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 2v10m-4-4 4 4 4-4M3 13v4h14v-4"/></svg></a>`;
|
|
337
350
|
const blockHtml = (b, ctx, seg) => {
|
|
351
|
+
const html = blockContentHtml(b, ctx, seg);
|
|
352
|
+
if (!ctx.downloads || (b.type === "code" && b.unavailable))
|
|
353
|
+
return html;
|
|
354
|
+
const file = b.sourceFile ??
|
|
355
|
+
(b.type === "code"
|
|
356
|
+
? b.filename
|
|
357
|
+
: b.type === "figureRef"
|
|
358
|
+
? ctx.figures.get(b.name)?.file
|
|
359
|
+
: b.type === "external"
|
|
360
|
+
? b.url
|
|
361
|
+
: undefined);
|
|
362
|
+
if (!file)
|
|
363
|
+
return html;
|
|
364
|
+
const remote = b.type === "external" ? new URL(file) : undefined;
|
|
365
|
+
const href = ctx.downloads.get(file.replace(/^(\.\/)+/, "")) ??
|
|
366
|
+
(remote && /^https?:$/.test(remote.protocol) && !remote.username && !remote.password
|
|
367
|
+
? file
|
|
368
|
+
: undefined);
|
|
369
|
+
if (!href)
|
|
370
|
+
return html;
|
|
371
|
+
const link = resourceDownloadHtml(file, href);
|
|
372
|
+
// Code blocks carry the download beside their copy button; other blocks get a corner overlay.
|
|
373
|
+
const copy = '<button class="codecopy"';
|
|
374
|
+
if (b.type === "code" && html.includes(copy))
|
|
375
|
+
return html.replace(copy, link + copy);
|
|
376
|
+
return `<div class="downloadable-resource"><div class="resource-download-tools">${link}</div>${html}</div>`;
|
|
377
|
+
};
|
|
378
|
+
const blockContentHtml = (b, ctx, seg) => {
|
|
338
379
|
switch (b.type) {
|
|
339
380
|
case "themeVariants":
|
|
340
381
|
return `<div data-theme-variants><div data-theme-variant="">${blockHtml(b.default, ctx, seg)}</div>${Object.entries(b.variants)
|
|
@@ -441,5 +482,5 @@ export const docHtml = (fm, blocks, errors, ctx = emptyCtx, toc = []) => {
|
|
|
441
482
|
? `<div class="errors">${errors.map((e) => `<div>${escapeHtml(e)}</div>`).join("")}</div>`
|
|
442
483
|
: "";
|
|
443
484
|
const lang = ctx.lang ? ` lang="${escapeHtml(ctx.lang)}"` : "";
|
|
444
|
-
return `<article${lang}>${errBox}<header class="doc-title"><h1>${escapeHtml(docDisplayName(fm, ""))}</h1>${inPageTocHtml(toc, ctx.tocTitle)}</header>${blocksHtml(blocks, ctx)}</article>`;
|
|
485
|
+
return `<article${lang}>${errBox}<header class="doc-title"><h1>${escapeHtml(docDisplayName(fm, ""))}</h1>${ctx.pageDownload ? resourceDownloadHtml(ctx.pageDownload.file, ctx.pageDownload.href) : ""}${inPageTocHtml(toc, ctx.tocTitle)}</header>${blocksHtml(blocks, ctx)}</article>`;
|
|
445
486
|
};
|
|
@@ -3,3 +3,6 @@ export declare const RELOAD_ICON_PATH = "M17 8a7 7 0 1 0 0 5M17 3v5h-5";
|
|
|
3
3
|
export declare const SEARCH_ICON_PATH = "M14 14l4 4M15 9a6 6 0 1 1-12 0 6 6 0 0 1 12 0";
|
|
4
4
|
export declare const CHECK_ICON = "<svg class=\"ic-ok\" viewBox=\"0 0 20 20\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m4 10 4 4 8-8\"/></svg>";
|
|
5
5
|
export declare const PLUGINS_ICON = "<svg class=\"nav-icon\" viewBox=\"0 0 20 20\" width=\"18\" height=\"18\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"m10 2 4 2v5l-4 2-4-2V4Zm-4 2 4 2 4-2m-4 2v5M6 9l-4 2v5l4 2 4-2v-5m-8 0 4 2 4-2m-4 2v5m8-9 4 2v5l-4 2-4-2m0-5 4 2 4-2m-4 2v5\"/></svg>";
|
|
6
|
+
/** One glyph per Library view, so views are told apart without reading their names. */
|
|
7
|
+
export declare const LIBRARY_ICONS: Readonly<Record<string, string>>;
|
|
8
|
+
export declare const libraryIcon: (view: string) => string | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const FOLDER_ICON_PATH = "M2 5h6l2 2h8v10H2Z";
|
|
2
|
+
export const RELOAD_ICON_PATH = "M17 8a7 7 0 1 0 0 5M17 3v5h-5";
|
|
3
|
+
export const SEARCH_ICON_PATH = "M14 14l4 4M15 9a6 6 0 1 1-12 0 6 6 0 0 1 12 0";
|
|
4
|
+
export const CHECK_ICON = '<svg class="ic-ok" viewBox="0 0 20 20" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4 10 4 4 8-8"/></svg>';
|
|
5
|
+
export const PLUGINS_ICON = '<svg class="nav-icon" viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m10 2 4 2v5l-4 2-4-2V4Zm-4 2 4 2 4-2m-4 2v5M6 9l-4 2v5l4 2 4-2v-5m-8 0 4 2 4-2m-4 2v5m8-9 4 2v5l-4 2-4-2m0-5 4 2 4-2m-4 2v5"/></svg>';
|
|
6
|
+
const glyph = (paths) => `<svg class="nav-icon" viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${paths}</svg>`;
|
|
7
|
+
/** One glyph per Library view, so views are told apart without reading their names. */
|
|
8
|
+
export const LIBRARY_ICONS = {
|
|
9
|
+
codeblocks: glyph('<path d="m7 6-4 4 4 4M13 6l4 4-4 4"/>'),
|
|
10
|
+
urls: glyph('<path d="M8.5 11.5a3 3 0 0 0 4.2 0l3-3a3 3 0 0 0-4.2-4.2l-1 1M11.5 8.5a3 3 0 0 0-4.2 0l-3 3a3 3 0 0 0 4.2 4.2l1-1"/>'),
|
|
11
|
+
"url-previews": glyph('<rect x="3" y="4" width="14" height="12" rx="1.5"/><path d="M3 8h14M6 12.5h5"/>'),
|
|
12
|
+
csv: glyph('<rect x="3" y="4" width="14" height="12" rx="1"/><path d="M3 8h14M3 12h14M8 4v12"/>'),
|
|
13
|
+
tsv: glyph('<path d="M3 6h8M3 10h8M3 14h8M13.5 7l3 3-3 3M17 5v10"/>'),
|
|
14
|
+
mermaid: glyph('<rect x="3" y="3" width="6" height="4" rx="1"/><rect x="11" y="13" width="6" height="4" rx="1"/><path d="M6 7v6a2 2 0 0 0 2 2h3"/>'),
|
|
15
|
+
callouth: glyph('<path d="M4 4h12v9H9l-4 3v-3H4Z"/>'),
|
|
16
|
+
schemath: glyph('<ellipse cx="10" cy="5" rx="6" ry="2.5"/><path d="M4 5v10c0 1.4 2.7 2.5 6 2.5s6-1.1 6-2.5V5M4 10c0 1.4 2.7 2.5 6 2.5s6-1.1 6-2.5"/>'),
|
|
17
|
+
graphth: glyph('<circle cx="5" cy="10" r="2"/><circle cx="15" cy="5" r="2"/><circle cx="15" cy="15" r="2"/><path d="m6.8 9.1 6.4-3.2M6.8 10.9l6.4 3.2"/>'),
|
|
18
|
+
termth: glyph('<path d="M5 3h10v14H5Z"/><path d="m8 12 2-5 2 5M8.7 10.5h2.6"/>'),
|
|
19
|
+
};
|
|
20
|
+
export const libraryIcon = (view) => Object.hasOwn(LIBRARY_ICONS, view) ? LIBRARY_ICONS[view] : undefined;
|
|
@@ -6,6 +6,8 @@ export type DocRef = Pick<CompiledDoc, "id" | "parent"> & {
|
|
|
6
6
|
};
|
|
7
7
|
/** Parse `<docId>` (leading/trailing `/` are ignored). undefined if the shape differs. */
|
|
8
8
|
export declare const parseRoutePath: (path: string) => string | undefined;
|
|
9
|
+
/** Authored links navigate to references; they cannot execute code or launch other protocols. */
|
|
10
|
+
export declare const isReferenceUrl: (url: string) => boolean;
|
|
9
11
|
/** Document links use paths relative to the docs root and optional heading fragments. */
|
|
10
12
|
export declare const parseDocLink: (url: string) => {
|
|
11
13
|
file: string;
|
|
@@ -13,6 +13,15 @@ export const parseRoutePath = (path) => {
|
|
|
13
13
|
const [id] = seg;
|
|
14
14
|
return id != null && seg.length === 1 && isDocId(id) ? id : undefined;
|
|
15
15
|
};
|
|
16
|
+
/** Authored links navigate to references; they cannot execute code or launch other protocols. */
|
|
17
|
+
export const isReferenceUrl = (url) => {
|
|
18
|
+
try {
|
|
19
|
+
return ["http:", "https:", "mailto:"].includes(new URL(url, "https://dooc.invalid/").protocol);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
16
25
|
/** Document links use paths relative to the docs root and optional heading fragments. */
|
|
17
26
|
export const parseDocLink = (url) => {
|
|
18
27
|
if (/^(?:[a-z][a-z\d+.-]*:|\/)/i.test(url))
|
|
@@ -5,4 +5,4 @@ export interface SchemaContext {
|
|
|
5
5
|
}
|
|
6
6
|
/** Visit schema positions only; defaults, examples and enum values are data. */
|
|
7
7
|
export declare const visitSchema: (schema: unknown, base: string, visit: (schema: SchemaObject, base: string) => void) => void;
|
|
8
|
-
export declare const schemaResolver: (schema: SchemaObject, context?: SchemaContext) => (definition: unknown) => SchemaObject;
|
|
8
|
+
export declare const schemaResolver: (schema: SchemaObject, context?: SchemaContext) => (definition: unknown, onRef?: (uri: string) => void) => SchemaObject;
|
|
@@ -49,13 +49,15 @@ export const schemaResolver = (schema, context) => {
|
|
|
49
49
|
resources.set(`${resolved.split("#")[0]}#${node[key]}`, node);
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
/** `onRef` receives the absolute URI of every `$ref` hop followed. */
|
|
53
|
+
return (definition, onRef) => {
|
|
53
54
|
let current = schemaObject(definition) ? definition : {};
|
|
54
55
|
let result = current;
|
|
55
56
|
const seen = new Set();
|
|
56
57
|
while (typeof current.$ref === "string" && !seen.has(current)) {
|
|
57
58
|
seen.add(current);
|
|
58
59
|
const uri = new URL(current.$ref, bases.get(current) ?? base);
|
|
60
|
+
onRef?.(uri.href);
|
|
59
61
|
let target = resources.get(uri.href);
|
|
60
62
|
if (target === undefined) {
|
|
61
63
|
const fragment = decodeURIComponent(uri.hash.slice(1));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { visit } from "unist-util-visit";
|
|
2
|
+
import { localFile } from "./files.js";
|
|
3
|
+
import { parseMdast } from "./markdown.js";
|
|
4
|
+
import { parseFileReference } from "./textfile.js";
|
|
5
|
+
export const subformatReferences = (tree) => {
|
|
6
|
+
const references = [];
|
|
7
|
+
const definitions = new Map();
|
|
8
|
+
visit(tree, "definition", (node) => {
|
|
9
|
+
definitions.set(node.identifier, node.url);
|
|
10
|
+
});
|
|
11
|
+
visit(tree, (node) => {
|
|
12
|
+
if (node.type === "code" && node.lang?.toLowerCase() === "callouth") {
|
|
13
|
+
for (const ref of subformatReferences(parseMdast(node.value)))
|
|
14
|
+
references.push({ ...ref, line: ref.line + (node.position?.start.line ?? 1) });
|
|
15
|
+
}
|
|
16
|
+
const target = node.type === "link" || node.type === "image"
|
|
17
|
+
? node.url
|
|
18
|
+
: node.type === "linkReference" || node.type === "imageReference"
|
|
19
|
+
? definitions.get(node.identifier)
|
|
20
|
+
: undefined;
|
|
21
|
+
if (!target || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(target))
|
|
22
|
+
return;
|
|
23
|
+
try {
|
|
24
|
+
const file = parseFileReference(target).file.replace(/^(\.\/)+/, "");
|
|
25
|
+
if (localFile(file))
|
|
26
|
+
references.push({ file, line: node.position?.start.line ?? 1 });
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// Invalid references are reported by the compiler.
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return references;
|
|
33
|
+
};
|
|
@@ -4,6 +4,8 @@ export interface Subformat {
|
|
|
4
4
|
ext: string;
|
|
5
5
|
format: "yaml" | "json" | "toml";
|
|
6
6
|
schema: string;
|
|
7
|
+
/** Local SVG file shown wherever the subformat is listed. */
|
|
8
|
+
icon?: string;
|
|
7
9
|
layouts?: {
|
|
8
10
|
card_title?: string;
|
|
9
11
|
group_by?: string;
|
|
@@ -18,6 +20,8 @@ export interface SubformatField {
|
|
|
18
20
|
enum?: (string | number | boolean | null)[];
|
|
19
21
|
format?: "date" | "date-time";
|
|
20
22
|
readOnly?: boolean;
|
|
23
|
+
/** Record files a reference field may point to (its pattern ends with `\\.<ext>$`). */
|
|
24
|
+
options?: string[];
|
|
21
25
|
}
|
|
22
26
|
export interface SubformatRecord {
|
|
23
27
|
file: string;
|
|
@@ -27,11 +31,14 @@ export interface SubformatRecord {
|
|
|
27
31
|
references?: {
|
|
28
32
|
file: string;
|
|
29
33
|
line: number;
|
|
34
|
+
href?: string;
|
|
30
35
|
}[];
|
|
31
36
|
}
|
|
32
37
|
export interface SubformatCollection extends Subformat {
|
|
33
38
|
change?: "added" | "modified";
|
|
34
39
|
baseLayouts?: NonNullable<Subformat["layouts"]>;
|
|
40
|
+
/** Markup of `icon`, normalized to a square. */
|
|
41
|
+
iconSvg?: string;
|
|
35
42
|
fields: SubformatField[];
|
|
36
43
|
template?: string;
|
|
37
44
|
defaultFolder?: string;
|
|
@@ -21,7 +21,7 @@ export const parseSubformats = (input) => {
|
|
|
21
21
|
if (!value ||
|
|
22
22
|
typeof value !== "object" ||
|
|
23
23
|
Array.isArray(value) ||
|
|
24
|
-
Object.keys(value).some((key) => !["ext", "format", "schema", "layouts"].includes(key)) ||
|
|
24
|
+
Object.keys(value).some((key) => !["ext", "format", "schema", "icon", "layouts"].includes(key)) ||
|
|
25
25
|
typeof value.ext !== "string" ||
|
|
26
26
|
!/^[a-z0-9][a-z0-9_-]*$/.test(value.ext) ||
|
|
27
27
|
!["yaml", "json", "toml"].includes(value.format) ||
|
|
@@ -36,6 +36,9 @@ export const parseSubformats = (input) => {
|
|
|
36
36
|
: !["card_title", "group_by", "sort_by"].includes(key) ||
|
|
37
37
|
typeof item !== "string")))
|
|
38
38
|
throw new Error("Subformat layouts accept card_title, group_by, sort_by field names and sort_order (asc or desc)");
|
|
39
|
+
if (value.icon !== undefined &&
|
|
40
|
+
(!localFile(value.icon) || !value.icon.toLowerCase().endsWith(".svg")))
|
|
41
|
+
throw new Error("Subformat icon must be a local .svg file path");
|
|
39
42
|
if (seen.has(value.ext))
|
|
40
43
|
throw new Error(`Duplicate subformat extension: ${value.ext}`);
|
|
41
44
|
seen.add(value.ext);
|
|
@@ -43,6 +46,7 @@ export const parseSubformats = (input) => {
|
|
|
43
46
|
ext: value.ext,
|
|
44
47
|
format: value.format,
|
|
45
48
|
schema: value.schema,
|
|
49
|
+
...(value.icon === undefined ? {} : { icon: value.icon }),
|
|
46
50
|
...(value.layouts === undefined ? {} : { layouts: { ...value.layouts } }),
|
|
47
51
|
};
|
|
48
52
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export declare const CODE_TEMPLATES: Readonly<Record<string, string>>;
|
|
2
2
|
export declare const CODE_LANGS: readonly ["javascript", "typescript", "jsx", "tsx", "python", "java", "c", "cpp", "csharp", "go", "rust", "ruby", "php", "swift", "kotlin", "bash", "powershell", "html", "css", "json", "yaml", "toml", "sql", "markdown", "dockerfile", "diff", "graphql", "terraform", ...string[]];
|
|
3
3
|
export type CodeLang = string;
|
|
4
|
-
|
|
5
|
-
export declare const FM_OPTIONAL: readonly ["lang"];
|
|
4
|
+
/** Document metadata; the title comes from the manifest, never from the Markdown file. */
|
|
6
5
|
export interface Frontmatter {
|
|
7
6
|
title: string;
|
|
8
7
|
/** BCP 47 tag of the doc's language (language.ts). Omitted = the site default. */
|
|
9
8
|
lang?: string;
|
|
10
9
|
}
|
|
11
|
-
/** Display name of a doc (nav / headings / listings).
|
|
10
|
+
/** Display name of a doc (nav / headings / listings). */
|
|
12
11
|
export declare const docDisplayName: (fm: Frontmatter | undefined, fallback: string) => string;
|
|
@@ -41,9 +41,5 @@ export const CODE_LANGS = [
|
|
|
41
41
|
"terraform",
|
|
42
42
|
...Object.keys(CODE_TEMPLATES),
|
|
43
43
|
];
|
|
44
|
-
|
|
45
|
-
// front-matter; writing it there is an unknown-key error).
|
|
46
|
-
export const FM_REQUIRED = ["title"];
|
|
47
|
-
export const FM_OPTIONAL = ["lang"];
|
|
48
|
-
/** Display name of a doc (nav / headings / listings). Falls back if front-matter is broken. */
|
|
44
|
+
/** Display name of a doc (nav / headings / listings). */
|
|
49
45
|
export const docDisplayName = (fm, fallback) => fm?.title ?? fallback;
|