Skip to content

Commit 01a4cac

Browse files
authored
Merge pull request #7 from render-engine/kjaymiller-update-readme
Update README.md
2 parents 6b8919f + a41d07f commit 01a4cac

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

README.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,50 @@
11
# Render Engine Parsers
22

3-
The page parser system used for making content for Render Engine
3+
The page parser system used for making content for Render Engine. Parsers are used to parse the content of a page and convert it to HTML. The parser is specified in the page attributes as `Parser`.
44

5-
## Parsers
5+
This is meant to be used by Render Enging but can be used as a base dependency for building custom Render Engine Parsers.
66

7-
Parsers are used to parse the content of a page and convert it to HTML. The parser is specified in the page attributes as `Parser`.
7+
## Using Frontmatter
88

9-
The default parser is the `BasePageParser` which processes markdown and passes the content thru as plain text.
9+
[Frontmatter](https://github.com/eyeseast/python-frontmatter) is used to pull in attributes from a generated page.
10+
11+
Some pages will be looking for information that is provided in the frontmatter. All of the attributes defined can be used in the template (which itself can also be defined in the frontmatter or the class itself.
12+
13+
> **NOTE**
14+
> These attributes **CANNOT** be used in the content itself, but you can use them in the template generation.
15+
16+
```md
17+
---
18+
title: "Spider-Man"
19+
name: "Peter Parker"
20+
superhero: "Spider-Man"
21+
---
22+
23+
<h2>I'm your friendly neighborhood Spiderman</h2>
24+
25+
<p>I was bitten by a radioactive spider and now I fight crime.</p>
26+
```
27+
28+
If you generate the page with the following template
29+
30+
```html
31+
<h1>About {{superhero}}</h1>
32+
<h2>Real Name: {{alias}}</h2>
33+
34+
<div>
35+
{{content}}
36+
</div>
37+
```
38+
39+
it would generate.
40+
41+
```html
42+
<h1>About Spider-Man</h1>
43+
<h2>Alias: Peter Parker</h2>
44+
45+
<div>
46+
<h2>I'm your friendly neighborhood Spiderman</h2>
47+
48+
<p>I was bitten by a radioactive spider and now I fight crime.</p>
49+
</div>
50+
```

0 commit comments

Comments
 (0)