-
Notifications
You must be signed in to change notification settings - Fork 168
[WIP] Update IA and summary #95
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
title: Configuration | ||
description: Config objects let you pass options to Markdoc.transform. | ||
--- | ||
|
||
# {% $markdoc.frontmatter.title %} | ||
|
||
This table outlines the various options you can pass to `Markdoc.transform`. Each option adjusts how a document is [transformed](/docs/render#transform) and [rendered](/docs/render#render). | ||
|
||
{% table %} | ||
|
||
- Key | ||
- Type | ||
- Description | ||
|
||
--- | ||
|
||
- [`nodes`](/docs/nodes) | ||
- {% code %}{ [nodeType: [NodeType](/docs/nodes#built-in-nodes)]: [Schema](https://github.com/markdoc/markdoc/blob/6bcb8a0c48a181ca9df577534d841280646cea09/src/types.ts#L94-L101) }{% /code%} | ||
- Register [custom nodes](/docs/nodes) in your schema | ||
|
||
--- | ||
|
||
- [`tags`](/docs/tags) | ||
- {% code %}{ [tagName: string]: [Schema](https://github.com/markdoc/markdoc/blob/6bcb8a0c48a181ca9df577534d841280646cea09/src/types.ts#L94-L101) }{% /code%} | ||
- Register [custom tags](/docs/tags) in your schema | ||
|
||
--- | ||
|
||
- [`variables`](/docs/variables) | ||
- `{ [variableName: string]: any }` | ||
- Register [variables](/docs/variables) to use in your document | ||
|
||
--- | ||
|
||
- [`functions`](/docs/functions) | ||
- {% code %}{ [functionName: string]: [ConfigFunction](https://github.com/markdoc/markdoc/blob/6bcb8a0c48a181ca9df577534d841280646cea09/src/types.ts#L31-L36) }{% /code %} | ||
- Register [custom functions](/docs/functions) to use in your document | ||
|
||
--- | ||
|
||
- [`partials`](/docs/partials) | ||
- `{ [partialPath: string]: Ast.Node }` | ||
- Register reusable pieces of content to used by the [`partial` tag](/docs/partials) | ||
|
||
{% /table %} | ||
|
||
### Full example | ||
|
||
Here's an example of what a Markdoc config would look like: | ||
|
||
```js | ||
const config = { | ||
nodes: { | ||
heading: { | ||
render: 'Heading', | ||
attributes: { | ||
id: { type: String }, | ||
level: { type: Number } | ||
} | ||
} | ||
}, | ||
tags: { | ||
callout: { | ||
render: 'Callout', | ||
attributes: { | ||
title: { | ||
type: String | ||
} | ||
} | ||
} | ||
}, | ||
variables: { | ||
name: 'Dr. Mark', | ||
frontmatter: { | ||
title: 'Configuration options' | ||
} | ||
}, | ||
functions: { | ||
includes: { | ||
transform(parameters, config) { | ||
const [array, value] = Object.values(parameters); | ||
|
||
return Array.isArray(array) ? array.includes(value) : false; | ||
} | ||
} | ||
}, | ||
partials: { | ||
'header.md': Markdoc.parse(`# My header`) | ||
} | ||
}; | ||
|
||
const content = Markdoc.transform(ast, config); | ||
``` |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Common examples | ||
title: Customization examples | ||
description: | ||
--- | ||
|
||
|
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.
I strongly think we should keep
/docs/render
in the first section. With that, I think "Core concepts" is a better fit, but I could be convinced about "Core features".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.
Either way, for changing concepts like this, I think we need some outside data (even if it's a collection of anecdata), before changing IA stuff.
A lot of this comes down to personal opinion and personal learning styles, so we want to be more objective.