@sphinxjs/extractor-astro
v0.1.0
Published
Astro `.astro` file parser for `@sphinxjs/extractor`. Handles frontmatter scripts and expression blocks inside Astro component templates.
Downloads
328
Readme
@sphinxjs/extractor-astro
Astro .astro file parser for @sphinxjs/extractor. Handles frontmatter scripts and expression blocks inside Astro component templates.
Install
pnpm add -D @sphinxjs/extractor-astroRequires astro ^5.0.0 as a peer dependency.
Usage
Install alongside @sphinxjs/extractor. The extractor will detect and use this parser automatically via a dynamic import, no manual wiring required.
pnpm add -D @sphinxjs/extractor @sphinxjs/extractor-astroAPI
AstroParser
Extends gettext-extractor's Parser to walk the @astrojs/compiler AST. Handles:
- Frontmatter, the
---script block at the top of.astrofiles - Expression nodes,
{gettext("…")}template expressions
astroTypescriptExtractor(jsParser, callee, options)
Factory function that produces an IAstroExtractorFunction delegating to a JS parser for TypeScript expression content. Used internally by @sphinxjs/extractor.
