From 1476b8daddeb65866476d98ea951e45dbe48321d Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Mon, 7 Jun 2021 22:56:45 -0600 Subject: add new extensions --- src/pyssg/pyssg.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pyssg/pyssg.py b/src/pyssg/pyssg.py index 3c75e3c..0978e63 100644 --- a/src/pyssg/pyssg.py +++ b/src/pyssg/pyssg.py @@ -1,10 +1,14 @@ import os import shutil +from importlib.resources import path from argparse import ArgumentParser, Namespace from typing import Union + from jinja2 import Environment, FileSystemLoader from markdown import Markdown -from importlib.resources import path +import yafg +from MarkdownHighlight.highlight import HighlightExtension +from markdown_checklist.extension import ChecklistExtension from .configuration import Configuration from .database import Database @@ -148,8 +152,23 @@ def main() -> None: trim_blocks=True, lstrip_blocks=True) - md: Markdown = Markdown(extensions=['extra', 'meta', 'sane_lists', - 'smarty', 'toc', 'wikilinks'], + + # md extensions + exts: list = ['extra', + 'meta', + 'sane_lists', + 'smarty', + 'toc', + 'wikilinks', + yafg.YafgExtension(stripTitle=True, + figureClass="", + figcaptionClass="", + figureNumbering=False, + figureNumberClass="number", + figureNumberText="Figure"), + HighlightExtension, + ChecklistExtension()] + md: Markdown = Markdown(extensions=exts, output_format='html5') builder: Builder = Builder(config, env, db, md) builder.build() -- cgit v1.2.3-70-g09d2