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