diff --git a/.changeset/mdoc-extension-support.md b/.changeset/mdoc-extension-support.md new file mode 100644 index 0000000..8671e5c --- /dev/null +++ b/.changeset/mdoc-extension-support.md @@ -0,0 +1,5 @@ +--- +"@neuledge/context": patch +--- + +Recognize `.mdoc` (Markdoc) files when scanning a repository for documentation. Sites built on Astro Starlight (e.g. Nx) ship docs in this format, and they were previously skipped. diff --git a/packages/context/src/build.ts b/packages/context/src/build.ts index 4666fce..1651c44 100644 --- a/packages/context/src/build.ts +++ b/packages/context/src/build.ts @@ -313,7 +313,7 @@ export function parseMarkdown(source: string, filePath: string): ParsedDoc { filePath .split("/") .pop() - ?.replace(/\.(md|mdx|qmd|rmd|adoc|rst)$/, "") || + ?.replace(/\.(md|mdx|mdoc|qmd|rmd|adoc|rst)$/, "") || "Untitled"; // Remove frontmatter and JSX import statements from source for extraction diff --git a/packages/context/src/git.ts b/packages/context/src/git.ts index 099a622..db19327 100755 --- a/packages/context/src/git.ts +++ b/packages/context/src/git.ts @@ -117,6 +117,7 @@ const FIXTURE_SUFFIXES = ["expect", "test", "spec"]; const DOCUMENTATION_EXTENSIONS = [ ".md", ".mdx", + ".mdoc", ".qmd", ".rmd", ".adoc", diff --git a/registry/npm/nx.yaml b/registry/npm/nx.yaml index 351764d..4383c60 100644 --- a/registry/npm/nx.yaml +++ b/registry/npm/nx.yaml @@ -3,7 +3,16 @@ description: "Smart, fast, and extensible build system for monorepos" repository: https://github.com/nrwl/nx versions: + # Nx 22.7.0 moved docs from `docs/` to `astro-docs/src/content/docs/` + # (Markdoc-based Astro site) and dropped the top-level `docs/` folder. + - min_version: "22.7.0" + source: + type: git + url: https://github.com/nrwl/nx + docs_path: astro-docs/src/content/docs + tag_pattern: "{version}" - min_version: "17.0.0" + max_version: "22.7.0" source: type: git url: https://github.com/nrwl/nx