-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cli): redo docs validation so that we are forced to add fern ch…
…eck rules (#4771)
- Loading branch information
Showing
14 changed files
with
600 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## 0.43.7 | ||
**`(fix):`** The `valid-markdown` rule has been updated to try and parse the markdown file into a | ||
valid AST. If the file fails to parse, `fern check` will log an error as well | ||
as the path to the markdown. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { parseImagePaths, replaceImagePathsAndUrls } from "./parseImagePaths"; | ||
export { replaceReferencedMarkdown } from "./replaceReferencedMarkdown"; | ||
export { replaceReferencedCode } from "./replaceReferencedCode"; | ||
export { parseMarkdownToTree } from "./parseMarkdownToTree"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/cli/docs-markdown-utils/src/parseMarkdownToTree.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { fromMarkdown } from "mdast-util-from-markdown"; | ||
import { Root } from "mdast-util-from-markdown/lib"; | ||
import { mdxFromMarkdown } from "mdast-util-mdx"; | ||
import { mdx } from "micromark-extension-mdx"; | ||
|
||
export function parseMarkdownToTree(content: string): Root { | ||
return fromMarkdown(content, { | ||
extensions: [mdx()], | ||
mdastExtensions: [mdxFromMarkdown()] | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.