summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-02-08feat(markdoc): Add support for using a custom component for images (#9958)Gravatar Erika 1-21/+28
* feat(markdoc): Add support for using a custom component for images * chore: changeset * test: add test * Update .changeset/shaggy-spies-sit.md Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> --------- Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-02-07Use eslint-plugin-regexp (#9993)Gravatar Bjorn Lu 2-3/+5
2023-11-30[ci] formatGravatar Bjorn Lu 1-1/+1
2023-11-17Support Vite 5 (#9122)Gravatar Bjorn Lu 1-3/+2
2023-11-14[ci] formatGravatar bluwy 1-1/+1
2023-11-14Refactor shikiji syntax highlighting code (#9083)Gravatar Bjorn Lu 1-100/+5
2023-10-27Fix: Markdoc Integration build when root folder contains spaces (#8759)Gravatar Luca Di Gianventura 1-2/+2
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
2023-10-24feat(markdoc): allowIndentation integration option (#8802)Gravatar AndyClifford 2-1/+6
2023-10-12Use shikiji (#8502)Gravatar Bjorn Lu 1-18/+30
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-09-13config: migrate us to moduleResolution: 'node16' (#8519)Gravatar Erika 2-2/+3
2023-08-21Remove pre-shiki v0.14 theme names (#8169)Gravatar Bjorn Lu 1-21/+0
2023-08-16feat: unflag experimental.assets (#7921)Gravatar Erika 3-21/+13
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2023-08-08feat: upper case the name of the endpoints (#7783)Gravatar Emanuele Stoppa 1-1/+1
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2023-08-08chore: fix rebase problemsGravatar Emanuele Stoppa 1-1/+0
2023-08-08Remove support for Node 16 (#7780)Gravatar Erika 4-16/+8
2023-07-24[ci] formatGravatar bholmesdev 11-570/+565
2023-07-24Add "allowHTML" option for Markdoc with HTML parsing/processing (#7597)Gravatar Alex Sherwin 11-28/+752
* 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-07-20Fix organize-imports-cli with satisfies operator (#7727)Gravatar Bjorn Lu 2-2/+2
2023-07-18[ci] formatGravatar Princesseuh 1-1/+1
2023-07-18Fix/markdoc assets (#7706)Gravatar Erika 1-3/+3
2023-07-07Fix: Hyphens breaking Markdoc tags (#7599)Gravatar Ben Holmes 1-3/+10
* fix: handle hyphens in tag names * test: add hyphen in test suite * chore: changeset
2023-07-07Fix: Markdoc v0.4.0 docs (#7593)Gravatar Ben Holmes 1-1/+1
* docs: add docs link to markdoc error * docs: add named exports guide to README * chore: changeset * edit: no like so Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * edit: exposed as named exports Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> --------- Co-authored-by: bholmesdev <bholmesdev@gmail.com> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2023-07-03feat: use typescript-eslint@v6's reworked configs (#7425)Gravatar Josh Goldberg ✨ 5-10/+2
2023-06-27fix: ts-expect-error (#7505)Gravatar Ben Holmes 1-0/+1
2023-06-27[ci] formatGravatar bholmesdev 4-16/+12
2023-06-27feat: New Markdoc `render` API (#7468)Gravatar Ben Holmes 6-293/+411
* 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-06-27feat: restart server on markdoc config change (#7467)Gravatar Ben Holmes 2-19/+15
* deps: vite-plugin-restart * feat: restart on markdoc config change * chore: changeset * chore: roll our own restarter! * deps: remove vite-plugin-restart * refactor: use good enough option
2023-06-26fix(errors): Deprecate error codes (#7347)Gravatar Erika 1-14/+1
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
2023-06-10[ci] formatGravatar bholmesdev 1-1/+1
2023-06-10Fix Markdoc cloudflare errors (#7351)Gravatar Ben Holmes 2-18/+16
* fix: move `node:` libs out of utils * fix: node -> default * chore: remove kleur from markdoc ex (why was this there??) * chore: lock * chore: changeset
2023-06-06[ci] formatGravatar bholmesdev 2-4/+4
2023-06-06Fix: Markdoc type errors (#7311)Gravatar Ben Holmes 4-17/+38
* fix: config, prism, shiki exports * fix: type error for `render` property * chore: use `.ts` files in select tests for type checks * fix: type error on shiki() promise * chore: changeset
2023-05-31[ci] formatGravatar bholmesdev 3-5/+4
2023-05-31Markdoc asset bleed, second try (#7185)Gravatar Ben Holmes 4-30/+126
* 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-31Markdoc: strip HTML comments from output (#7224)Gravatar Ben Holmes 1-1/+8
* feat: strip HTML comments from output * chore: changeset
2023-05-30[ci] formatGravatar bholmesdev 1-1/+1
2023-05-30Markdoc - remove `$entry` variable (#7244)Gravatar Ben Holmes 2-11/+12
* 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 2-3/+2
2023-05-25Markdoc - improve syntax highlighting support (#7209)Gravatar Ben Holmes 5-33/+62
* 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-25fix: formatting comment (#7206)Gravatar Emanuele Stoppa 1-1/+3
2023-05-24[ci] formatGravatar bholmesdev 3-5/+5
2023-05-24Markdoc - Shiki (#7187)Gravatar Ben Holmes 6-29/+210
* 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-23revert: markdoc asset bleed (#7178)Gravatar Ben Holmes 2-54/+12
* revert: markdoc asset bleed * chore: changeset
2023-05-22[Markdoc] Fix global asset bleed (#6758)Gravatar Ben Holmes 2-12/+54
* wip: propagatedAssets flag per-component * Propagate in TreeNode * fix: remove unused inject comment * feat: make asset propagation an integration opt-in * fix: remove crawlGraph stopper * wip: logs to understand what's happening * SSR mdoc files in dev * feat: add astroPropagatedAssets flag with vite * chore: remove console logs * chore: cleanup hasContentFlag * fix: set handlePropagation default for legacy integrations * chore: changeset * temp: silence acorn type error * chore: revert pnpm-lock changes * fix: check correct flag * We need to handle propagation on markdown because of layouts * Remove use of renderStyleElement * Fix heading tests * Fix merge conflict * typeof function * Switch the check * Add comment on injection detection regexp --------- Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2023-05-19[ci] formatGravatar bholmesdev 1-1/+1
2023-05-19Fix: Heading ID CI flakiness (#7141)Gravatar Ben Holmes 4-27/+65
* feat: use `ctx` object instead of leaky global * test: heading IDs stale caches * chore: changeset
2023-05-17Data collections and references (#6850)Gravatar Ben Holmes 1-1/+1
* feat: add generated lookup-map * feat: wire up fast getEntryBySlug() lookup * fix: consider frontmatter slugs * chore: changeset * chore: lint no-shadow * fix: revert bad rootRelativePath change * chore: better var name * refactor: generated `.json` to in-memory map * chore: removed unneeded await Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> * chore: removed unneeded await Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> * Revert "chore: removed unneeded await" This reverts commit 1b0a8b00c2eca631a1b1005c256509295a414eef. * fix: bad `GetEntryImport` type * chore: remove unused variable * refactor: for -> Promise.all * refactor: replace duplicate parseSlug * refactor: add cache layer * Revert "refactor: add cache layer" This reverts commit 1c3bfdc6b32450fab56f80cc840193b6a46c8776. * feat: json collection POC * wip: add test json file * wip: playing with api ideas * refactor: extract getCollectionName * feat: add defineDataCollection * refactor: variable destructure * wip: basic data entry pipeline * chore: revert fixture playing * wip: basic entry array parser * feat: basic data type gen * chore: add with-data playground * feat: add error when `defineDataCollection()` isn't used * fix: missing error message * feat: data collections are here! * wip: play with data query APIs * feat: reference() util! * fix: Markdoc `$entry` variable * play: add reference util with markdoc * chore: delete console logs * feat: `src/data/`! * feat: reference() errors * fix: handle hoisted schema parse errors * fix: reload config and invalid on collection changes * feat: separate maps for content and data entries * feat: new `reference()` API that fixes type inference * feat: support `defineCollection()` for data config * fix: defineCollection `type` inferenenceπinference * chore: lock * feat: getCollection() for everything! * feat: get full entry access from reference() * chore: changeset * wip: type error on acorn? * chore: lint * chore: add slugger to data ID processing * chore: astro/zod -> zod * chore: example version * chore: remove slugifier from data id * chore: remove dead getDataCollection * chore: remove dead defineDataCollection * fix: bad collection import * chore: lock * feat: add data collections to lookup map * refactor: stop resolving data from reference * feat: introduce getEntry and new reference() * fix: update config loader * fix: reference() type * feat: test self references (they work 🎉) * fix: use `slug` for content references * fix: bad getEntry content type * chroe: remove console logs * fix: strict null checks on with-data * feat: add getEntries for ref arrays * chore: fix type hints for reference strings * chore: change to type never for clarity * play: try getEntries * Return to "everything goes in `src/content/` This reverts commit cc637ec6db4fc23afab585df5f240b7f7c0abc8a. * fix: remove old function * chore: update to AstroErrors * chore: remove unused fixture files * play: names * deps: js-yaml * feat: data collection YAML with error handling * refactor: remove console log * refactor: code cleanup * fix: allow mixed content to pass through glob imports * chore: move lookupMap util to virtual-mod * refactor: new lookupMap logic, better errors * chore: change MixedContent title * refactor: remove unneeded try / catch * fix: use `ws.send` for type gen errors * fix: bubble `ws.send` errors from astro sync * refactor: revert verbose astroContentCollectionEntry * fix: bad with-data package name * fix: bad virtual mod flag * chore: remove with-data playground * test: data collection authors * test: translations data collection * fix: add `.yml` support * refactor: mix in `.yaml` just for fun * refactor: i18n -> translations * chore: content-collection-references fixture * chore: bad lockfile * fix: bad ContentLookupMap import * chore: revert back to astroContentCollectionEntry * test: collection references * fix: bad error code override * chore: remove unused asset * test: sync errors * chore: remove stray console log * chore: lock * chore: revert with-markdoc changes * chore: doc error states, remove bad merge code * chore: remove bad `as any` * chore: lint * chore: inline ContentLookupMap comments * chore: settings -> config * fix: put back `defineCollection()` * fix: entry.slug for get content collection * chore: update get-entry-type tests * docs: totally shorten "missing a `type`" Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * docs: truncate share a `schema` Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * chore: add `test:unit` and `test:unit:match`to base * chore: update changeset * refactor: cleanup runtime types and inline comments * nit: [0] instead of shift() * refactor: `getRelativeEntryPath()` util * chore: capitalized Collections for test:match * nit: ?? viteId on split * nit: separate Params obj * chore: add try / catch on readFile * nit: `const data` * chore: clean up data collection exceptions * nit: `?? ''` for search params * chore: remove TODO on hoisted error --------- Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-05-17[ci] formatGravatar bholmesdev 4-8/+9
2023-05-17[Markdoc] `headings` and heading IDs (#7095)Gravatar Ben Holmes 7-51/+171
* 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
2023-05-09[Markdoc] Validation and debugging improvements (#7045)Gravatar Ben Holmes 3-19/+51
* feat: better validation logs * chore: add warning to restart server on config chnage * feat: expose Markdoc global from markdoc/config * docs: update `nodes` reference * chore: changeset * docs: simplify headings explainer * chore: ignore eslint log errors * fix: make legacyConfig prop optional