@mdfriday/foundry 0.1.0
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/LICENSE +15 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/application/ssg.d.ts +9 -0
- package/dist/internal/application/ssg.d.ts.map +1 -0
- package/dist/internal/application/ssg.js +476 -0
- package/dist/internal/application/ssg.js.map +1 -0
- package/dist/internal/application/test-ssg.d.ts +8 -0
- package/dist/internal/application/test-ssg.d.ts.map +1 -0
- package/dist/internal/application/test-ssg.js +27 -0
- package/dist/internal/application/test-ssg.js.map +1 -0
- package/dist/internal/domain/config/entity/config.d.ts +64 -0
- package/dist/internal/domain/config/entity/config.d.ts.map +1 -0
- package/dist/internal/domain/config/entity/config.js +94 -0
- package/dist/internal/domain/config/entity/config.js.map +1 -0
- package/dist/internal/domain/config/entity/dir.d.ts +13 -0
- package/dist/internal/domain/config/entity/dir.d.ts.map +1 -0
- package/dist/internal/domain/config/entity/dir.js +33 -0
- package/dist/internal/domain/config/entity/dir.js.map +1 -0
- package/dist/internal/domain/config/entity/language.d.ts +71 -0
- package/dist/internal/domain/config/entity/language.d.ts.map +1 -0
- package/dist/internal/domain/config/entity/language.js +135 -0
- package/dist/internal/domain/config/entity/language.js.map +1 -0
- package/dist/internal/domain/config/entity/module.d.ts +53 -0
- package/dist/internal/domain/config/entity/module.d.ts.map +1 -0
- package/dist/internal/domain/config/entity/module.js +82 -0
- package/dist/internal/domain/config/entity/module.js.map +1 -0
- package/dist/internal/domain/config/entity/root.d.ts +58 -0
- package/dist/internal/domain/config/entity/root.d.ts.map +1 -0
- package/dist/internal/domain/config/entity/root.js +105 -0
- package/dist/internal/domain/config/entity/root.js.map +1 -0
- package/dist/internal/domain/config/entity/service.d.ts +57 -0
- package/dist/internal/domain/config/entity/service.d.ts.map +1 -0
- package/dist/internal/domain/config/entity/service.js +88 -0
- package/dist/internal/domain/config/entity/service.js.map +1 -0
- package/dist/internal/domain/config/entity/taxonomy.d.ts +59 -0
- package/dist/internal/domain/config/entity/taxonomy.d.ts.map +1 -0
- package/dist/internal/domain/config/entity/taxonomy.js +101 -0
- package/dist/internal/domain/config/entity/taxonomy.js.map +1 -0
- package/dist/internal/domain/config/factory/config.d.ts +7 -0
- package/dist/internal/domain/config/factory/config.d.ts.map +1 -0
- package/dist/internal/domain/config/factory/config.js +92 -0
- package/dist/internal/domain/config/factory/config.js.map +1 -0
- package/dist/internal/domain/config/factory/loader.d.ts +45 -0
- package/dist/internal/domain/config/factory/loader.d.ts.map +1 -0
- package/dist/internal/domain/config/factory/loader.js +204 -0
- package/dist/internal/domain/config/factory/loader.js.map +1 -0
- package/dist/internal/domain/config/factory/provider.d.ts +36 -0
- package/dist/internal/domain/config/factory/provider.d.ts.map +1 -0
- package/dist/internal/domain/config/factory/provider.js +206 -0
- package/dist/internal/domain/config/factory/provider.js.map +1 -0
- package/dist/internal/domain/config/factory/sourcedescriptor.d.ts +19 -0
- package/dist/internal/domain/config/factory/sourcedescriptor.d.ts.map +1 -0
- package/dist/internal/domain/config/factory/sourcedescriptor.js +25 -0
- package/dist/internal/domain/config/factory/sourcedescriptor.js.map +1 -0
- package/dist/internal/domain/config/index.d.ts +14 -0
- package/dist/internal/domain/config/index.d.ts.map +1 -0
- package/dist/internal/domain/config/index.js +48 -0
- package/dist/internal/domain/config/index.js.map +1 -0
- package/dist/internal/domain/config/type.d.ts +145 -0
- package/dist/internal/domain/config/type.d.ts.map +1 -0
- package/dist/internal/domain/config/type.js +23 -0
- package/dist/internal/domain/config/type.js.map +1 -0
- package/dist/internal/domain/config/vo/language.d.ts +14 -0
- package/dist/internal/domain/config/vo/language.d.ts.map +1 -0
- package/dist/internal/domain/config/vo/language.js +57 -0
- package/dist/internal/domain/config/vo/language.js.map +1 -0
- package/dist/internal/domain/config/vo/module.d.ts +14 -0
- package/dist/internal/domain/config/vo/module.d.ts.map +1 -0
- package/dist/internal/domain/config/vo/module.js +44 -0
- package/dist/internal/domain/config/vo/module.js.map +1 -0
- package/dist/internal/domain/config/vo/root.d.ts +10 -0
- package/dist/internal/domain/config/vo/root.d.ts.map +1 -0
- package/dist/internal/domain/config/vo/root.js +71 -0
- package/dist/internal/domain/config/vo/root.js.map +1 -0
- package/dist/internal/domain/config/vo/service.d.ts +10 -0
- package/dist/internal/domain/config/vo/service.d.ts.map +1 -0
- package/dist/internal/domain/config/vo/service.js +73 -0
- package/dist/internal/domain/config/vo/service.js.map +1 -0
- package/dist/internal/domain/config/vo/taxonomy.d.ts +18 -0
- package/dist/internal/domain/config/vo/taxonomy.d.ts.map +1 -0
- package/dist/internal/domain/config/vo/taxonomy.js +68 -0
- package/dist/internal/domain/config/vo/taxonomy.js.map +1 -0
- package/dist/internal/domain/content/entity/content.d.ts +47 -0
- package/dist/internal/domain/content/entity/content.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/content.js +281 -0
- package/dist/internal/domain/content/entity/content.js.map +1 -0
- package/dist/internal/domain/content/entity/converter.d.ts +11 -0
- package/dist/internal/domain/content/entity/converter.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/converter.js +22 -0
- package/dist/internal/domain/content/entity/converter.js.map +1 -0
- package/dist/internal/domain/content/entity/index.d.ts +5 -0
- package/dist/internal/domain/content/entity/index.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/index.js +21 -0
- package/dist/internal/domain/content/entity/index.js.map +1 -0
- package/dist/internal/domain/content/entity/page.d.ts +90 -0
- package/dist/internal/domain/content/entity/page.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/page.js +336 -0
- package/dist/internal/domain/content/entity/page.js.map +1 -0
- package/dist/internal/domain/content/entity/pagebuilder.d.ts +145 -0
- package/dist/internal/domain/content/entity/pagebuilder.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/pagebuilder.js +521 -0
- package/dist/internal/domain/content/entity/pagebuilder.js.map +1 -0
- package/dist/internal/domain/content/entity/pagecollector.d.ts +17 -0
- package/dist/internal/domain/content/entity/pagecollector.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/pagecollector.js +108 -0
- package/dist/internal/domain/content/entity/pagecollector.js.map +1 -0
- package/dist/internal/domain/content/entity/pagecontent.d.ts +37 -0
- package/dist/internal/domain/content/entity/pagecontent.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/pagecontent.js +70 -0
- package/dist/internal/domain/content/entity/pagecontent.js.map +1 -0
- package/dist/internal/domain/content/entity/pagelayout.d.ts +11 -0
- package/dist/internal/domain/content/entity/pagelayout.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/pagelayout.js +73 -0
- package/dist/internal/domain/content/entity/pagelayout.js.map +1 -0
- package/dist/internal/domain/content/entity/pagemap.d.ts +143 -0
- package/dist/internal/domain/content/entity/pagemap.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/pagemap.js +497 -0
- package/dist/internal/domain/content/entity/pagemap.js.map +1 -0
- package/dist/internal/domain/content/entity/pagemeta.d.ts +18 -0
- package/dist/internal/domain/content/entity/pagemeta.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/pagemeta.js +50 -0
- package/dist/internal/domain/content/entity/pagemeta.js.map +1 -0
- package/dist/internal/domain/content/entity/pageoutput.d.ts +15 -0
- package/dist/internal/domain/content/entity/pageoutput.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/pageoutput.js +133 -0
- package/dist/internal/domain/content/entity/pageoutput.js.map +1 -0
- package/dist/internal/domain/content/entity/pagesource.d.ts +62 -0
- package/dist/internal/domain/content/entity/pagesource.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/pagesource.js +168 -0
- package/dist/internal/domain/content/entity/pagesource.js.map +1 -0
- package/dist/internal/domain/content/entity/pagetrees.d.ts +70 -0
- package/dist/internal/domain/content/entity/pagetrees.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/pagetrees.js +249 -0
- package/dist/internal/domain/content/entity/pagetrees.js.map +1 -0
- package/dist/internal/domain/content/entity/paginator.d.ts +69 -0
- package/dist/internal/domain/content/entity/paginator.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/paginator.js +245 -0
- package/dist/internal/domain/content/entity/paginator.js.map +1 -0
- package/dist/internal/domain/content/entity/section.d.ts +34 -0
- package/dist/internal/domain/content/entity/section.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/section.js +120 -0
- package/dist/internal/domain/content/entity/section.js.map +1 -0
- package/dist/internal/domain/content/entity/shifter.d.ts +10 -0
- package/dist/internal/domain/content/entity/shifter.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/shifter.js +36 -0
- package/dist/internal/domain/content/entity/shifter.js.map +1 -0
- package/dist/internal/domain/content/entity/shifterpage.d.ts +7 -0
- package/dist/internal/domain/content/entity/shifterpage.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/shifterpage.js +20 -0
- package/dist/internal/domain/content/entity/shifterpage.js.map +1 -0
- package/dist/internal/domain/content/entity/shifterpagesource.d.ts +7 -0
- package/dist/internal/domain/content/entity/shifterpagesource.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/shifterpagesource.js +21 -0
- package/dist/internal/domain/content/entity/shifterpagesource.js.map +1 -0
- package/dist/internal/domain/content/entity/shortcode.d.ts +76 -0
- package/dist/internal/domain/content/entity/shortcode.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/shortcode.js +156 -0
- package/dist/internal/domain/content/entity/shortcode.js.map +1 -0
- package/dist/internal/domain/content/entity/standalone.d.ts +22 -0
- package/dist/internal/domain/content/entity/standalone.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/standalone.js +38 -0
- package/dist/internal/domain/content/entity/standalone.js.map +1 -0
- package/dist/internal/domain/content/entity/taxonomy.d.ts +30 -0
- package/dist/internal/domain/content/entity/taxonomy.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/taxonomy.js +131 -0
- package/dist/internal/domain/content/entity/taxonomy.js.map +1 -0
- package/dist/internal/domain/content/entity/term.d.ts +17 -0
- package/dist/internal/domain/content/entity/term.d.ts.map +1 -0
- package/dist/internal/domain/content/entity/term.js +146 -0
- package/dist/internal/domain/content/entity/term.js.map +1 -0
- package/dist/internal/domain/content/factory/hub.d.ts +3 -0
- package/dist/internal/domain/content/factory/hub.d.ts.map +1 -0
- package/dist/internal/domain/content/factory/hub.js +26 -0
- package/dist/internal/domain/content/factory/hub.js.map +1 -0
- package/dist/internal/domain/content/index.d.ts +18 -0
- package/dist/internal/domain/content/index.d.ts.map +1 -0
- package/dist/internal/domain/content/index.js +37 -0
- package/dist/internal/domain/content/index.js.map +1 -0
- package/dist/internal/domain/content/type.d.ts +237 -0
- package/dist/internal/domain/content/type.d.ts.map +1 -0
- package/dist/internal/domain/content/type.js +16 -0
- package/dist/internal/domain/content/type.js.map +1 -0
- package/dist/internal/domain/content/vo/classifier.d.ts +40 -0
- package/dist/internal/domain/content/vo/classifier.d.ts.map +1 -0
- package/dist/internal/domain/content/vo/classifier.js +109 -0
- package/dist/internal/domain/content/vo/classifier.js.map +1 -0
- package/dist/internal/domain/content/vo/fileinfo.d.ts +46 -0
- package/dist/internal/domain/content/vo/fileinfo.d.ts.map +1 -0
- package/dist/internal/domain/content/vo/fileinfo.js +220 -0
- package/dist/internal/domain/content/vo/fileinfo.js.map +1 -0
- package/dist/internal/domain/content/vo/frontmatter.d.ts +62 -0
- package/dist/internal/domain/content/vo/frontmatter.d.ts.map +1 -0
- package/dist/internal/domain/content/vo/frontmatter.js +224 -0
- package/dist/internal/domain/content/vo/frontmatter.js.map +1 -0
- package/dist/internal/domain/content/vo/identity.d.ts +13 -0
- package/dist/internal/domain/content/vo/identity.d.ts.map +1 -0
- package/dist/internal/domain/content/vo/identity.js +27 -0
- package/dist/internal/domain/content/vo/identity.js.map +1 -0
- package/dist/internal/domain/content/vo/kind.d.ts +14 -0
- package/dist/internal/domain/content/vo/kind.d.ts.map +1 -0
- package/dist/internal/domain/content/vo/kind.js +52 -0
- package/dist/internal/domain/content/vo/kind.js.map +1 -0
- package/dist/internal/domain/content/vo/sort.d.ts +18 -0
- package/dist/internal/domain/content/vo/sort.d.ts.map +1 -0
- package/dist/internal/domain/content/vo/sort.js +147 -0
- package/dist/internal/domain/content/vo/sort.js.map +1 -0
- package/dist/internal/domain/fs/entity/basefs.d.ts +48 -0
- package/dist/internal/domain/fs/entity/basefs.d.ts.map +1 -0
- package/dist/internal/domain/fs/entity/basefs.js +191 -0
- package/dist/internal/domain/fs/entity/basefs.js.map +1 -0
- package/dist/internal/domain/fs/entity/fs.d.ts +49 -0
- package/dist/internal/domain/fs/entity/fs.d.ts.map +1 -0
- package/dist/internal/domain/fs/entity/fs.js +97 -0
- package/dist/internal/domain/fs/entity/fs.js.map +1 -0
- package/dist/internal/domain/fs/entity/originfs.d.ts +17 -0
- package/dist/internal/domain/fs/entity/originfs.d.ts.map +1 -0
- package/dist/internal/domain/fs/entity/originfs.js +27 -0
- package/dist/internal/domain/fs/entity/originfs.js.map +1 -0
- package/dist/internal/domain/fs/entity/overlaydir.d.ts +93 -0
- package/dist/internal/domain/fs/entity/overlaydir.d.ts.map +1 -0
- package/dist/internal/domain/fs/entity/overlaydir.js +249 -0
- package/dist/internal/domain/fs/entity/overlaydir.js.map +1 -0
- package/dist/internal/domain/fs/entity/overlayfs.d.ts +113 -0
- package/dist/internal/domain/fs/entity/overlayfs.d.ts.map +1 -0
- package/dist/internal/domain/fs/entity/overlayfs.js +310 -0
- package/dist/internal/domain/fs/entity/overlayfs.js.map +1 -0
- package/dist/internal/domain/fs/entity/service.d.ts +23 -0
- package/dist/internal/domain/fs/entity/service.d.ts.map +1 -0
- package/dist/internal/domain/fs/entity/service.js +35 -0
- package/dist/internal/domain/fs/entity/service.js.map +1 -0
- package/dist/internal/domain/fs/factory/fs.d.ts +13 -0
- package/dist/internal/domain/fs/factory/fs.d.ts.map +1 -0
- package/dist/internal/domain/fs/factory/fs.js +21 -0
- package/dist/internal/domain/fs/factory/fs.js.map +1 -0
- package/dist/internal/domain/fs/index.d.ts +24 -0
- package/dist/internal/domain/fs/index.d.ts.map +1 -0
- package/dist/internal/domain/fs/index.js +104 -0
- package/dist/internal/domain/fs/index.js.map +1 -0
- package/dist/internal/domain/fs/type.d.ts +219 -0
- package/dist/internal/domain/fs/type.d.ts.map +1 -0
- package/dist/internal/domain/fs/type.js +53 -0
- package/dist/internal/domain/fs/type.js.map +1 -0
- package/dist/internal/domain/fs/vo/dir.d.ts +63 -0
- package/dist/internal/domain/fs/vo/dir.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/dir.js +99 -0
- package/dist/internal/domain/fs/vo/dir.js.map +1 -0
- package/dist/internal/domain/fs/vo/file.d.ts +73 -0
- package/dist/internal/domain/fs/vo/file.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/file.js +197 -0
- package/dist/internal/domain/fs/vo/file.js.map +1 -0
- package/dist/internal/domain/fs/vo/fileinfo.d.ts +48 -0
- package/dist/internal/domain/fs/vo/fileinfo.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/fileinfo.js +108 -0
- package/dist/internal/domain/fs/vo/fileinfo.js.map +1 -0
- package/dist/internal/domain/fs/vo/filemeta.d.ts +73 -0
- package/dist/internal/domain/fs/vo/filemeta.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/filemeta.js +124 -0
- package/dist/internal/domain/fs/vo/filemeta.js.map +1 -0
- package/dist/internal/domain/fs/vo/filesystemscollector.d.ts +47 -0
- package/dist/internal/domain/fs/vo/filesystemscollector.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/filesystemscollector.js +169 -0
- package/dist/internal/domain/fs/vo/filesystemscollector.js.map +1 -0
- package/dist/internal/domain/fs/vo/filevitural.d.ts +12 -0
- package/dist/internal/domain/fs/vo/filevitural.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/filevitural.js +137 -0
- package/dist/internal/domain/fs/vo/filevitural.js.map +1 -0
- package/dist/internal/domain/fs/vo/osfs.d.ts +78 -0
- package/dist/internal/domain/fs/vo/osfs.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/osfs.js +296 -0
- package/dist/internal/domain/fs/vo/osfs.js.map +1 -0
- package/dist/internal/domain/fs/vo/overlay-factory.d.ts +13 -0
- package/dist/internal/domain/fs/vo/overlay-factory.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/overlay-factory.js +60 -0
- package/dist/internal/domain/fs/vo/overlay-factory.js.map +1 -0
- package/dist/internal/domain/fs/vo/overlayfs-factory.d.ts +72 -0
- package/dist/internal/domain/fs/vo/overlayfs-factory.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/overlayfs-factory.js +125 -0
- package/dist/internal/domain/fs/vo/overlayfs-factory.js.map +1 -0
- package/dist/internal/domain/fs/vo/overlayoptions.d.ts +69 -0
- package/dist/internal/domain/fs/vo/overlayoptions.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/overlayoptions.js +138 -0
- package/dist/internal/domain/fs/vo/overlayoptions.js.map +1 -0
- package/dist/internal/domain/fs/vo/static-copier.d.ts +37 -0
- package/dist/internal/domain/fs/vo/static-copier.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/static-copier.js +179 -0
- package/dist/internal/domain/fs/vo/static-copier.js.map +1 -0
- package/dist/internal/domain/fs/vo/walkway.d.ts +38 -0
- package/dist/internal/domain/fs/vo/walkway.d.ts.map +1 -0
- package/dist/internal/domain/fs/vo/walkway.js +219 -0
- package/dist/internal/domain/fs/vo/walkway.js.map +1 -0
- package/dist/internal/domain/markdown/entity/markdown.d.ts +79 -0
- package/dist/internal/domain/markdown/entity/markdown.d.ts.map +1 -0
- package/dist/internal/domain/markdown/entity/markdown.js +385 -0
- package/dist/internal/domain/markdown/entity/markdown.js.map +1 -0
- package/dist/internal/domain/markdown/examples/obsidian-example.d.ts +79 -0
- package/dist/internal/domain/markdown/examples/obsidian-example.d.ts.map +1 -0
- package/dist/internal/domain/markdown/examples/obsidian-example.js +302 -0
- package/dist/internal/domain/markdown/examples/obsidian-example.js.map +1 -0
- package/dist/internal/domain/markdown/examples/shortcode.d.ts +43 -0
- package/dist/internal/domain/markdown/examples/shortcode.d.ts.map +1 -0
- package/dist/internal/domain/markdown/examples/shortcode.js +99 -0
- package/dist/internal/domain/markdown/examples/shortcode.js.map +1 -0
- package/dist/internal/domain/markdown/factory/markdown.d.ts +39 -0
- package/dist/internal/domain/markdown/factory/markdown.d.ts.map +1 -0
- package/dist/internal/domain/markdown/factory/markdown.js +78 -0
- package/dist/internal/domain/markdown/factory/markdown.js.map +1 -0
- package/dist/internal/domain/markdown/index.d.ts +15 -0
- package/dist/internal/domain/markdown/index.d.ts.map +1 -0
- package/dist/internal/domain/markdown/index.js +38 -0
- package/dist/internal/domain/markdown/index.js.map +1 -0
- package/dist/internal/domain/markdown/test/external-adapter.test.d.ts +2 -0
- package/dist/internal/domain/markdown/test/external-adapter.test.d.ts.map +1 -0
- package/dist/internal/domain/markdown/test/external-adapter.test.js +150 -0
- package/dist/internal/domain/markdown/test/external-adapter.test.js.map +1 -0
- package/dist/internal/domain/markdown/test/markdown.test.d.ts +2 -0
- package/dist/internal/domain/markdown/test/markdown.test.d.ts.map +1 -0
- package/dist/internal/domain/markdown/test/markdown.test.js +88 -0
- package/dist/internal/domain/markdown/test/markdown.test.js.map +1 -0
- package/dist/internal/domain/markdown/type.d.ts +363 -0
- package/dist/internal/domain/markdown/type.d.ts.map +1 -0
- package/dist/internal/domain/markdown/type.js +19 -0
- package/dist/internal/domain/markdown/type.js.map +1 -0
- package/dist/internal/domain/markdown/vo/config.d.ts +139 -0
- package/dist/internal/domain/markdown/vo/config.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/config.js +89 -0
- package/dist/internal/domain/markdown/vo/config.js.map +1 -0
- package/dist/internal/domain/markdown/vo/content.d.ts +149 -0
- package/dist/internal/domain/markdown/vo/content.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/content.js +370 -0
- package/dist/internal/domain/markdown/vo/content.js.map +1 -0
- package/dist/internal/domain/markdown/vo/context.d.ts +45 -0
- package/dist/internal/domain/markdown/vo/context.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/context.js +112 -0
- package/dist/internal/domain/markdown/vo/context.js.map +1 -0
- package/dist/internal/domain/markdown/vo/externaladapter.d.ts +63 -0
- package/dist/internal/domain/markdown/vo/externaladapter.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/externaladapter.js +194 -0
- package/dist/internal/domain/markdown/vo/externaladapter.js.map +1 -0
- package/dist/internal/domain/markdown/vo/highlight.d.ts +46 -0
- package/dist/internal/domain/markdown/vo/highlight.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/highlight.js +159 -0
- package/dist/internal/domain/markdown/vo/highlight.js.map +1 -0
- package/dist/internal/domain/markdown/vo/markdownit.d.ts +33 -0
- package/dist/internal/domain/markdown/vo/markdownit.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/markdownit.js +175 -0
- package/dist/internal/domain/markdown/vo/markdownit.js.map +1 -0
- package/dist/internal/domain/markdown/vo/pageparser.d.ts +20 -0
- package/dist/internal/domain/markdown/vo/pageparser.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/pageparser.js +87 -0
- package/dist/internal/domain/markdown/vo/pageparser.js.map +1 -0
- package/dist/internal/domain/markdown/vo/parseinfo.d.ts +63 -0
- package/dist/internal/domain/markdown/vo/parseinfo.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/parseinfo.js +132 -0
- package/dist/internal/domain/markdown/vo/parseinfo.js.map +1 -0
- package/dist/internal/domain/markdown/vo/parserresult.d.ts +82 -0
- package/dist/internal/domain/markdown/vo/parserresult.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/parserresult.js +214 -0
- package/dist/internal/domain/markdown/vo/parserresult.js.map +1 -0
- package/dist/internal/domain/markdown/vo/shortcode.d.ts +68 -0
- package/dist/internal/domain/markdown/vo/shortcode.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/shortcode.js +298 -0
- package/dist/internal/domain/markdown/vo/shortcode.js.map +1 -0
- package/dist/internal/domain/markdown/vo/tableofcontents.d.ts +82 -0
- package/dist/internal/domain/markdown/vo/tableofcontents.d.ts.map +1 -0
- package/dist/internal/domain/markdown/vo/tableofcontents.js +234 -0
- package/dist/internal/domain/markdown/vo/tableofcontents.js.map +1 -0
- package/dist/internal/domain/module/entity/lang.d.ts +20 -0
- package/dist/internal/domain/module/entity/lang.d.ts.map +1 -0
- package/dist/internal/domain/module/entity/lang.js +38 -0
- package/dist/internal/domain/module/entity/lang.js.map +1 -0
- package/dist/internal/domain/module/entity/module.d.ts +87 -0
- package/dist/internal/domain/module/entity/module.d.ts.map +1 -0
- package/dist/internal/domain/module/entity/module.js +343 -0
- package/dist/internal/domain/module/entity/module.js.map +1 -0
- package/dist/internal/domain/module/factory/module.d.ts +7 -0
- package/dist/internal/domain/module/factory/module.d.ts.map +1 -0
- package/dist/internal/domain/module/factory/module.js +31 -0
- package/dist/internal/domain/module/factory/module.js.map +1 -0
- package/dist/internal/domain/module/index.d.ts +10 -0
- package/dist/internal/domain/module/index.d.ts.map +1 -0
- package/dist/internal/domain/module/index.js +72 -0
- package/dist/internal/domain/module/index.js.map +1 -0
- package/dist/internal/domain/module/type.d.ts +160 -0
- package/dist/internal/domain/module/type.d.ts.map +1 -0
- package/dist/internal/domain/module/type.js +50 -0
- package/dist/internal/domain/module/type.js.map +1 -0
- package/dist/internal/domain/module/vo/cache.d.ts +81 -0
- package/dist/internal/domain/module/vo/cache.d.ts.map +1 -0
- package/dist/internal/domain/module/vo/cache.js +282 -0
- package/dist/internal/domain/module/vo/cache.js.map +1 -0
- package/dist/internal/domain/module/vo/httpclient.d.ts +101 -0
- package/dist/internal/domain/module/vo/httpclient.d.ts.map +1 -0
- package/dist/internal/domain/module/vo/httpclient.js +442 -0
- package/dist/internal/domain/module/vo/httpclient.js.map +1 -0
- package/dist/internal/domain/module/vo/module.d.ts +129 -0
- package/dist/internal/domain/module/vo/module.d.ts.map +1 -0
- package/dist/internal/domain/module/vo/module.js +271 -0
- package/dist/internal/domain/module/vo/module.js.map +1 -0
- package/dist/internal/domain/module/vo/mount.d.ts +59 -0
- package/dist/internal/domain/module/vo/mount.d.ts.map +1 -0
- package/dist/internal/domain/module/vo/mount.js +134 -0
- package/dist/internal/domain/module/vo/mount.js.map +1 -0
- package/dist/internal/domain/module/vo/zipextractor.d.ts +57 -0
- package/dist/internal/domain/module/vo/zipextractor.d.ts.map +1 -0
- package/dist/internal/domain/module/vo/zipextractor.js +267 -0
- package/dist/internal/domain/module/vo/zipextractor.js.map +1 -0
- package/dist/internal/domain/paths/entity/path.d.ts +86 -0
- package/dist/internal/domain/paths/entity/path.d.ts.map +1 -0
- package/dist/internal/domain/paths/entity/path.js +450 -0
- package/dist/internal/domain/paths/entity/path.js.map +1 -0
- package/dist/internal/domain/paths/factory/pathfactory.d.ts +140 -0
- package/dist/internal/domain/paths/factory/pathfactory.d.ts.map +1 -0
- package/dist/internal/domain/paths/factory/pathfactory.js +246 -0
- package/dist/internal/domain/paths/factory/pathfactory.js.map +1 -0
- package/dist/internal/domain/paths/index.d.ts +44 -0
- package/dist/internal/domain/paths/index.d.ts.map +1 -0
- package/dist/internal/domain/paths/index.js +94 -0
- package/dist/internal/domain/paths/index.js.map +1 -0
- package/dist/internal/domain/paths/test/factory.test.d.ts +2 -0
- package/dist/internal/domain/paths/test/factory.test.d.ts.map +1 -0
- package/dist/internal/domain/paths/test/factory.test.js +352 -0
- package/dist/internal/domain/paths/test/factory.test.js.map +1 -0
- package/dist/internal/domain/paths/test/integration.test.d.ts +2 -0
- package/dist/internal/domain/paths/test/integration.test.d.ts.map +1 -0
- package/dist/internal/domain/paths/test/integration.test.js +328 -0
- package/dist/internal/domain/paths/test/integration.test.js.map +1 -0
- package/dist/internal/domain/paths/test/pathoperations.test.d.ts +2 -0
- package/dist/internal/domain/paths/test/pathoperations.test.d.ts.map +1 -0
- package/dist/internal/domain/paths/test/pathoperations.test.js +413 -0
- package/dist/internal/domain/paths/test/pathoperations.test.js.map +1 -0
- package/dist/internal/domain/paths/test/pathparser.test.d.ts +2 -0
- package/dist/internal/domain/paths/test/pathparser.test.d.ts.map +1 -0
- package/dist/internal/domain/paths/test/pathparser.test.js +403 -0
- package/dist/internal/domain/paths/test/pathparser.test.js.map +1 -0
- package/dist/internal/domain/paths/type.d.ts +284 -0
- package/dist/internal/domain/paths/type.d.ts.map +1 -0
- package/dist/internal/domain/paths/type.js +65 -0
- package/dist/internal/domain/paths/type.js.map +1 -0
- package/dist/internal/domain/paths/vo/pathcomponents.d.ts +148 -0
- package/dist/internal/domain/paths/vo/pathcomponents.d.ts.map +1 -0
- package/dist/internal/domain/paths/vo/pathcomponents.js +223 -0
- package/dist/internal/domain/paths/vo/pathcomponents.js.map +1 -0
- package/dist/internal/domain/paths/vo/pathparser.d.ts +130 -0
- package/dist/internal/domain/paths/vo/pathparser.d.ts.map +1 -0
- package/dist/internal/domain/paths/vo/pathparser.js +354 -0
- package/dist/internal/domain/paths/vo/pathparser.js.map +1 -0
- package/dist/internal/domain/prompt/entity/collector.d.ts +88 -0
- package/dist/internal/domain/prompt/entity/collector.d.ts.map +1 -0
- package/dist/internal/domain/prompt/entity/collector.js +255 -0
- package/dist/internal/domain/prompt/entity/collector.js.map +1 -0
- package/dist/internal/domain/prompt/entity/finder.d.ts +88 -0
- package/dist/internal/domain/prompt/entity/finder.d.ts.map +1 -0
- package/dist/internal/domain/prompt/entity/finder.js +293 -0
- package/dist/internal/domain/prompt/entity/finder.js.map +1 -0
- package/dist/internal/domain/prompt/entity/hub.d.ts +112 -0
- package/dist/internal/domain/prompt/entity/hub.d.ts.map +1 -0
- package/dist/internal/domain/prompt/entity/hub.js +259 -0
- package/dist/internal/domain/prompt/entity/hub.js.map +1 -0
- package/dist/internal/domain/prompt/entity/prompt.d.ts +133 -0
- package/dist/internal/domain/prompt/entity/prompt.d.ts.map +1 -0
- package/dist/internal/domain/prompt/entity/prompt.js +237 -0
- package/dist/internal/domain/prompt/entity/prompt.js.map +1 -0
- package/dist/internal/domain/prompt/factory/prompt.d.ts +55 -0
- package/dist/internal/domain/prompt/factory/prompt.d.ts.map +1 -0
- package/dist/internal/domain/prompt/factory/prompt.js +212 -0
- package/dist/internal/domain/prompt/factory/prompt.js.map +1 -0
- package/dist/internal/domain/prompt/index.d.ts +10 -0
- package/dist/internal/domain/prompt/index.d.ts.map +1 -0
- package/dist/internal/domain/prompt/index.js +72 -0
- package/dist/internal/domain/prompt/index.js.map +1 -0
- package/dist/internal/domain/prompt/type.d.ts +180 -0
- package/dist/internal/domain/prompt/type.d.ts.map +1 -0
- package/dist/internal/domain/prompt/type.js +23 -0
- package/dist/internal/domain/prompt/type.js.map +1 -0
- package/dist/internal/domain/prompt/vo/file.d.ts +103 -0
- package/dist/internal/domain/prompt/vo/file.d.ts.map +1 -0
- package/dist/internal/domain/prompt/vo/file.js +265 -0
- package/dist/internal/domain/prompt/vo/file.js.map +1 -0
- package/dist/internal/domain/prompt/vo/rule.d.ts +139 -0
- package/dist/internal/domain/prompt/vo/rule.d.ts.map +1 -0
- package/dist/internal/domain/prompt/vo/rule.js +268 -0
- package/dist/internal/domain/prompt/vo/rule.js.map +1 -0
- package/dist/internal/domain/resources/entity/integrity.d.ts +13 -0
- package/dist/internal/domain/resources/entity/integrity.d.ts.map +1 -0
- package/dist/internal/domain/resources/entity/integrity.js +113 -0
- package/dist/internal/domain/resources/entity/integrity.js.map +1 -0
- package/dist/internal/domain/resources/entity/minifier.d.ts +20 -0
- package/dist/internal/domain/resources/entity/minifier.d.ts.map +1 -0
- package/dist/internal/domain/resources/entity/minifier.js +118 -0
- package/dist/internal/domain/resources/entity/minifier.js.map +1 -0
- package/dist/internal/domain/resources/entity/publisher.d.ts +44 -0
- package/dist/internal/domain/resources/entity/publisher.d.ts.map +1 -0
- package/dist/internal/domain/resources/entity/publisher.js +159 -0
- package/dist/internal/domain/resources/entity/publisher.js.map +1 -0
- package/dist/internal/domain/resources/entity/resource.d.ts +62 -0
- package/dist/internal/domain/resources/entity/resource.d.ts.map +1 -0
- package/dist/internal/domain/resources/entity/resource.js +362 -0
- package/dist/internal/domain/resources/entity/resource.js.map +1 -0
- package/dist/internal/domain/resources/entity/resources.d.ts +64 -0
- package/dist/internal/domain/resources/entity/resources.d.ts.map +1 -0
- package/dist/internal/domain/resources/entity/resources.js +344 -0
- package/dist/internal/domain/resources/entity/resources.js.map +1 -0
- package/dist/internal/domain/resources/entity/template.d.ts +11 -0
- package/dist/internal/domain/resources/entity/template.d.ts.map +1 -0
- package/dist/internal/domain/resources/entity/template.js +135 -0
- package/dist/internal/domain/resources/entity/template.js.map +1 -0
- package/dist/internal/domain/resources/factory/resource.d.ts +8 -0
- package/dist/internal/domain/resources/factory/resource.d.ts.map +1 -0
- package/dist/internal/domain/resources/factory/resource.js +12 -0
- package/dist/internal/domain/resources/factory/resource.js.map +1 -0
- package/dist/internal/domain/resources/index.d.ts +11 -0
- package/dist/internal/domain/resources/index.d.ts.map +1 -0
- package/dist/internal/domain/resources/index.js +42 -0
- package/dist/internal/domain/resources/index.js.map +1 -0
- package/dist/internal/domain/resources/type.d.ts +84 -0
- package/dist/internal/domain/resources/type.d.ts.map +1 -0
- package/dist/internal/domain/resources/type.js +3 -0
- package/dist/internal/domain/resources/type.js.map +1 -0
- package/dist/internal/domain/resources/valueobject/resourcemetadata.d.ts +14 -0
- package/dist/internal/domain/resources/valueobject/resourcemetadata.d.ts.map +1 -0
- package/dist/internal/domain/resources/valueobject/resourcemetadata.js +23 -0
- package/dist/internal/domain/resources/valueobject/resourcemetadata.js.map +1 -0
- package/dist/internal/domain/resources/valueobject/resourcepaths.d.ts +21 -0
- package/dist/internal/domain/resources/valueobject/resourcepaths.d.ts.map +1 -0
- package/dist/internal/domain/resources/valueobject/resourcepaths.js +136 -0
- package/dist/internal/domain/resources/valueobject/resourcepaths.js.map +1 -0
- package/dist/internal/domain/resources/valueobject/resourcepaths.test.d.ts +2 -0
- package/dist/internal/domain/resources/valueobject/resourcepaths.test.d.ts.map +1 -0
- package/dist/internal/domain/resources/valueobject/resourcepaths.test.js +53 -0
- package/dist/internal/domain/resources/valueobject/resourcepaths.test.js.map +1 -0
- package/dist/internal/domain/resources/valueobject/transformation.d.ts +11 -0
- package/dist/internal/domain/resources/valueobject/transformation.d.ts.map +1 -0
- package/dist/internal/domain/resources/valueobject/transformation.js +41 -0
- package/dist/internal/domain/resources/valueobject/transformation.js.map +1 -0
- package/dist/internal/domain/site/entity/language.d.ts +82 -0
- package/dist/internal/domain/site/entity/language.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/language.js +168 -0
- package/dist/internal/domain/site/entity/language.js.map +1 -0
- package/dist/internal/domain/site/entity/menu-builder.d.ts +52 -0
- package/dist/internal/domain/site/entity/menu-builder.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/menu-builder.js +192 -0
- package/dist/internal/domain/site/entity/menu-builder.js.map +1 -0
- package/dist/internal/domain/site/entity/navigation.d.ts +30 -0
- package/dist/internal/domain/site/entity/navigation.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/navigation.js +94 -0
- package/dist/internal/domain/site/entity/navigation.js.map +1 -0
- package/dist/internal/domain/site/entity/page.d.ts +169 -0
- package/dist/internal/domain/site/entity/page.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/page.js +578 -0
- package/dist/internal/domain/site/entity/page.js.map +1 -0
- package/dist/internal/domain/site/entity/pager.d.ts +36 -0
- package/dist/internal/domain/site/entity/pager.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/pager.js +104 -0
- package/dist/internal/domain/site/entity/pager.js.map +1 -0
- package/dist/internal/domain/site/entity/publisher.d.ts +39 -0
- package/dist/internal/domain/site/entity/publisher.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/publisher.js +138 -0
- package/dist/internal/domain/site/entity/publisher.js.map +1 -0
- package/dist/internal/domain/site/entity/ref.d.ts +41 -0
- package/dist/internal/domain/site/entity/ref.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/ref.js +129 -0
- package/dist/internal/domain/site/entity/ref.js.map +1 -0
- package/dist/internal/domain/site/entity/site.d.ts +173 -0
- package/dist/internal/domain/site/entity/site.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/site.js +405 -0
- package/dist/internal/domain/site/entity/site.js.map +1 -0
- package/dist/internal/domain/site/entity/taxonomies-builder.d.ts +66 -0
- package/dist/internal/domain/site/entity/taxonomies-builder.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/taxonomies-builder.js +243 -0
- package/dist/internal/domain/site/entity/taxonomies-builder.js.map +1 -0
- package/dist/internal/domain/site/entity/url.d.ts +24 -0
- package/dist/internal/domain/site/entity/url.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/url.js +205 -0
- package/dist/internal/domain/site/entity/url.js.map +1 -0
- package/dist/internal/domain/site/entity/url.test.d.ts +2 -0
- package/dist/internal/domain/site/entity/url.test.d.ts.map +1 -0
- package/dist/internal/domain/site/entity/url.test.js +98 -0
- package/dist/internal/domain/site/entity/url.test.js.map +1 -0
- package/dist/internal/domain/site/factory/navigation-factory.d.ts +16 -0
- package/dist/internal/domain/site/factory/navigation-factory.d.ts.map +1 -0
- package/dist/internal/domain/site/factory/navigation-factory.js +45 -0
- package/dist/internal/domain/site/factory/navigation-factory.js.map +1 -0
- package/dist/internal/domain/site/factory/site.d.ts +8 -0
- package/dist/internal/domain/site/factory/site.d.ts.map +1 -0
- package/dist/internal/domain/site/factory/site.js +59 -0
- package/dist/internal/domain/site/factory/site.js.map +1 -0
- package/dist/internal/domain/site/type.d.ts +248 -0
- package/dist/internal/domain/site/type.d.ts.map +1 -0
- package/dist/internal/domain/site/type.js +3 -0
- package/dist/internal/domain/site/type.js.map +1 -0
- package/dist/internal/domain/site/valueobject/author.d.ts +23 -0
- package/dist/internal/domain/site/valueobject/author.d.ts.map +1 -0
- package/dist/internal/domain/site/valueobject/author.js +35 -0
- package/dist/internal/domain/site/valueobject/author.js.map +1 -0
- package/dist/internal/domain/site/valueobject/baseurl.d.ts +64 -0
- package/dist/internal/domain/site/valueobject/baseurl.d.ts.map +1 -0
- package/dist/internal/domain/site/valueobject/baseurl.js +200 -0
- package/dist/internal/domain/site/valueobject/baseurl.js.map +1 -0
- package/dist/internal/domain/site/valueobject/baseurl.test.d.ts +2 -0
- package/dist/internal/domain/site/valueobject/baseurl.test.d.ts.map +1 -0
- package/dist/internal/domain/site/valueobject/baseurl.test.js +138 -0
- package/dist/internal/domain/site/valueobject/baseurl.test.js.map +1 -0
- package/dist/internal/domain/site/valueobject/menu.d.ts +179 -0
- package/dist/internal/domain/site/valueobject/menu.d.ts.map +1 -0
- package/dist/internal/domain/site/valueobject/menu.js +319 -0
- package/dist/internal/domain/site/valueobject/menu.js.map +1 -0
- package/dist/internal/domain/site/valueobject/version.d.ts +22 -0
- package/dist/internal/domain/site/valueobject/version.d.ts.map +1 -0
- package/dist/internal/domain/site/valueobject/version.js +34 -0
- package/dist/internal/domain/site/valueobject/version.js.map +1 -0
- package/dist/internal/domain/template/entity/executor.d.ts +48 -0
- package/dist/internal/domain/template/entity/executor.d.ts.map +1 -0
- package/dist/internal/domain/template/entity/executor.js +147 -0
- package/dist/internal/domain/template/entity/executor.js.map +1 -0
- package/dist/internal/domain/template/entity/lookup.d.ts +85 -0
- package/dist/internal/domain/template/entity/lookup.d.ts.map +1 -0
- package/dist/internal/domain/template/entity/lookup.js +192 -0
- package/dist/internal/domain/template/entity/lookup.js.map +1 -0
- package/dist/internal/domain/template/entity/parser.d.ts +54 -0
- package/dist/internal/domain/template/entity/parser.d.ts.map +1 -0
- package/dist/internal/domain/template/entity/parser.js +314 -0
- package/dist/internal/domain/template/entity/parser.js.map +1 -0
- package/dist/internal/domain/template/entity/template.d.ts +137 -0
- package/dist/internal/domain/template/entity/template.d.ts.map +1 -0
- package/dist/internal/domain/template/entity/template.js +394 -0
- package/dist/internal/domain/template/entity/template.js.map +1 -0
- package/dist/internal/domain/template/factory/template.d.ts +93 -0
- package/dist/internal/domain/template/factory/template.d.ts.map +1 -0
- package/dist/internal/domain/template/factory/template.js +206 -0
- package/dist/internal/domain/template/factory/template.js.map +1 -0
- package/dist/internal/domain/template/index.d.ts +11 -0
- package/dist/internal/domain/template/index.d.ts.map +1 -0
- package/dist/internal/domain/template/index.js +74 -0
- package/dist/internal/domain/template/index.js.map +1 -0
- package/dist/internal/domain/template/type.d.ts +281 -0
- package/dist/internal/domain/template/type.d.ts.map +1 -0
- package/dist/internal/domain/template/type.js +34 -0
- package/dist/internal/domain/template/type.js.map +1 -0
- package/dist/internal/domain/template/vo/baseof.d.ts +70 -0
- package/dist/internal/domain/template/vo/baseof.d.ts.map +1 -0
- package/dist/internal/domain/template/vo/baseof.js +184 -0
- package/dist/internal/domain/template/vo/baseof.js.map +1 -0
- package/dist/internal/domain/template/vo/info.d.ts +58 -0
- package/dist/internal/domain/template/vo/info.d.ts.map +1 -0
- package/dist/internal/domain/template/vo/info.js +149 -0
- package/dist/internal/domain/template/vo/info.js.map +1 -0
- package/dist/internal/domain/template/vo/namespace.d.ts +130 -0
- package/dist/internal/domain/template/vo/namespace.d.ts.map +1 -0
- package/dist/internal/domain/template/vo/namespace.js +256 -0
- package/dist/internal/domain/template/vo/namespace.js.map +1 -0
- package/dist/internal/domain/template/vo/registry.d.ts +161 -0
- package/dist/internal/domain/template/vo/registry.d.ts.map +1 -0
- package/dist/internal/domain/template/vo/registry.js +1950 -0
- package/dist/internal/domain/template/vo/registry.js.map +1 -0
- package/dist/pkg/cast/cast.d.ts +6 -0
- package/dist/pkg/cast/cast.d.ts.map +1 -0
- package/dist/pkg/cast/cast.js +42 -0
- package/dist/pkg/cast/cast.js.map +1 -0
- package/dist/pkg/cast/index.d.ts +2 -0
- package/dist/pkg/cast/index.d.ts.map +1 -0
- package/dist/pkg/cast/index.js +18 -0
- package/dist/pkg/cast/index.js.map +1 -0
- package/dist/pkg/doctree/dimensions.d.ts +19 -0
- package/dist/pkg/doctree/dimensions.d.ts.map +1 -0
- package/dist/pkg/doctree/dimensions.js +49 -0
- package/dist/pkg/doctree/dimensions.js.map +1 -0
- package/dist/pkg/doctree/doctree.test.d.ts +2 -0
- package/dist/pkg/doctree/doctree.test.d.ts.map +1 -0
- package/dist/pkg/doctree/doctree.test.js +162 -0
- package/dist/pkg/doctree/doctree.test.js.map +1 -0
- package/dist/pkg/doctree/index.d.ts +6 -0
- package/dist/pkg/doctree/index.d.ts.map +1 -0
- package/dist/pkg/doctree/index.js +30 -0
- package/dist/pkg/doctree/index.js.map +1 -0
- package/dist/pkg/doctree/nodeshifttree.d.ts +83 -0
- package/dist/pkg/doctree/nodeshifttree.d.ts.map +1 -0
- package/dist/pkg/doctree/nodeshifttree.js +363 -0
- package/dist/pkg/doctree/nodeshifttree.js.map +1 -0
- package/dist/pkg/doctree/simpletree.d.ts +20 -0
- package/dist/pkg/doctree/simpletree.d.ts.map +1 -0
- package/dist/pkg/doctree/simpletree.js +116 -0
- package/dist/pkg/doctree/simpletree.js.map +1 -0
- package/dist/pkg/doctree/support.d.ts +61 -0
- package/dist/pkg/doctree/support.d.ts.map +1 -0
- package/dist/pkg/doctree/support.js +193 -0
- package/dist/pkg/doctree/support.js.map +1 -0
- package/dist/pkg/doctree/treeshifttree.d.ts +18 -0
- package/dist/pkg/doctree/treeshifttree.d.ts.map +1 -0
- package/dist/pkg/doctree/treeshifttree.js +81 -0
- package/dist/pkg/doctree/treeshifttree.js.map +1 -0
- package/dist/pkg/log/http.d.ts +26 -0
- package/dist/pkg/log/http.d.ts.map +1 -0
- package/dist/pkg/log/http.js +59 -0
- package/dist/pkg/log/http.js.map +1 -0
- package/dist/pkg/log/index.d.ts +17 -0
- package/dist/pkg/log/index.d.ts.map +1 -0
- package/dist/pkg/log/index.js +53 -0
- package/dist/pkg/log/index.js.map +1 -0
- package/dist/pkg/log/logger.d.ts +25 -0
- package/dist/pkg/log/logger.d.ts.map +1 -0
- package/dist/pkg/log/logger.js +183 -0
- package/dist/pkg/log/logger.js.map +1 -0
- package/dist/pkg/log/manager.d.ts +84 -0
- package/dist/pkg/log/manager.d.ts.map +1 -0
- package/dist/pkg/log/manager.js +152 -0
- package/dist/pkg/log/manager.js.map +1 -0
- package/dist/pkg/log/types.d.ts +33 -0
- package/dist/pkg/log/types.d.ts.map +1 -0
- package/dist/pkg/log/types.js +12 -0
- package/dist/pkg/log/types.js.map +1 -0
- package/dist/pkg/maps/scratch.d.ts +38 -0
- package/dist/pkg/maps/scratch.d.ts.map +1 -0
- package/dist/pkg/maps/scratch.js +89 -0
- package/dist/pkg/maps/scratch.js.map +1 -0
- package/dist/pkg/md/parser/item.d.ts +57 -0
- package/dist/pkg/md/parser/item.d.ts.map +1 -0
- package/dist/pkg/md/parser/item.js +181 -0
- package/dist/pkg/md/parser/item.js.map +1 -0
- package/dist/pkg/md/parser/item.test.d.ts +2 -0
- package/dist/pkg/md/parser/item.test.d.ts.map +1 -0
- package/dist/pkg/md/parser/item.test.js +81 -0
- package/dist/pkg/md/parser/item.test.js.map +1 -0
- package/dist/pkg/md/parser/pagelexer.d.ts +129 -0
- package/dist/pkg/md/parser/pagelexer.d.ts.map +1 -0
- package/dist/pkg/md/parser/pagelexer.js +1274 -0
- package/dist/pkg/md/parser/pagelexer.js.map +1 -0
- package/dist/pkg/md/parser/pageparser.d.ts +29 -0
- package/dist/pkg/md/parser/pageparser.d.ts.map +1 -0
- package/dist/pkg/md/parser/pageparser.js +177 -0
- package/dist/pkg/md/parser/pageparser.js.map +1 -0
- package/dist/pkg/md/parser/pageparser.shortcode.test.d.ts +2 -0
- package/dist/pkg/md/parser/pageparser.shortcode.test.d.ts.map +1 -0
- package/dist/pkg/md/parser/pageparser.shortcode.test.js +182 -0
- package/dist/pkg/md/parser/pageparser.shortcode.test.js.map +1 -0
- package/dist/pkg/md/parser/pageparser.test.d.ts +2 -0
- package/dist/pkg/md/parser/pageparser.test.d.ts.map +1 -0
- package/dist/pkg/md/parser/pageparser.test.js +97 -0
- package/dist/pkg/md/parser/pageparser.test.js.map +1 -0
- package/dist/pkg/md/parser/pageparser_intro.test.d.ts +2 -0
- package/dist/pkg/md/parser/pageparser_intro.test.d.ts.map +1 -0
- package/dist/pkg/md/parser/pageparser_intro.test.js +156 -0
- package/dist/pkg/md/parser/pageparser_intro.test.js.map +1 -0
- package/dist/pkg/media/buildin.d.ts +4 -0
- package/dist/pkg/media/buildin.d.ts.map +1 -0
- package/dist/pkg/media/buildin.js +23 -0
- package/dist/pkg/media/buildin.js.map +1 -0
- package/dist/pkg/media/type.d.ts +45 -0
- package/dist/pkg/media/type.d.ts.map +1 -0
- package/dist/pkg/media/type.js +49 -0
- package/dist/pkg/media/type.js.map +1 -0
- package/dist/pkg/paths/index.d.ts +14 -0
- package/dist/pkg/paths/index.d.ts.map +1 -0
- package/dist/pkg/paths/index.js +65 -0
- package/dist/pkg/paths/index.js.map +1 -0
- package/dist/pkg/radix/index.d.ts +2 -0
- package/dist/pkg/radix/index.d.ts.map +1 -0
- package/dist/pkg/radix/index.js +8 -0
- package/dist/pkg/radix/index.js.map +1 -0
- package/dist/pkg/radix/radix.d.ts +51 -0
- package/dist/pkg/radix/radix.d.ts.map +1 -0
- package/dist/pkg/radix/radix.js +488 -0
- package/dist/pkg/radix/radix.js.map +1 -0
- package/dist/pkg/radix/radix.test.d.ts +2 -0
- package/dist/pkg/radix/radix.test.d.ts.map +1 -0
- package/dist/pkg/radix/radix.test.js +350 -0
- package/dist/pkg/radix/radix.test.js.map +1 -0
- package/dist/pkg/string/index.d.ts +2 -0
- package/dist/pkg/string/index.d.ts.map +1 -0
- package/dist/pkg/string/index.js +18 -0
- package/dist/pkg/string/index.js.map +1 -0
- package/dist/pkg/string/string.d.ts +4 -0
- package/dist/pkg/string/string.d.ts.map +1 -0
- package/dist/pkg/string/string.js +10 -0
- package/dist/pkg/string/string.js.map +1 -0
- package/dist/pkg/text/index.d.ts +6 -0
- package/dist/pkg/text/index.d.ts.map +1 -0
- package/dist/pkg/text/index.js +11 -0
- package/dist/pkg/text/index.js.map +1 -0
- package/dist/pkg/types/index.d.ts +2 -0
- package/dist/pkg/types/index.d.ts.map +1 -0
- package/dist/pkg/types/index.js +18 -0
- package/dist/pkg/types/index.js.map +1 -0
- package/dist/pkg/types/types.d.ts +4 -0
- package/dist/pkg/types/types.d.ts.map +1 -0
- package/dist/pkg/types/types.js +19 -0
- package/dist/pkg/types/types.js.map +1 -0
- package/dist/tests/setup.d.ts +2 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/setup.js +3 -0
- package/dist/tests/setup.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,1274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pageLexer = exports.Iterator = void 0;
|
|
4
|
+
exports.NewIterator = NewIterator;
|
|
5
|
+
exports.ParseBytes = ParseBytes;
|
|
6
|
+
exports.ParseBytesMain = ParseBytesMain;
|
|
7
|
+
exports.HasShortcode = HasShortcode;
|
|
8
|
+
exports.newPageLexer = newPageLexer;
|
|
9
|
+
exports.lexIntroSection = lexIntroSection;
|
|
10
|
+
exports.lexMainSection = lexMainSection;
|
|
11
|
+
const item_1 = require("./item");
|
|
12
|
+
const eof = -1;
|
|
13
|
+
var ParamState;
|
|
14
|
+
(function (ParamState) {
|
|
15
|
+
ParamState[ParamState["none"] = 0] = "none";
|
|
16
|
+
ParamState[ParamState["named"] = 1] = "named";
|
|
17
|
+
ParamState[ParamState["positional"] = 2] = "positional";
|
|
18
|
+
})(ParamState || (ParamState = {}));
|
|
19
|
+
// Page syntax
|
|
20
|
+
const byteOrderMark = 0xFEFF; // Unicode BOM character (U+FEFF)
|
|
21
|
+
const byteOrderMarkUTF8 = new Uint8Array([0xEF, 0xBB, 0xBF]); // UTF-8 BOM bytes
|
|
22
|
+
const summaryDivider = new TextEncoder().encode("<!--more-->");
|
|
23
|
+
const summaryDividerOrg = new TextEncoder().encode("# more");
|
|
24
|
+
const delimTOML = new TextEncoder().encode("+++");
|
|
25
|
+
const delimYAML = new TextEncoder().encode("---");
|
|
26
|
+
const delimOrg = new TextEncoder().encode("#+");
|
|
27
|
+
const leftDelimSc = new TextEncoder().encode("{{");
|
|
28
|
+
const leftDelimScNoMarkup = new TextEncoder().encode("{{<");
|
|
29
|
+
const rightDelimScNoMarkup = new TextEncoder().encode(">}}");
|
|
30
|
+
const leftDelimScWithMarkup = new TextEncoder().encode("{{%");
|
|
31
|
+
const rightDelimScWithMarkup = new TextEncoder().encode("%}}");
|
|
32
|
+
const leftComment = new TextEncoder().encode("/*"); // comments in this context us used to to mark shortcodes as "not really a shortcode"
|
|
33
|
+
const rightComment = new TextEncoder().encode("*/");
|
|
34
|
+
// Inline shortcodes has the form {{< myshortcode.inline >}}
|
|
35
|
+
const inlineIdentifier = new TextEncoder().encode("inline ");
|
|
36
|
+
class sectionHandlers {
|
|
37
|
+
constructor(l) {
|
|
38
|
+
this.l = l;
|
|
39
|
+
this.skipAll = false;
|
|
40
|
+
this.handlers = [];
|
|
41
|
+
this.skipIndexes = [];
|
|
42
|
+
}
|
|
43
|
+
skip() {
|
|
44
|
+
if (this.skipAll) {
|
|
45
|
+
return -1;
|
|
46
|
+
}
|
|
47
|
+
this.skipIndexes = [];
|
|
48
|
+
let shouldSkip = false;
|
|
49
|
+
for (const handler of this.handlers) {
|
|
50
|
+
if (handler.skipAll) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const idx = handler.skip();
|
|
54
|
+
if (idx !== -1) {
|
|
55
|
+
shouldSkip = true;
|
|
56
|
+
this.skipIndexes.push(idx);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (!shouldSkip) {
|
|
60
|
+
this.skipAll = true;
|
|
61
|
+
return -1;
|
|
62
|
+
}
|
|
63
|
+
return minIndex(...this.skipIndexes);
|
|
64
|
+
}
|
|
65
|
+
lex(origin) {
|
|
66
|
+
if (this.skipAll) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
if (this.l.pos > this.l.start) {
|
|
70
|
+
this.l.emit(item_1.ItemType.tText);
|
|
71
|
+
}
|
|
72
|
+
for (const handler of this.handlers) {
|
|
73
|
+
if (handler.skipAll) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const [next, handled] = handler.lexFunc(origin, handler.l);
|
|
77
|
+
if (next === null || handled) {
|
|
78
|
+
return next;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this.l.pos++;
|
|
82
|
+
return origin;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
class sectionHandler {
|
|
86
|
+
constructor(l, skipFunc, lexFunc) {
|
|
87
|
+
this.l = l;
|
|
88
|
+
this.skipAll = false;
|
|
89
|
+
this.skipFunc = skipFunc;
|
|
90
|
+
this.lexFunc = lexFunc;
|
|
91
|
+
}
|
|
92
|
+
skip() {
|
|
93
|
+
if (this.skipAll) {
|
|
94
|
+
return -1;
|
|
95
|
+
}
|
|
96
|
+
const idx = this.skipFunc(this.l);
|
|
97
|
+
if (idx === -1) {
|
|
98
|
+
this.skipAll = true;
|
|
99
|
+
}
|
|
100
|
+
return idx;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function createSectionHandlers(l) {
|
|
104
|
+
const handlers = new sectionHandlers(l);
|
|
105
|
+
const shortCodeHandler = new sectionHandler(l, (l) => l.index(leftDelimSc), (origin, l) => {
|
|
106
|
+
if (!l.isShortCodeStart()) {
|
|
107
|
+
return [origin, false];
|
|
108
|
+
}
|
|
109
|
+
if (l.lexerShortcodeState.isInline) {
|
|
110
|
+
// If we're inside an inline shortcode, the only valid shortcode markup is
|
|
111
|
+
// the markup which closes it.
|
|
112
|
+
const b = l.input.slice(l.pos + 3);
|
|
113
|
+
const end = indexNonWhiteSpace(b, 0x2F); // '/'
|
|
114
|
+
if (end !== l.input.length - 1) {
|
|
115
|
+
const bTrimmed = new TextDecoder().decode(b.slice(end + 1)).trim();
|
|
116
|
+
if (end === -1 || !bTrimmed.startsWith(l.lexerShortcodeState.currShortcodeName + " ")) {
|
|
117
|
+
return [l.errorf("inline shortcodes do not support nesting"), true];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (l.hasPrefix(leftDelimScWithMarkup)) {
|
|
122
|
+
l.lexerShortcodeState.currLeftDelimItem = item_1.ItemType.tLeftDelimScWithMarkup;
|
|
123
|
+
l.lexerShortcodeState.currRightDelimItem = item_1.ItemType.tRightDelimScWithMarkup;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
l.lexerShortcodeState.currLeftDelimItem = item_1.ItemType.tLeftDelimScNoMarkup;
|
|
127
|
+
l.lexerShortcodeState.currRightDelimItem = item_1.ItemType.tRightDelimScNoMarkup;
|
|
128
|
+
}
|
|
129
|
+
return [l.lexShortcodeLeftDelim, true];
|
|
130
|
+
});
|
|
131
|
+
const summaryDividerHandler = new sectionHandler(l, (l) => {
|
|
132
|
+
if (l.summaryDividerChecked || !l.summaryDivider) {
|
|
133
|
+
return -1;
|
|
134
|
+
}
|
|
135
|
+
return l.index(l.summaryDivider);
|
|
136
|
+
}, (origin, l) => {
|
|
137
|
+
if (!l.summaryDivider || !l.hasPrefix(l.summaryDivider)) {
|
|
138
|
+
return [origin, false];
|
|
139
|
+
}
|
|
140
|
+
l.summaryDividerChecked = true;
|
|
141
|
+
l.pos += l.summaryDivider.length;
|
|
142
|
+
// This makes it a little easier to reason about later.
|
|
143
|
+
l.consumeSpace();
|
|
144
|
+
l.emit(item_1.ItemType.TypeLeadSummaryDivider);
|
|
145
|
+
return [origin, true];
|
|
146
|
+
});
|
|
147
|
+
handlers.handlers = [shortCodeHandler, summaryDividerHandler];
|
|
148
|
+
handlers.skipIndexes = new Array(handlers.handlers.length);
|
|
149
|
+
return handlers;
|
|
150
|
+
}
|
|
151
|
+
function isSpace(r) {
|
|
152
|
+
return r === 0x20 || r === 0x09; // ' ' or '\t'
|
|
153
|
+
}
|
|
154
|
+
function isAlphaNumericOrHyphen(r) {
|
|
155
|
+
return isAlphaNumeric(r) || r === 0x2D; // '-'
|
|
156
|
+
}
|
|
157
|
+
function isEndOfLine(r) {
|
|
158
|
+
return r === 0x0D || r === 0x0A; // '\r' or '\n'
|
|
159
|
+
}
|
|
160
|
+
function isAlphaNumeric(r) {
|
|
161
|
+
return r === 0x5F || // '_'
|
|
162
|
+
(r >= 0x41 && r <= 0x5A) || // A-Z
|
|
163
|
+
(r >= 0x61 && r <= 0x7A) || // a-z
|
|
164
|
+
(r >= 0x30 && r <= 0x39); // 0-9
|
|
165
|
+
}
|
|
166
|
+
function minIndex(...indices) {
|
|
167
|
+
let min = -1;
|
|
168
|
+
for (const j of indices) {
|
|
169
|
+
if (j < 0) {
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
if (min === -1) {
|
|
173
|
+
min = j;
|
|
174
|
+
}
|
|
175
|
+
else if (j < min) {
|
|
176
|
+
min = j;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return min;
|
|
180
|
+
}
|
|
181
|
+
function indexNonWhiteSpace(s, char) {
|
|
182
|
+
for (let i = 0; i < s.length; i++) {
|
|
183
|
+
if (!isSpace(s[i])) {
|
|
184
|
+
if (s[i] === char) {
|
|
185
|
+
return i;
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return -1;
|
|
191
|
+
}
|
|
192
|
+
class Iterator {
|
|
193
|
+
constructor(items) {
|
|
194
|
+
this.items = items;
|
|
195
|
+
this.lastPos = -1;
|
|
196
|
+
}
|
|
197
|
+
// consumes and returns the next item
|
|
198
|
+
Next() {
|
|
199
|
+
this.lastPos++;
|
|
200
|
+
return this.Current();
|
|
201
|
+
}
|
|
202
|
+
// Current will repeatably return the current item
|
|
203
|
+
Current() {
|
|
204
|
+
if (this.lastPos >= this.items.length) {
|
|
205
|
+
const errorItem = new item_1.Item();
|
|
206
|
+
errorItem.Type = item_1.ItemType.tError;
|
|
207
|
+
errorItem.Err = new Error("no more tokens");
|
|
208
|
+
return errorItem;
|
|
209
|
+
}
|
|
210
|
+
return this.items[this.lastPos];
|
|
211
|
+
}
|
|
212
|
+
// backs up one token
|
|
213
|
+
Backup() {
|
|
214
|
+
if (this.lastPos < 0) {
|
|
215
|
+
throw new Error("need to go forward before going back");
|
|
216
|
+
}
|
|
217
|
+
this.lastPos--;
|
|
218
|
+
}
|
|
219
|
+
// Pos returns the current position in the input
|
|
220
|
+
Pos() {
|
|
221
|
+
return this.lastPos;
|
|
222
|
+
}
|
|
223
|
+
// check for non-error and non-EOF types coming next
|
|
224
|
+
IsValueNext() {
|
|
225
|
+
const i = this.Peek();
|
|
226
|
+
return i.Type !== item_1.ItemType.tError && i.Type !== item_1.ItemType.tEOF;
|
|
227
|
+
}
|
|
228
|
+
// look at, but do not consume, the next item
|
|
229
|
+
// repeated, sequential calls will return the same item
|
|
230
|
+
Peek() {
|
|
231
|
+
return this.items[this.lastPos + 1];
|
|
232
|
+
}
|
|
233
|
+
// PeekWalk will feed the next items in the iterator to walkFn
|
|
234
|
+
// until it returns false
|
|
235
|
+
PeekWalk(walkFn) {
|
|
236
|
+
for (let i = this.lastPos + 1; i < this.items.length; i++) {
|
|
237
|
+
const item = this.items[i];
|
|
238
|
+
if (!walkFn(item)) {
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// Consume is a convenience method to consume the next n tokens,
|
|
244
|
+
// but back off Errors and EOF
|
|
245
|
+
Consume(cnt) {
|
|
246
|
+
for (let i = 0; i < cnt; i++) {
|
|
247
|
+
const token = this.Next();
|
|
248
|
+
if (token.Type === item_1.ItemType.tError || token.Type === item_1.ItemType.tEOF) {
|
|
249
|
+
this.Backup();
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
// LineNumber returns the current line number. Used for logging.
|
|
255
|
+
LineNumber(source) {
|
|
256
|
+
const lf = new Uint8Array([0x0A]); // '\n'
|
|
257
|
+
const slice = source.slice(0, this.Current().low);
|
|
258
|
+
let count = 0;
|
|
259
|
+
for (let i = 0; i < slice.length; i++) {
|
|
260
|
+
if (slice[i] === lf[0]) {
|
|
261
|
+
count++;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return count + 1;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
exports.Iterator = Iterator;
|
|
268
|
+
// NewIterator creates a new Iterator
|
|
269
|
+
function NewIterator(items) {
|
|
270
|
+
return new Iterator(items);
|
|
271
|
+
}
|
|
272
|
+
class pageLexer {
|
|
273
|
+
constructor(input, stateStart, cfg) {
|
|
274
|
+
this.input = input;
|
|
275
|
+
this.stateStart = stateStart;
|
|
276
|
+
this.state = null;
|
|
277
|
+
this.pos = 0;
|
|
278
|
+
this.start = 0;
|
|
279
|
+
this.width = 0;
|
|
280
|
+
this.cfg = cfg;
|
|
281
|
+
this.summaryDivider = null;
|
|
282
|
+
this.summaryDividerChecked = false;
|
|
283
|
+
this.err = null;
|
|
284
|
+
this.items = [];
|
|
285
|
+
this.inFrontMatter = false;
|
|
286
|
+
this.parenDepth = 0;
|
|
287
|
+
this.lexerShortcodeState = {
|
|
288
|
+
currLeftDelimItem: item_1.ItemType.tLeftDelimScNoMarkup,
|
|
289
|
+
currRightDelimItem: item_1.ItemType.tRightDelimScNoMarkup,
|
|
290
|
+
isInline: false,
|
|
291
|
+
currShortcodeName: '',
|
|
292
|
+
closingState: 0,
|
|
293
|
+
elementStepNum: 0,
|
|
294
|
+
paramElements: 0,
|
|
295
|
+
paramState: ParamState.none,
|
|
296
|
+
openShortcodes: {}
|
|
297
|
+
};
|
|
298
|
+
// Bind methods that need 'this' context
|
|
299
|
+
this.lexSummaryDivider = this.lexSummaryDivider.bind(this);
|
|
300
|
+
this.lexMainSection = this.lexMainSection.bind(this);
|
|
301
|
+
this.lexIdentifierInShortcode = this.lexIdentifierInShortcode.bind(this);
|
|
302
|
+
this.lexEndOfShortcode = this.lexEndOfShortcode.bind(this);
|
|
303
|
+
this.lexShortcodeLeftDelim = this.lexShortcodeLeftDelim.bind(this);
|
|
304
|
+
this.lexShortcodeRightDelim = this.lexShortcodeRightDelim.bind(this);
|
|
305
|
+
this.lexShortcodeParam = this.lexShortcodeParam.bind(this);
|
|
306
|
+
this.lexShortcodeValue = this.lexShortcodeValue.bind(this);
|
|
307
|
+
this.lexShortcodeValueQuoted = this.lexShortcodeValueQuoted.bind(this);
|
|
308
|
+
this.lexShortcodeValueUnquoted = this.lexShortcodeValueUnquoted.bind(this);
|
|
309
|
+
this.lexInsideShortcode = this.lexInsideShortcode.bind(this);
|
|
310
|
+
this.lexDone = this.lexDone.bind(this);
|
|
311
|
+
this.sectionHandlers = createSectionHandlers(this);
|
|
312
|
+
}
|
|
313
|
+
// Implement the Result interface
|
|
314
|
+
Iterator() {
|
|
315
|
+
return NewIterator(this.items);
|
|
316
|
+
}
|
|
317
|
+
Input() {
|
|
318
|
+
return this.input;
|
|
319
|
+
}
|
|
320
|
+
// main loop
|
|
321
|
+
run() {
|
|
322
|
+
for (this.state = this.stateStart; this.state !== null;) {
|
|
323
|
+
this.state = this.state(this);
|
|
324
|
+
}
|
|
325
|
+
return this;
|
|
326
|
+
}
|
|
327
|
+
// next returns the next rune in the input.
|
|
328
|
+
next() {
|
|
329
|
+
if (this.pos >= this.input.length) {
|
|
330
|
+
this.width = 0;
|
|
331
|
+
return eof;
|
|
332
|
+
}
|
|
333
|
+
const r = this.input[this.pos];
|
|
334
|
+
this.width = 1;
|
|
335
|
+
this.pos += this.width;
|
|
336
|
+
return r;
|
|
337
|
+
}
|
|
338
|
+
// peek, but no consume
|
|
339
|
+
peek() {
|
|
340
|
+
const r = this.next();
|
|
341
|
+
this.backup();
|
|
342
|
+
return r;
|
|
343
|
+
}
|
|
344
|
+
// steps back one
|
|
345
|
+
backup() {
|
|
346
|
+
this.pos -= this.width;
|
|
347
|
+
}
|
|
348
|
+
append(item) {
|
|
349
|
+
if (item.Pos() < this.input.length) {
|
|
350
|
+
if (item.Type === item_1.ItemType.TypeIgnore && this.input[item.Pos()] === 0xEF) {
|
|
351
|
+
item.firstByte = 0xEF; // BOM mark's first byte
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
item.firstByte = this.input[item.Pos()];
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
this.items.push(item);
|
|
358
|
+
}
|
|
359
|
+
// sends an item back to the client.
|
|
360
|
+
emit(t) {
|
|
361
|
+
// 使用 defer 模式来确保在函数结束时设置 start
|
|
362
|
+
const defer = () => {
|
|
363
|
+
this.start = this.pos;
|
|
364
|
+
};
|
|
365
|
+
if (t === item_1.ItemType.tText) {
|
|
366
|
+
// Identify any trailing whitespace/intendation.
|
|
367
|
+
// We currently only care about the last one.
|
|
368
|
+
for (let i = this.pos - 1; i >= this.start; i--) {
|
|
369
|
+
const b = this.input[i];
|
|
370
|
+
if (b !== 0x20 && b !== 0x09 && b !== 0x0D && b !== 0x0A) { // ' ', '\t', '\r', '\n'
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
if (i === this.start && b !== 0x0A) { // '\n'
|
|
374
|
+
const item = new item_1.Item();
|
|
375
|
+
item.Type = item_1.ItemType.tIndentation;
|
|
376
|
+
item.low = this.start;
|
|
377
|
+
item.high = this.pos;
|
|
378
|
+
this.append(item);
|
|
379
|
+
defer();
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
else if (b === 0x0A && i < this.pos - 1) {
|
|
383
|
+
const textItem = new item_1.Item();
|
|
384
|
+
textItem.Type = t;
|
|
385
|
+
textItem.low = this.start;
|
|
386
|
+
textItem.high = i + 1;
|
|
387
|
+
this.append(textItem);
|
|
388
|
+
const indentItem = new item_1.Item();
|
|
389
|
+
indentItem.Type = item_1.ItemType.tIndentation;
|
|
390
|
+
indentItem.low = i + 1;
|
|
391
|
+
indentItem.high = this.pos;
|
|
392
|
+
this.append(indentItem);
|
|
393
|
+
defer();
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
else if (b === 0x0A && i === this.pos - 1) {
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
// 创建并添加 item
|
|
402
|
+
const item = new item_1.Item();
|
|
403
|
+
item.Type = t;
|
|
404
|
+
item.low = this.start;
|
|
405
|
+
item.high = this.pos;
|
|
406
|
+
// Set firstByte if we have content
|
|
407
|
+
if (item.low < this.input.length) {
|
|
408
|
+
if (t === item_1.ItemType.TypeIgnore && this.input[item.low] === 0xEF) {
|
|
409
|
+
item.firstByte = 0xEF; // BOM mark's first byte
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
item.firstByte = this.input[item.low];
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
this.append(item);
|
|
416
|
+
defer();
|
|
417
|
+
}
|
|
418
|
+
// sends a string item back to the client.
|
|
419
|
+
emitString(t) {
|
|
420
|
+
const item = new item_1.Item();
|
|
421
|
+
item.Type = t;
|
|
422
|
+
item['low'] = this.start;
|
|
423
|
+
item['high'] = this.pos;
|
|
424
|
+
item['isString'] = true;
|
|
425
|
+
if (this.pos > this.start) {
|
|
426
|
+
item.firstByte = this.input[this.start];
|
|
427
|
+
}
|
|
428
|
+
this.items.push(item);
|
|
429
|
+
this.start = this.pos;
|
|
430
|
+
}
|
|
431
|
+
isEOF() {
|
|
432
|
+
return this.pos >= this.input.length;
|
|
433
|
+
}
|
|
434
|
+
// special case, do not send '\\' back to client
|
|
435
|
+
ignoreEscapesAndEmit(t, isString) {
|
|
436
|
+
let i = this.start;
|
|
437
|
+
let k = i;
|
|
438
|
+
const segments = [];
|
|
439
|
+
while (i < this.pos) {
|
|
440
|
+
const r = this.input[i];
|
|
441
|
+
const w = 1; // In TypeScript we handle one byte at a time
|
|
442
|
+
if (r === 0x5C) { // '\\'
|
|
443
|
+
if (i > k) {
|
|
444
|
+
segments.push({ Low: k, High: i });
|
|
445
|
+
}
|
|
446
|
+
k = i + w;
|
|
447
|
+
}
|
|
448
|
+
i += w;
|
|
449
|
+
}
|
|
450
|
+
if (k < this.pos) {
|
|
451
|
+
segments.push({ Low: k, High: this.pos });
|
|
452
|
+
}
|
|
453
|
+
if (segments.length > 0) {
|
|
454
|
+
const item = new item_1.Item();
|
|
455
|
+
item.Type = t;
|
|
456
|
+
item['segments'] = segments;
|
|
457
|
+
if (segments[0].High > segments[0].Low) {
|
|
458
|
+
item.firstByte = this.input[segments[0].Low];
|
|
459
|
+
}
|
|
460
|
+
this.items.push(item);
|
|
461
|
+
this.start = this.pos;
|
|
462
|
+
}
|
|
463
|
+
this.start = this.pos;
|
|
464
|
+
}
|
|
465
|
+
// gets the current value (for debugging and error handling)
|
|
466
|
+
current() {
|
|
467
|
+
return this.input.slice(this.start, this.pos);
|
|
468
|
+
}
|
|
469
|
+
// ignore current element
|
|
470
|
+
ignore() {
|
|
471
|
+
this.start = this.pos;
|
|
472
|
+
}
|
|
473
|
+
// nil terminates the parser
|
|
474
|
+
errorf(format, ...args) {
|
|
475
|
+
const err = new Error(format.replace(/%[a-z]/g, () => String(args.shift())));
|
|
476
|
+
const item = new item_1.Item();
|
|
477
|
+
item.Type = item_1.ItemType.tError;
|
|
478
|
+
item.Err = err;
|
|
479
|
+
item.low = this.start;
|
|
480
|
+
item.high = this.pos;
|
|
481
|
+
this.append(item);
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
consumeCRLF() {
|
|
485
|
+
let consumed = false;
|
|
486
|
+
const r = this.peek();
|
|
487
|
+
if (r === 0x0D) { // '\r'
|
|
488
|
+
this.next();
|
|
489
|
+
if (this.peek() === 0x0A) { // '\n'
|
|
490
|
+
this.next();
|
|
491
|
+
consumed = true;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
else if (r === 0x0A) { // '\n'
|
|
495
|
+
this.next();
|
|
496
|
+
consumed = true;
|
|
497
|
+
}
|
|
498
|
+
return consumed;
|
|
499
|
+
}
|
|
500
|
+
consumeToSpace() {
|
|
501
|
+
while (true) {
|
|
502
|
+
const r = this.next();
|
|
503
|
+
if (r === eof || isSpace(r)) {
|
|
504
|
+
this.backup();
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
consumeSpace() {
|
|
510
|
+
for (;;) {
|
|
511
|
+
const r = this.next();
|
|
512
|
+
if (r === eof || !this.isUnicodeSpace(r)) {
|
|
513
|
+
this.backup();
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
// Helper function to match Golang's unicode.IsSpace behavior
|
|
519
|
+
isUnicodeSpace(r) {
|
|
520
|
+
// This matches Golang's unicode.IsSpace implementation
|
|
521
|
+
return r === 0x20 || // Space
|
|
522
|
+
r === 0x09 || // Tab
|
|
523
|
+
r === 0x0A || // Line Feed
|
|
524
|
+
r === 0x0C || // Form Feed
|
|
525
|
+
r === 0x0D || // Carriage Return
|
|
526
|
+
r === 0x85 || // Next Line
|
|
527
|
+
r === 0xA0 || // No-Break Space
|
|
528
|
+
r === 0x2000 || // En Quad
|
|
529
|
+
r === 0x2001 || // Em Quad
|
|
530
|
+
r === 0x2002 || // En Space
|
|
531
|
+
r === 0x2003 || // Em Space
|
|
532
|
+
r === 0x2004 || // Three-Per-Em Space
|
|
533
|
+
r === 0x2005 || // Four-Per-Em Space
|
|
534
|
+
r === 0x2006 || // Six-Per-Em Space
|
|
535
|
+
r === 0x2007 || // Figure Space
|
|
536
|
+
r === 0x2008 || // Punctuation Space
|
|
537
|
+
r === 0x2009 || // Thin Space
|
|
538
|
+
r === 0x200A || // Hair Space
|
|
539
|
+
r === 0x2028 || // Line Separator
|
|
540
|
+
r === 0x2029 || // Paragraph Separator
|
|
541
|
+
r === 0x202F || // Narrow No-Break Space
|
|
542
|
+
r === 0x205F || // Medium Mathematical Space
|
|
543
|
+
r === 0x3000; // Ideographic Space
|
|
544
|
+
}
|
|
545
|
+
index(sep) {
|
|
546
|
+
const input = this.input.slice(this.pos);
|
|
547
|
+
const sepLen = sep.length;
|
|
548
|
+
const inputLen = input.length;
|
|
549
|
+
// If the separator is longer than the remaining input, it can't be found
|
|
550
|
+
if (sepLen > inputLen) {
|
|
551
|
+
return -1;
|
|
552
|
+
}
|
|
553
|
+
// Search for the separator
|
|
554
|
+
outer: for (let i = 0; i <= inputLen - sepLen; i++) {
|
|
555
|
+
for (let j = 0; j < sepLen; j++) {
|
|
556
|
+
if (input[i + j] !== sep[j]) {
|
|
557
|
+
continue outer;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return i;
|
|
561
|
+
}
|
|
562
|
+
return -1;
|
|
563
|
+
}
|
|
564
|
+
hasPrefix(prefix) {
|
|
565
|
+
if (this.pos + prefix.length > this.input.length) {
|
|
566
|
+
return false;
|
|
567
|
+
}
|
|
568
|
+
for (let i = 0; i < prefix.length; i++) {
|
|
569
|
+
if (this.input[this.pos + i] !== prefix[i]) {
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return true;
|
|
574
|
+
}
|
|
575
|
+
isShortCodeStart() {
|
|
576
|
+
return this.hasPrefix(leftDelimScWithMarkup) || this.hasPrefix(leftDelimScNoMarkup);
|
|
577
|
+
}
|
|
578
|
+
// Handle YAML or TOML front matter.
|
|
579
|
+
lexFrontMatterSection(tp, delimr, name, delim) {
|
|
580
|
+
for (let i = 0; i < 2; i++) {
|
|
581
|
+
if (this.next() !== delimr) {
|
|
582
|
+
return this.errorf(`invalid ${name} delimiter`);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
// Let front matter start at line 1
|
|
586
|
+
let wasEndOfLine = this.consumeCRLF();
|
|
587
|
+
// We don't care about the delimiters.
|
|
588
|
+
this.ignore();
|
|
589
|
+
let r;
|
|
590
|
+
for (;;) {
|
|
591
|
+
if (!wasEndOfLine) {
|
|
592
|
+
r = this.next();
|
|
593
|
+
if (r === eof) {
|
|
594
|
+
return this.errorf(`EOF looking for end ${name} front matter delimiter`);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (wasEndOfLine || isEndOfLine(r)) {
|
|
598
|
+
if (this.hasPrefix(delim)) {
|
|
599
|
+
this.emit(tp);
|
|
600
|
+
this.pos += 3;
|
|
601
|
+
this.consumeCRLF();
|
|
602
|
+
this.ignore();
|
|
603
|
+
break;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
wasEndOfLine = false;
|
|
607
|
+
}
|
|
608
|
+
return () => this.lexMainSection();
|
|
609
|
+
}
|
|
610
|
+
currentLeftShortcodeDelimItem() {
|
|
611
|
+
return this.lexerShortcodeState.currLeftDelimItem;
|
|
612
|
+
}
|
|
613
|
+
currentRightShortcodeDelimItem() {
|
|
614
|
+
return this.lexerShortcodeState.currRightDelimItem;
|
|
615
|
+
}
|
|
616
|
+
currentLeftShortcodeDelim() {
|
|
617
|
+
if (this.lexerShortcodeState.currLeftDelimItem === item_1.ItemType.tLeftDelimScWithMarkup) {
|
|
618
|
+
return leftDelimScWithMarkup;
|
|
619
|
+
}
|
|
620
|
+
return leftDelimScNoMarkup;
|
|
621
|
+
}
|
|
622
|
+
currentRightShortcodeDelim() {
|
|
623
|
+
if (this.lexerShortcodeState.currRightDelimItem === item_1.ItemType.tRightDelimScWithMarkup) {
|
|
624
|
+
return rightDelimScWithMarkup;
|
|
625
|
+
}
|
|
626
|
+
return rightDelimScNoMarkup;
|
|
627
|
+
}
|
|
628
|
+
// lexIdentifier scans an alphanumeric identifier.
|
|
629
|
+
lexIdentifier() {
|
|
630
|
+
for (;;) {
|
|
631
|
+
const r = this.next();
|
|
632
|
+
if (isAlphaNumericOrHyphen(r)) {
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
this.backup();
|
|
636
|
+
const word = new TextDecoder().decode(this.input.slice(this.start, this.pos));
|
|
637
|
+
if (word.length === 0) {
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
640
|
+
this.emit(item_1.ItemType.tScParam);
|
|
641
|
+
return null;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
// lexMainSection is the default state.
|
|
645
|
+
lexMainSection() {
|
|
646
|
+
if (this.isEOF()) {
|
|
647
|
+
return () => this.lexDone();
|
|
648
|
+
}
|
|
649
|
+
// Fast forward as far as possible.
|
|
650
|
+
const skip = this.sectionHandlers.skip();
|
|
651
|
+
if (skip === -1) {
|
|
652
|
+
this.pos = this.input.length;
|
|
653
|
+
return () => this.lexDone();
|
|
654
|
+
}
|
|
655
|
+
else if (skip > 0) {
|
|
656
|
+
this.pos += skip;
|
|
657
|
+
}
|
|
658
|
+
const next = this.sectionHandlers.lex(this.lexMainSection);
|
|
659
|
+
if (next !== null) {
|
|
660
|
+
return next;
|
|
661
|
+
}
|
|
662
|
+
this.pos = this.input.length;
|
|
663
|
+
return this.lexDone;
|
|
664
|
+
}
|
|
665
|
+
lexInlineShortcodeContent() {
|
|
666
|
+
for (;;) {
|
|
667
|
+
if (this.pos >= this.input.length) {
|
|
668
|
+
return this.errorf("unclosed inline shortcode");
|
|
669
|
+
}
|
|
670
|
+
if (this.hasPrefix(leftDelimScWithMarkup) || this.hasPrefix(leftDelimScNoMarkup)) {
|
|
671
|
+
return this.errorf("inline shortcodes do not support nesting");
|
|
672
|
+
}
|
|
673
|
+
if (this.hasPrefix(this.currentRightShortcodeDelim())) {
|
|
674
|
+
this.backup();
|
|
675
|
+
if (this.pos > this.start) {
|
|
676
|
+
this.emit(item_1.ItemType.tText);
|
|
677
|
+
}
|
|
678
|
+
return () => this.lexShortcodeRightDelim();
|
|
679
|
+
}
|
|
680
|
+
this.next();
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
// lexIdentifierInShortcode scans an alphanumeric inside shortcode
|
|
684
|
+
lexIdentifierInShortcode() {
|
|
685
|
+
let lookForEnd = false;
|
|
686
|
+
// 使用 for(;;) 来模拟 Go 的 Loop 标签
|
|
687
|
+
for (;;) {
|
|
688
|
+
const r = this.next();
|
|
689
|
+
switch (true) {
|
|
690
|
+
case isAlphaNumericOrHyphen(r):
|
|
691
|
+
// 与 Go 版本一样,这里什么都不做,继续循环
|
|
692
|
+
break;
|
|
693
|
+
case r === 0x2F: // '/'
|
|
694
|
+
// 与 Go 版本一样,允许命名空间中的斜杠
|
|
695
|
+
break;
|
|
696
|
+
case r === 0x2E: // '.'
|
|
697
|
+
this.lexerShortcodeState.isInline = this.hasPrefix(inlineIdentifier);
|
|
698
|
+
if (!this.lexerShortcodeState.isInline) {
|
|
699
|
+
return this.errorf("period in shortcode name only allowed for inline identifiers");
|
|
700
|
+
}
|
|
701
|
+
break;
|
|
702
|
+
default:
|
|
703
|
+
this.backup();
|
|
704
|
+
const word = new TextDecoder().decode(this.input.slice(this.start, this.pos));
|
|
705
|
+
// 完全按照 Go 版本的逻辑顺序处理
|
|
706
|
+
if (this.lexerShortcodeState.closingState > 0 && !this.lexerShortcodeState.openShortcodes[word]) {
|
|
707
|
+
return this.errorf(`closing tag for shortcode '${word}' does not match start tag`);
|
|
708
|
+
}
|
|
709
|
+
else if (this.lexerShortcodeState.closingState > 0) {
|
|
710
|
+
this.lexerShortcodeState.openShortcodes[word] = false;
|
|
711
|
+
lookForEnd = true;
|
|
712
|
+
}
|
|
713
|
+
// 重置和设置状态
|
|
714
|
+
this.lexerShortcodeState.closingState = 0;
|
|
715
|
+
this.lexerShortcodeState.currShortcodeName = word;
|
|
716
|
+
this.lexerShortcodeState.openShortcodes[word] = true;
|
|
717
|
+
this.lexerShortcodeState.elementStepNum++;
|
|
718
|
+
// 发出对应的 token
|
|
719
|
+
if (this.lexerShortcodeState.isInline) {
|
|
720
|
+
this.emit(item_1.ItemType.tScNameInline);
|
|
721
|
+
}
|
|
722
|
+
else {
|
|
723
|
+
this.emit(item_1.ItemType.tScName);
|
|
724
|
+
}
|
|
725
|
+
// 跳出循环
|
|
726
|
+
if (lookForEnd) {
|
|
727
|
+
return () => this.lexEndOfShortcode();
|
|
728
|
+
}
|
|
729
|
+
return this.lexInsideShortcode;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
// lexEndOfShortcode scans until it finds the end of shortcode
|
|
734
|
+
lexEndOfShortcode() {
|
|
735
|
+
this.lexerShortcodeState.isInline = false;
|
|
736
|
+
if (this.hasPrefix(this.currentRightShortcodeDelim())) {
|
|
737
|
+
return () => this.lexShortcodeRightDelim();
|
|
738
|
+
}
|
|
739
|
+
const r = this.next();
|
|
740
|
+
switch (true) {
|
|
741
|
+
case isSpace(r):
|
|
742
|
+
this.ignore();
|
|
743
|
+
break;
|
|
744
|
+
default:
|
|
745
|
+
return this.errorf("unclosed shortcode");
|
|
746
|
+
}
|
|
747
|
+
return () => this.lexEndOfShortcode();
|
|
748
|
+
}
|
|
749
|
+
// lexShortcodeLeftDelim scans the left delimiter.
|
|
750
|
+
lexShortcodeLeftDelim() {
|
|
751
|
+
this.pos += this.currentLeftShortcodeDelim().length;
|
|
752
|
+
if (this.isComment()) {
|
|
753
|
+
return () => this.lexComment();
|
|
754
|
+
}
|
|
755
|
+
this.emit(this.lexerShortcodeState.currLeftDelimItem);
|
|
756
|
+
this.lexerShortcodeState.elementStepNum = 0;
|
|
757
|
+
this.lexerShortcodeState.paramElements = 0;
|
|
758
|
+
this.lexerShortcodeState.paramState = ParamState.none;
|
|
759
|
+
this.start = this.pos;
|
|
760
|
+
return this.lexInsideShortcode;
|
|
761
|
+
}
|
|
762
|
+
// peekString returns the next n bytes as a string without advancing the pos.
|
|
763
|
+
peekString(s) {
|
|
764
|
+
const n = s instanceof Uint8Array ? s.length : s.length;
|
|
765
|
+
if (this.pos + n > this.input.length) {
|
|
766
|
+
return null;
|
|
767
|
+
}
|
|
768
|
+
const peek = this.input.slice(this.pos, this.pos + n);
|
|
769
|
+
if (s instanceof Uint8Array) {
|
|
770
|
+
// Compare byte arrays
|
|
771
|
+
for (let i = 0; i < n; i++) {
|
|
772
|
+
if (peek[i] !== s[i]) {
|
|
773
|
+
return null;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
return new TextDecoder().decode(peek);
|
|
777
|
+
}
|
|
778
|
+
else {
|
|
779
|
+
// Compare with string
|
|
780
|
+
const str = new TextDecoder().decode(peek);
|
|
781
|
+
if (str === s) {
|
|
782
|
+
return str;
|
|
783
|
+
}
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
// lexSummaryDivider scans the summary divider.
|
|
788
|
+
lexSummaryDivider() {
|
|
789
|
+
if (!this.hasPrefix(summaryDivider)) {
|
|
790
|
+
return null;
|
|
791
|
+
}
|
|
792
|
+
// If we have text before the divider on the same line, emit it first
|
|
793
|
+
if (this.start < this.pos) {
|
|
794
|
+
const item = new item_1.Item();
|
|
795
|
+
item.Type = item_1.ItemType.tText;
|
|
796
|
+
item.low = this.start;
|
|
797
|
+
item.high = this.pos;
|
|
798
|
+
if (item.low < this.input.length) {
|
|
799
|
+
item.firstByte = this.input[item.low];
|
|
800
|
+
}
|
|
801
|
+
this.append(item);
|
|
802
|
+
}
|
|
803
|
+
// Emit the divider
|
|
804
|
+
const divider = new item_1.Item();
|
|
805
|
+
divider.Type = item_1.ItemType.TypeLeadSummaryDivider;
|
|
806
|
+
divider.low = this.pos;
|
|
807
|
+
divider.high = this.pos + summaryDivider.length;
|
|
808
|
+
if (divider.low < this.input.length) {
|
|
809
|
+
divider.firstByte = this.input[divider.low];
|
|
810
|
+
}
|
|
811
|
+
this.append(divider);
|
|
812
|
+
this.pos += summaryDivider.length;
|
|
813
|
+
this.start = this.pos;
|
|
814
|
+
// Continue with the main section lexer
|
|
815
|
+
return () => this.lexMainSection();
|
|
816
|
+
}
|
|
817
|
+
// handleBOM checks for and handles a UTF-8 BOM sequence.
|
|
818
|
+
// Returns true if a BOM was found and handled, false otherwise.
|
|
819
|
+
handleBOM() {
|
|
820
|
+
// Check for UTF-8 BOM sequence (EF BB BF)
|
|
821
|
+
if (this.pos + 3 <= this.input.length) {
|
|
822
|
+
const possibleBOM = this.input.slice(this.pos, this.pos + 3);
|
|
823
|
+
if (possibleBOM[0] === 0xEF && possibleBOM[1] === 0xBB && possibleBOM[2] === 0xBF) {
|
|
824
|
+
// Emit the entire BOM sequence as a single token
|
|
825
|
+
const item = new item_1.Item();
|
|
826
|
+
item.Type = item_1.ItemType.TypeIgnore;
|
|
827
|
+
item.low = this.pos;
|
|
828
|
+
item.high = this.pos + 3;
|
|
829
|
+
item.firstByte = 0xEF;
|
|
830
|
+
this.append(item);
|
|
831
|
+
this.pos += 3;
|
|
832
|
+
this.start = this.pos;
|
|
833
|
+
return true;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
return false;
|
|
837
|
+
}
|
|
838
|
+
// lexIntroSection scans until it finds a front matter or a non-space.
|
|
839
|
+
lexIntroSection() {
|
|
840
|
+
this.summaryDivider = summaryDivider;
|
|
841
|
+
// First check for BOM at the start of the file
|
|
842
|
+
if (this.pos === 0 && this.handleBOM()) {
|
|
843
|
+
// todo
|
|
844
|
+
}
|
|
845
|
+
LOOP: for (;;) {
|
|
846
|
+
const r = this.next();
|
|
847
|
+
if (r === eof) {
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
switch (true) {
|
|
851
|
+
case r === 0x2B: // '+'
|
|
852
|
+
return () => this.lexFrontMatterSection(item_1.ItemType.TypeFrontMatterTOML, r, "TOML", delimTOML);
|
|
853
|
+
case r === 0x2D: // '-'
|
|
854
|
+
return () => this.lexFrontMatterSection(item_1.ItemType.TypeFrontMatterYAML, r, "YAML", delimYAML);
|
|
855
|
+
case r === 0x7B: // '{'
|
|
856
|
+
return lexFrontMatterJSON;
|
|
857
|
+
case r === 0x23: // '#'
|
|
858
|
+
return lexFrontMatterOrgMode;
|
|
859
|
+
case r === byteOrderMark:
|
|
860
|
+
this.emit(item_1.ItemType.TypeIgnore);
|
|
861
|
+
break;
|
|
862
|
+
case !isSpace(r) && !isEndOfLine(r):
|
|
863
|
+
break LOOP;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
// Now move on to the shortcodes.
|
|
867
|
+
return () => this.lexMainSection();
|
|
868
|
+
}
|
|
869
|
+
// lexInsideShortcode scans the content inside a shortcode
|
|
870
|
+
lexInsideShortcode() {
|
|
871
|
+
if (this.hasPrefix(this.currentRightShortcodeDelim())) {
|
|
872
|
+
return this.lexShortcodeRightDelim;
|
|
873
|
+
}
|
|
874
|
+
const r = this.next();
|
|
875
|
+
if (r === eof) {
|
|
876
|
+
// eol is allowed inside shortcodes; this may go to end of document before it fails
|
|
877
|
+
return this.errorf("unclosed shortcode action");
|
|
878
|
+
}
|
|
879
|
+
if (isSpace(r) || isEndOfLine(r)) {
|
|
880
|
+
this.ignore();
|
|
881
|
+
}
|
|
882
|
+
else if (r === 0x3D) { // '='
|
|
883
|
+
this.consumeSpace();
|
|
884
|
+
this.ignore();
|
|
885
|
+
const peek = this.peek();
|
|
886
|
+
if (peek === 0x22 || peek === 0x5C) { // '"' or '\\'
|
|
887
|
+
return this.lexShortcodeQuotedParamVal(peek !== 0x5C, item_1.ItemType.tScParamVal);
|
|
888
|
+
}
|
|
889
|
+
else if (peek === 0x60) { // '`'
|
|
890
|
+
return this.lexShortCodeParamRawStringVal(item_1.ItemType.tScParamVal);
|
|
891
|
+
}
|
|
892
|
+
return this.lexShortcodeParamVal;
|
|
893
|
+
}
|
|
894
|
+
else if (r === 0x2F) { // '/'
|
|
895
|
+
if (this.lexerShortcodeState.currShortcodeName === "") {
|
|
896
|
+
return this.errorf("got closing shortcode, but none is open");
|
|
897
|
+
}
|
|
898
|
+
this.lexerShortcodeState.closingState++;
|
|
899
|
+
this.lexerShortcodeState.isInline = false;
|
|
900
|
+
this.emit(item_1.ItemType.tScClose);
|
|
901
|
+
}
|
|
902
|
+
else if (r === 0x5C) { // '\\'
|
|
903
|
+
this.ignore();
|
|
904
|
+
if (this.peek() === 0x22 || this.peek() === 0x60) { // '"' or '`'
|
|
905
|
+
return this.lexShortcodeParam(true);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
else if (this.lexerShortcodeState.elementStepNum > 0 && (isAlphaNumericOrHyphen(r) || r === 0x22 || r === 0x60)) { // '"' or '`'
|
|
909
|
+
// positional params can have quotes
|
|
910
|
+
this.backup();
|
|
911
|
+
return this.lexShortcodeParam(false);
|
|
912
|
+
}
|
|
913
|
+
else if (isAlphaNumeric(r)) {
|
|
914
|
+
this.backup();
|
|
915
|
+
return this.lexIdentifierInShortcode;
|
|
916
|
+
}
|
|
917
|
+
else {
|
|
918
|
+
return this.errorf(`unrecognized character in shortcode action: U+${r.toString(16).toUpperCase()} '${String.fromCharCode(r)}'. Note: Parameters with non-alphanumeric args must be quoted`);
|
|
919
|
+
}
|
|
920
|
+
return this.lexInsideShortcode;
|
|
921
|
+
}
|
|
922
|
+
// lexShortcodeParam scans a shortcode parameter.
|
|
923
|
+
lexShortcodeParam(escapedQuoteStart) {
|
|
924
|
+
let first = true;
|
|
925
|
+
let nextEq = false;
|
|
926
|
+
let r;
|
|
927
|
+
for (;;) {
|
|
928
|
+
r = this.next();
|
|
929
|
+
if (first) {
|
|
930
|
+
if (r === 0x22 || (r === 0x60 && !escapedQuoteStart)) { // '"' or '`'
|
|
931
|
+
// a positional param with quotes
|
|
932
|
+
if (this.lexerShortcodeState.paramElements === 2) {
|
|
933
|
+
return this.errorf("got quoted positional parameter. Cannot mix named and positional parameters");
|
|
934
|
+
}
|
|
935
|
+
this.lexerShortcodeState.paramElements = 1;
|
|
936
|
+
this.backup();
|
|
937
|
+
if (r === 0x22) { // '"'
|
|
938
|
+
return () => this.lexShortcodeQuotedParamVal(!escapedQuoteStart, item_1.ItemType.tScParam);
|
|
939
|
+
}
|
|
940
|
+
return () => this.lexShortCodeParamRawStringVal(item_1.ItemType.tScParam);
|
|
941
|
+
}
|
|
942
|
+
else if (r === 0x60 && escapedQuoteStart) { // '`'
|
|
943
|
+
return this.errorf("unrecognized escape character");
|
|
944
|
+
}
|
|
945
|
+
first = false;
|
|
946
|
+
}
|
|
947
|
+
else if (r === 0x3D) { // '='
|
|
948
|
+
// a named param
|
|
949
|
+
this.backup();
|
|
950
|
+
nextEq = true;
|
|
951
|
+
break;
|
|
952
|
+
}
|
|
953
|
+
if (!isAlphaNumericOrHyphen(r) && r !== 0x2E) { // '.' for floats
|
|
954
|
+
this.backup();
|
|
955
|
+
break;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
if (this.lexerShortcodeState.paramElements === 0) {
|
|
959
|
+
this.lexerShortcodeState.paramElements++;
|
|
960
|
+
if (nextEq) {
|
|
961
|
+
this.lexerShortcodeState.paramElements++;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
else {
|
|
965
|
+
if (nextEq && this.lexerShortcodeState.paramElements === 1) {
|
|
966
|
+
return this.errorf(`got named parameter '${new TextDecoder().decode(this.current())}'. Cannot mix named and positional parameters`);
|
|
967
|
+
}
|
|
968
|
+
else if (!nextEq && this.lexerShortcodeState.paramElements === 2) {
|
|
969
|
+
return this.errorf(`got positional parameter '${new TextDecoder().decode(this.current())}'. Cannot mix named and positional parameters`);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
this.emit(item_1.ItemType.tScParam);
|
|
973
|
+
return this.lexInsideShortcode;
|
|
974
|
+
}
|
|
975
|
+
// lexShortcodeParamVal scans a shortcode parameter value.
|
|
976
|
+
lexShortcodeParamVal() {
|
|
977
|
+
const r = this.next();
|
|
978
|
+
if (isSpace(r)) {
|
|
979
|
+
this.ignore();
|
|
980
|
+
return () => this.lexShortcodeParamVal();
|
|
981
|
+
}
|
|
982
|
+
this.backup();
|
|
983
|
+
switch (r) {
|
|
984
|
+
case 0x22: // '"'
|
|
985
|
+
this.next();
|
|
986
|
+
this.ignore();
|
|
987
|
+
return () => this.lexShortcodeQuotedParamVal(false, item_1.ItemType.tScParamVal);
|
|
988
|
+
case 0x60: // '`'
|
|
989
|
+
this.next();
|
|
990
|
+
this.ignore();
|
|
991
|
+
return () => this.lexShortCodeParamRawStringVal(item_1.ItemType.tScParamVal);
|
|
992
|
+
default:
|
|
993
|
+
return () => this.lexShortcodeValueUnquoted();
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
// lexShortcodeValueUnquoted scans an unquoted shortcode parameter value.
|
|
997
|
+
lexShortcodeValueUnquoted() {
|
|
998
|
+
for (;;) {
|
|
999
|
+
const r = this.next();
|
|
1000
|
+
if (r === eof || isSpace(r) || this.isRightShortcodeDelim()) {
|
|
1001
|
+
this.backup();
|
|
1002
|
+
if (this.pos > this.start) {
|
|
1003
|
+
this.emit(item_1.ItemType.tScParamVal);
|
|
1004
|
+
}
|
|
1005
|
+
return this.lexInsideShortcode;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
// lexShortcodeQuotedParamVal scans a quoted shortcode parameter value.
|
|
1010
|
+
lexShortcodeQuotedParamVal(escapedQuotedValuesAllowed, typ) {
|
|
1011
|
+
let openQuoteFound = false;
|
|
1012
|
+
let escapedInnerQuoteFound = false;
|
|
1013
|
+
let escapedQuoteState = 0;
|
|
1014
|
+
LOOP: for (;;) {
|
|
1015
|
+
const r = this.next();
|
|
1016
|
+
switch (true) {
|
|
1017
|
+
case r === 0x5C: // '\'
|
|
1018
|
+
if (this.peek() === 0x22) { // '"'
|
|
1019
|
+
if (openQuoteFound && !escapedQuotedValuesAllowed) {
|
|
1020
|
+
this.backup();
|
|
1021
|
+
break LOOP;
|
|
1022
|
+
}
|
|
1023
|
+
else if (openQuoteFound) {
|
|
1024
|
+
// the coming quote is inside
|
|
1025
|
+
escapedInnerQuoteFound = true;
|
|
1026
|
+
escapedQuoteState = 1;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
else if (this.peek() === 0x60) { // '`'
|
|
1030
|
+
return this.errorf("unrecognized escape character");
|
|
1031
|
+
}
|
|
1032
|
+
break;
|
|
1033
|
+
case r === eof:
|
|
1034
|
+
case r === 0x0A: // '\n'
|
|
1035
|
+
return this.errorf(`unterminated quoted string in shortcode parameter-argument: '${new TextDecoder().decode(this.current())}'`);
|
|
1036
|
+
case r === 0x22: // '"'
|
|
1037
|
+
if (escapedQuoteState === 0) {
|
|
1038
|
+
if (openQuoteFound) {
|
|
1039
|
+
this.backup();
|
|
1040
|
+
break LOOP;
|
|
1041
|
+
}
|
|
1042
|
+
else {
|
|
1043
|
+
openQuoteFound = true;
|
|
1044
|
+
this.ignore();
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
else {
|
|
1048
|
+
escapedQuoteState = 0;
|
|
1049
|
+
}
|
|
1050
|
+
break;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
if (escapedInnerQuoteFound) {
|
|
1054
|
+
this.ignoreEscapesAndEmit(typ, true);
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
this.emitString(typ);
|
|
1058
|
+
}
|
|
1059
|
+
const r = this.next();
|
|
1060
|
+
if (r === 0x5C) { // '\'
|
|
1061
|
+
if (this.peek() === 0x22) { // '"'
|
|
1062
|
+
// ignore the escaped closing quote
|
|
1063
|
+
this.ignore();
|
|
1064
|
+
this.next();
|
|
1065
|
+
this.ignore();
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
else if (r === 0x22) { // '"'
|
|
1069
|
+
// ignore closing quote
|
|
1070
|
+
this.ignore();
|
|
1071
|
+
}
|
|
1072
|
+
else {
|
|
1073
|
+
// handled by next state
|
|
1074
|
+
this.backup();
|
|
1075
|
+
}
|
|
1076
|
+
return this.lexInsideShortcode;
|
|
1077
|
+
}
|
|
1078
|
+
// lexShortCodeParamRawStringVal scans a raw string shortcode parameter value.
|
|
1079
|
+
lexShortCodeParamRawStringVal(typ) {
|
|
1080
|
+
let openBacktickFound = false;
|
|
1081
|
+
LOOP: for (;;) {
|
|
1082
|
+
const r = this.next();
|
|
1083
|
+
switch (r) {
|
|
1084
|
+
case 0x60: // '`'
|
|
1085
|
+
if (openBacktickFound) {
|
|
1086
|
+
this.backup();
|
|
1087
|
+
break LOOP;
|
|
1088
|
+
}
|
|
1089
|
+
else {
|
|
1090
|
+
openBacktickFound = true;
|
|
1091
|
+
this.ignore();
|
|
1092
|
+
}
|
|
1093
|
+
break;
|
|
1094
|
+
case eof:
|
|
1095
|
+
return this.errorf(`unterminated raw string in shortcode parameter-argument: '${new TextDecoder().decode(this.input.slice(this.start, this.pos))}'`);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
this.emitString(typ);
|
|
1099
|
+
this.next();
|
|
1100
|
+
this.ignore();
|
|
1101
|
+
return this.lexInsideShortcode;
|
|
1102
|
+
}
|
|
1103
|
+
lexDone() {
|
|
1104
|
+
// Done!
|
|
1105
|
+
if (this.pos > this.start) {
|
|
1106
|
+
this.emit(item_1.ItemType.tText);
|
|
1107
|
+
}
|
|
1108
|
+
this.emit(item_1.ItemType.tEOF);
|
|
1109
|
+
return null;
|
|
1110
|
+
}
|
|
1111
|
+
lexShortcodeRightDelim() {
|
|
1112
|
+
this.pos += this.currentRightShortcodeDelim().length;
|
|
1113
|
+
this.emit(this.lexerShortcodeState.currRightDelimItem);
|
|
1114
|
+
this.lexerShortcodeState.closingState = 0;
|
|
1115
|
+
return () => this.lexMainSection();
|
|
1116
|
+
}
|
|
1117
|
+
lexShortcodeValue() {
|
|
1118
|
+
const r = this.next();
|
|
1119
|
+
switch (r) {
|
|
1120
|
+
case eof:
|
|
1121
|
+
return this.errorf("unterminated quoted string in shortcode parameter");
|
|
1122
|
+
case 0x20: // ' '
|
|
1123
|
+
case 0x09: // '\t'
|
|
1124
|
+
this.ignore();
|
|
1125
|
+
return () => this.lexShortcodeValue();
|
|
1126
|
+
case 0x22: // '"'
|
|
1127
|
+
this.ignore();
|
|
1128
|
+
return () => this.lexShortcodeValueQuoted();
|
|
1129
|
+
default:
|
|
1130
|
+
this.backup();
|
|
1131
|
+
return () => this.lexShortcodeValueUnquoted();
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
lexShortcodeValueQuoted() {
|
|
1135
|
+
for (;;) {
|
|
1136
|
+
const r = this.next();
|
|
1137
|
+
switch (r) {
|
|
1138
|
+
case eof:
|
|
1139
|
+
return this.errorf("unterminated quoted string in shortcode parameter");
|
|
1140
|
+
case 0x5C: // '\'
|
|
1141
|
+
const peek = this.peek();
|
|
1142
|
+
if (peek === 0x22) { // '"'
|
|
1143
|
+
this.next();
|
|
1144
|
+
}
|
|
1145
|
+
break;
|
|
1146
|
+
case 0x22: // '"'
|
|
1147
|
+
this.backup();
|
|
1148
|
+
this.emitString(item_1.ItemType.tScParamVal);
|
|
1149
|
+
this.next();
|
|
1150
|
+
this.ignore();
|
|
1151
|
+
return this.lexInsideShortcode;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
isRightShortcodeDelim() {
|
|
1156
|
+
return this.hasPrefix(this.currentRightShortcodeDelim());
|
|
1157
|
+
}
|
|
1158
|
+
// lexComment scans a shortcode comment.
|
|
1159
|
+
lexComment() {
|
|
1160
|
+
const posRightComment = this.index(new Uint8Array([...rightComment, ...this.currentRightShortcodeDelim()]));
|
|
1161
|
+
if (posRightComment <= 1) {
|
|
1162
|
+
return this.errorf("comment must be closed");
|
|
1163
|
+
}
|
|
1164
|
+
// we emit all as text, except the comment markers
|
|
1165
|
+
this.emit(item_1.ItemType.tText);
|
|
1166
|
+
this.pos += leftComment.length;
|
|
1167
|
+
this.ignore();
|
|
1168
|
+
this.pos += posRightComment - leftComment.length;
|
|
1169
|
+
this.emit(item_1.ItemType.tText);
|
|
1170
|
+
this.pos += rightComment.length;
|
|
1171
|
+
this.ignore();
|
|
1172
|
+
this.pos += this.currentRightShortcodeDelim().length;
|
|
1173
|
+
this.emit(item_1.ItemType.tText);
|
|
1174
|
+
return this.lexMainSection;
|
|
1175
|
+
}
|
|
1176
|
+
// isComment checks if we're at the start of a comment
|
|
1177
|
+
isComment() {
|
|
1178
|
+
if (this.pos + 2 > this.input.length) {
|
|
1179
|
+
return false;
|
|
1180
|
+
}
|
|
1181
|
+
return this.input[this.pos] === 0x2F && this.input[this.pos + 1] === 0x2A; // /*
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
exports.pageLexer = pageLexer;
|
|
1185
|
+
function lexFrontMatterJSON(l) {
|
|
1186
|
+
// Include the left delimiter
|
|
1187
|
+
l.backup();
|
|
1188
|
+
let inQuote = false;
|
|
1189
|
+
let level = 0;
|
|
1190
|
+
for (;;) {
|
|
1191
|
+
const r = l.next();
|
|
1192
|
+
switch (true) {
|
|
1193
|
+
case r === eof:
|
|
1194
|
+
return l.errorf("unexpected EOF parsing JSON front matter");
|
|
1195
|
+
case r === 0x7B: // '{'
|
|
1196
|
+
if (!inQuote) {
|
|
1197
|
+
level++;
|
|
1198
|
+
}
|
|
1199
|
+
break;
|
|
1200
|
+
case r === 0x7D: // '}'
|
|
1201
|
+
if (!inQuote) {
|
|
1202
|
+
level--;
|
|
1203
|
+
}
|
|
1204
|
+
break;
|
|
1205
|
+
case r === 0x22: // '"'
|
|
1206
|
+
inQuote = !inQuote;
|
|
1207
|
+
break;
|
|
1208
|
+
case r === 0x5C: // '\\'
|
|
1209
|
+
// This may be an escaped quote. Make sure it's not marked as a
|
|
1210
|
+
// real one.
|
|
1211
|
+
l.next();
|
|
1212
|
+
break;
|
|
1213
|
+
}
|
|
1214
|
+
if (level === 0) {
|
|
1215
|
+
break;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
l.consumeCRLF();
|
|
1219
|
+
l.emit(item_1.ItemType.TypeFrontMatterJSON);
|
|
1220
|
+
return () => l.lexMainSection();
|
|
1221
|
+
}
|
|
1222
|
+
function lexFrontMatterOrgMode(l) {
|
|
1223
|
+
l.summaryDivider = summaryDividerOrg;
|
|
1224
|
+
l.backup();
|
|
1225
|
+
if (!l.hasPrefix(delimOrg)) {
|
|
1226
|
+
return () => l.lexMainSection();
|
|
1227
|
+
}
|
|
1228
|
+
// Read lines until we no longer see a #+ prefix
|
|
1229
|
+
LOOP: for (;;) {
|
|
1230
|
+
const r = l.next();
|
|
1231
|
+
switch (true) {
|
|
1232
|
+
case r === 0x0A: // '\n'
|
|
1233
|
+
if (!l.hasPrefix(delimOrg)) {
|
|
1234
|
+
break LOOP;
|
|
1235
|
+
}
|
|
1236
|
+
break;
|
|
1237
|
+
case r === eof:
|
|
1238
|
+
break LOOP;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
l.emit(item_1.ItemType.TypeFrontMatterORG);
|
|
1242
|
+
return () => l.lexMainSection();
|
|
1243
|
+
}
|
|
1244
|
+
// ParseBytes parses the page in b according to the given Config.
|
|
1245
|
+
function ParseBytes(b, cfg) {
|
|
1246
|
+
const l = parseBytes(b, cfg, lexIntroSection);
|
|
1247
|
+
return [l.items, l.err];
|
|
1248
|
+
}
|
|
1249
|
+
// ParseBytesMain parses b starting with the main section.
|
|
1250
|
+
function ParseBytesMain(b, cfg) {
|
|
1251
|
+
const l = parseBytes(b, cfg, lexMainSection);
|
|
1252
|
+
return [l.items, l.err];
|
|
1253
|
+
}
|
|
1254
|
+
function parseBytes(b, cfg, start) {
|
|
1255
|
+
const l = newPageLexer(b, start, cfg);
|
|
1256
|
+
return l.run();
|
|
1257
|
+
}
|
|
1258
|
+
// HasShortcode returns true if the given string contains a shortcode.
|
|
1259
|
+
function HasShortcode(s) {
|
|
1260
|
+
return s.includes("{{<") || s.includes("{{%");
|
|
1261
|
+
}
|
|
1262
|
+
// note: the input position here is normally 0 (start), but
|
|
1263
|
+
// can be set if position of first shortcode is known
|
|
1264
|
+
function newPageLexer(input, stateStart, cfg) {
|
|
1265
|
+
return new pageLexer(input, stateStart, cfg);
|
|
1266
|
+
}
|
|
1267
|
+
// Export the lexIntroSection function
|
|
1268
|
+
function lexIntroSection(l) {
|
|
1269
|
+
return l.lexIntroSection();
|
|
1270
|
+
}
|
|
1271
|
+
function lexMainSection(l) {
|
|
1272
|
+
return l.lexMainSection();
|
|
1273
|
+
}
|
|
1274
|
+
//# sourceMappingURL=pagelexer.js.map
|