Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Octomerger Bot cedfe4dd59
repo sync (#4236)
4 years ago
..
01e52046f0
migrate away from AWS S3 (#17669)
4 years ago
4484068e01
Move render-content code to this repo (#16544)
4 years ago
01e52046f0
migrate away from AWS S3 (#17669)
4 years ago
39e0e0dda1
Use Liquidjs instead of Liquid (#16743)
4 years ago
39e0e0dda1
Use Liquidjs instead of Liquid (#16743)
4 years ago
cedfe4dd59
repo sync (#4236)
4 years ago

README.md

You have to be logged in to leave a comment. Sign In

Markdown and Liquid rendering pipeline.

Usage

const renderContent = require('.')

const html = await renderContent(`
# Beep
{{ foo }}
`, {
  foo: 'bar'
})

Creates:

<h1 id="beep"><a href="#beep">Beep</a></h1>
<p>bar</p>

API

renderContent(markdown, context = {}, options = {})

Render a string of markdown with optional context. Returns a Promise.

Liquid will be looking for includes in ${process.cwd()}/includes.

Options:

  • encodeEntities: Encode html entities. Default: false.
  • fileName: File name for debugging purposes.
  • textOnly: Output text instead of html using cheerio.

.liquid

The Liquid instance used internally.

Code block headers

You can add a header to code blocks by adding the {:copy} annotation after the code fences:

```js{:copy}
const copyMe = true
```

This renders:

image

The un-highlighted text is available as button.js-btn-copy's data-clipboard-text attribute.

Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...