readme
This commit is contained in:
parent
21f11dcfd7
commit
7bb0e3a072
10
readme.md
10
readme.md
@ -50,13 +50,13 @@ async function main() {
|
||||
}
|
||||
```
|
||||
|
||||
### Handling Frontmatter
|
||||
### Handling front matter
|
||||
|
||||
```ts
|
||||
import { process_frontmatter } from '@doc-utils/markdown2html';
|
||||
|
||||
const raw_content = `---
|
||||
title: Example Markdown with Frontmatter
|
||||
title: Example Markdown with front matter
|
||||
foo:
|
||||
- bar
|
||||
- baz
|
||||
@ -67,7 +67,7 @@ foo:
|
||||
|
||||
const { frontmatter, markdown } = process_frontmatter(raw_content);
|
||||
|
||||
console.log(frontmatter.title); // "Example Markdown with Frontmatter"
|
||||
console.log(frontmatter.title); // "Example Markdown with front matter"
|
||||
console.log(frontmatter.foo); // [ "bar", "baz" ]
|
||||
console.log(markdown); // "\n# This is some markdown\n"
|
||||
```
|
||||
@ -80,11 +80,11 @@ console.log(markdown); // "\n# This is some markdown\n"
|
||||
echo '# This is some markdown' | ./bin/markdown2html --base-url 'https://example.com' > output.html
|
||||
```
|
||||
|
||||
### Handling Frontmatter
|
||||
### Handling front matter
|
||||
|
||||
```bash
|
||||
filecontents="---
|
||||
title: Example Markdown with Frontmatter
|
||||
title: Example Markdown with front matter
|
||||
foo:
|
||||
- bar
|
||||
- baz
|
||||
|
Loading…
x
Reference in New Issue
Block a user