Skip to content

Instantly share code, notes, and snippets.

@JadenGeller
Last active September 4, 2024 07:34
Show Gist options
  • Save JadenGeller/80b016f42a85f0f4b0f04cc92587f7ac to your computer and use it in GitHub Desktop.
Save JadenGeller/80b016f42a85f0f4b0f04cc92587f7ac to your computer and use it in GitHub Desktop.

Markdown Extensions

Component Directives

  • Component Directive: A code block that defines a custom component.
  • Info String: Starts with a $COMPONENT-NAME, which is @ followed by an $IDENTIFIER (e.g., @component-name).
  • Front Matter: Enclosed within --- delimiters, specifies component attributes.
  • Nesting: Use more backticks for the parent block than the child, respecting CommonMark.
  • Content: Valid markdown, which may nest component directives.

Examples

Single Component

```@component-name
---
key: value
---
# Your markdown content here
```

Nested Components

````@parent-component
---
parent-key: parent-value
---
# Parent content
```@child-component
---
child-key: child-value
---
# Child content
```
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment