summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/src/runtime.ts (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-03-12Add `experimental.headingIdCompat` flag (#13352)Gravatar Chris Swithinbank 1-4/+8
* Add `experimental.headingIdCompat` option schema & types * Markdown and MDX support * Markdoc support * Add changeset * Fix missing argument in Markdoc integration * Improve JSDoc comment Co-authored-by: Matt Kane <m@mk.gg> * Refactor to avoid global context object in Markdoc * Minor changeset tweak * Make `rehypeHeadingIds()` argument optional for backwards compatibility * Add doc comment to `rehypeHeadingIds()` * Document rehype plugin usage in changeset --------- Co-authored-by: Matt Kane <m@mk.gg>
2024-08-27chore: enable `useImportType` rule (#11848)Gravatar Emanuele Stoppa 1-1/+1
2024-08-08update formatter config (#11640)Gravatar Darius 1-8/+8
* update formatter config * format --------- Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2023-08-16feat: unflag experimental.assets (#7921)Gravatar Erika 1-2/+1
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2023-08-08Remove support for Node 16 (#7780)Gravatar Erika 1-2/+1
2023-07-24[ci] formatGravatar bholmesdev 1-16/+26
2023-07-24Add "allowHTML" option for Markdoc with HTML parsing/processing (#7597)Gravatar Alex Sherwin 1-7/+29
* 7576 - initial support for HTML inside Markdoc. This uses htmlparser2 to perform a pure token transform/mutation on the markdown-it tokens, replacing the original raw HTML string tokens with a richer set of tokens per HTML node, and in the process Markdoc tags are interleaved in the resulting token graph at the appropriate locations This removes the legacy config of the @astrojs/markdoc integration entirely (suggested by @bholmesdev) and introduces a new type for options to be specified in the astro config, initially, with just the new "enableHTML" option When "enableHTML" is *not* enabled (the default), the behavior of the entire @astrojs/markdoc integration should remain functionally equivalent to before this change * 7576 - fixed issues with whitespace preservation also: * cleaned up " to ' for astro project preferred linting * made the html rendering test fixture use a dynamic path * 7576 - detailed nested HTML test coverage * 7576 - component + HTML interleaved tests * 7576 - fix lint problems from previous changes * 7576 - some commentary * 7576 - file naming, refactor html under imports, package.json exports definition for html * 7576 * move out of extensions dir, remove export * cdata handling changes * 7576 * inline license from third party code * cleanup test class copy of HTML output * remove // third party indicators for imports (clarification: not third party code, just a indicator this group of imports is third party) * 7576 - fixed test before/after for DRY'ness * 7576 - no need to React-ify HTML attribute case * 7576 - rename "enableHTML" option to "allowHTML" * Added Markdoc allowHTML feature changeset * 7576 - updated README with allowHTML info * 7576 - fixed changeset typo * 7576 - minor edits based on PR feedback for docs * 7576 - minor edits based on PR feedback for docs
2023-06-27fix: ts-expect-error (#7505)Gravatar Ben Holmes 1-0/+1
2023-06-27[ci] formatGravatar bholmesdev 1-6/+2
2023-06-27feat: New Markdoc `render` API (#7468)Gravatar Ben Holmes 1-15/+85
* feat: URL support for markdoc tags * refactor: move to separate file * feat: support URL for markdoc nodes * feat: support `extends` with URL * chore: changeset * fix: bad AstroMarkdocConfig type * fix: experimentalAssetsConfig missing * fix: correctly merge runtime config * chore: formatting * deps: astro internal helpers * feat: component() util, new astro bundling * chore: remove now unused code * todo: missing hint * fix: import.meta.url type error * wip: test nested collection calls * feat: resolve paths from project root * refactor: move getHeadings() to runtime module * fix: broken collectHeadings * test: update fixture configs * chore: remove suggestions. Out of scope! * fix: throw outside esbuild * refactor: shuffle imports around * Revert "wip: test nested collection calls" This reverts commit 9354b3cf9222fd65b974b0cddf4e7a95ab3cd2b2. * chore: revert back to mjs config * chore: add jsdocs to stringified helpers * fix: restore updated changeset --------- Co-authored-by: bholmesdev <bholmesdev@gmail.com>
2023-05-31[ci] formatGravatar bholmesdev 1-1/+0
2023-05-31Markdoc asset bleed, second try (#7185)Gravatar Ben Holmes 1-6/+2
* Revert "revert: markdoc asset bleed (#7178)" This reverts commit 57e65d247f67de61bcc3a585c2254feb61ed2e74. * fix: missing result param on `renderUniqueStylesheet` * test: bundled styles (fails!) * fix: use `type: 'external'` for links * fix: split Astro components from markdoc config * test: style bleed (it fails...) * chore: remove unused util * fix: revert entry change * Stop traversing the graph when you encounter a propagated asset * chore: cleanup unused `entry` prop * refactor: add isPropagatedAssetsMod check * chore: remove unused import * chore: changeset * Normalize path using vite * Update packages/integrations/markdoc/src/index.ts Co-authored-by: Ben Holmes <hey@bholmes.dev> --------- Co-authored-by: Matthew Phillips <matthew@skypack.dev> Co-authored-by: bholmesdev <bholmesdev@gmail.com> Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
2023-05-30Markdoc - remove `$entry` variable (#7244)Gravatar Ben Holmes 1-6/+2
* refactor: remove entry prop from `getRenderModule()` * refactor: remove `$entry` from markdoc * test: update entry-prop -> variables test * refactor: unify `getEntryConfigByExt` * chore: clean up shared content / data get logic * docs: update `$entry` recommendation * chore: rename entry-prop -> variables * chore: changeset * chore: missed a spot
2023-05-25[ci] formatGravatar bholmesdev 1-1/+0
2023-05-25Markdoc - improve syntax highlighting support (#7209)Gravatar Ben Holmes 1-12/+18
* feat: prism and shiki support, with better exports! * chore: update tests * chore: fix lock * chore: add prism test * chore: remove `async` from prism * docs: update syntax highlight readme * chore: changeset * edit: remove `await` from prism docs * chore: update old changest with new shiki instructions * fix: add trailing newline on ts-expect-error * refactor: resolve promises internally * docs: remove `await` from shiki examples
2023-05-24[ci] formatGravatar bholmesdev 1-1/+1
2023-05-24Markdoc - Shiki (#7187)Gravatar Ben Holmes 1-10/+34
* chore: remove unused util * chore: changeset * deps: shiki * wip: first stab at shiki markdoc config * feat: get shiki working! * refactor: return HTML string directly from transform * chore: move shiki to markdoc dev dep * refactor: use async cache with clear docs on why * test: transform units with Shiki config options * refactor: switch to `extends` model * refactor: nodes/ -> extensions/ * feat: raise friendly error for Promise extensions * docs: README * chore: lint * chore: dead file * chore: lowercase for fuzzy find please * fix: bad ctx spread * chore: clean up cache, add shiki imp error * chore: add shiki to optional peer deps * chore: hoist those consts * docs: more explicit "install shiki now please" Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * oops bad find and replace * chore: update changeset * nit: period haunts me --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-05-19Fix: Heading ID CI flakiness (#7141)Gravatar Ben Holmes 1-14/+32
* feat: use `ctx` object instead of leaky global * test: heading IDs stale caches * chore: changeset
2023-05-17[ci] formatGravatar bholmesdev 1-2/+2
2023-05-17[Markdoc] `headings` and heading IDs (#7095)Gravatar Ben Holmes 1-0/+78
* deps: markdown-remark * wip: heading-ids function * chore: add `@astrojs/markdoc` to external * feat: `headings` support * fix: allow `render` config on headings * fix: nonexistent `userConfig` * test: headings, toc, astro component render * docs: README * chore: changeset * refactor: expose Markdoc helpers from runtime * fix: bad named exports (commonjsssss) * refactor: defaultNodes -> nodes * deps: github-slugger * fix: reset slugger cache on each render * fix: bad astroNodes import * docs: explain headingSlugger export * docs: add back double stringify comment * chore: bump to minor for internal exports change