You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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`.
4
4
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.
6
6
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
8
8
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>
0 commit comments