-
Notifications
You must be signed in to change notification settings - Fork 3
(docs) Split Markdown page into separate basics and rich media guides #1903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -101,3 +101,4 @@ exceptions: | |
| - SSR | ||
| - SSG | ||
| - REST | ||
| - MDN | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -80,3 +80,5 @@ exceptions: | |
| - fern.config.json | ||
| - Font Awesome | ||
| - MCP | ||
| - LaTeX | ||
| - MDN | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
68 changes: 68 additions & 0 deletions
68
fern/products/docs/pages/component-library/writing-content/markdown-basics.mdx
This file contains hidden or 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,68 @@ | ||
| --- | ||
| title: Markdown basics | ||
| description: Use Markdown and MDX to add content to your Fern documentation site, including headers, components, and links. | ||
| --- | ||
|
|
||
| Learn how to use Markdown and MDX to add content to your documentation, including headers, components, and links. | ||
|
|
||
| <Note title="Terminology"> | ||
| Throughout this documentation, "Markdown" refers to both Markdown and MDX. [MDX](https://mdxjs.com/) is a version of Markdown, extended to allow the use of JSX components. | ||
| </Note> | ||
|
|
||
| ## Add Markdown or MDX pages | ||
|
|
||
| Add pages manually to your documentation by creating Markdown (`.md`) or MDX (`.mdx`) files. New to Markdown? See [Markdown Guide: Getting started](https://www.markdownguide.org/getting-started/). | ||
|
|
||
| Place your pages inside your `fern/` folder and link to them from your [navigation settings](/learn/docs/building-your-docs/navigation) in the `docs.yml` file. | ||
|
|
||
| In the example below, the MDX files are inside a folder named `pages/`. | ||
|
|
||
| <CodeBlock title='Example folder structure'> | ||
| ```bash | ||
| fern/ | ||
| ├─ fern.config.json | ||
| ├─ docs.yml | ||
| └─ pages/ | ||
| ├─ welcome.mdx | ||
| └─ quickstart.mdx | ||
| ``` | ||
| </CodeBlock> | ||
|
|
||
| <CodeBlock title='docs.yml'> | ||
| ```yml | ||
| navigation: | ||
| - section: Overview | ||
| contents: | ||
| - page: Welcome | ||
| path: ./pages/welcome.mdx | ||
| - page: Quickstart | ||
| path: ./pages/quickstart.mdx | ||
| ``` | ||
| </CodeBlock> | ||
|
|
||
| ## Page header | ||
|
|
||
| Fern automatically generates the `<h1>` page header for each page from `docs.yml`. For example, here's the `docs.yml` entry that maps the page you are reading now: | ||
| ```yml | ||
| - page: Write Markdown content | ||
| path: ./docs/pages/fern-docs/content/write-markdown.mdx | ||
| ``` | ||
| The value for `page` is used as the content of the top `<h1>` element of this page. Thus, when adding content to your Markdown pages, begin with `<h2>` instead of `<h1>`. | ||
|
|
||
| ## Fern components | ||
|
|
||
| Fern has a built-in component library you can use in Markdown. [Explore the components.](/learn/docs/content/components/overview) | ||
|
|
||
| ## Links in Markdown | ||
|
|
||
| ### Link target | ||
| When clicked, links to relative URLs open in the same tab, whereas links to absolute URLs open in a new browser tab. | ||
|
|
||
| ### Link format | ||
| Use a `/` character to begin a relative URL to another page on your docs site. This routes to the `url` defined in your `docs.yml` file, such as `example-docs.buildwithfern.com`. For example, if you want to link to `https://example-docs.buildwithfern.com/overview/introduction`, you can write the link in Markdown as follows: | ||
|
|
||
| <CodeBlock title='Relative link example'> | ||
| ```mdx | ||
| Read the [Introduction](/learn/overview/introduction). | ||
| ``` | ||
| </CodeBlock> | ||
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[FernStyles.Current] Avoid time-relative terms like 'now' that become outdated