mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
* Stubbed out TemplateView for rendering markdown files * Added a BoostRenderer class to parse the markdown files to support the first iteration of a youtube shortcode and also a Pygments renderer for code blocks. * Added default styles for some common markup so the rendered markdown looks better. The pygments renderer is set to use Solarized Dark right now because that’s the closest I see that matches the design of the site. This can be changed in the class.
17 lines
406 B
Python
17 lines
406 B
Python
import frontmatter
|
|
from core.boostrenderer import BoostRenderer
|
|
from mistletoe import Document
|
|
|
|
|
|
def process_md(filename):
|
|
with open(filename) as f:
|
|
post = frontmatter.load(f)
|
|
metadata = post.metadata
|
|
content = post.content
|
|
|
|
with BoostRenderer() as renderer:
|
|
doc = Document(content)
|
|
rendered = renderer.render(doc)
|
|
|
|
return metadata, rendered
|