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 --- ChangeLog | 5 +++++ README.md | 3 +++ requirements.txt | 3 +++ src/pyssg/pyssg.py | 25 ++++++++++++++++++++++--- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c9f56f..e77d59e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ CHANGES ======= +v0.5.7 +------ + +* fix bug on prev/next objects of page + v0.5.6 ------ diff --git a/README.md b/README.md index ab0fe9b..d4d1f12 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,9 @@ This program uses the base [`markdown` syntax](https://daringfireball.net/projec - SmartyPants. - Table of Contents. - WikiLinks. +- [yafg - Yet Another Figure Generator](https://git.sr.ht/~ferruck/yafg) +- [markdown.highlight](https://github.com/ribalba/markdown.highlight) +- [Markdown Checklist](https://github.com/FND/markdown-checklist) ## Installation diff --git a/requirements.txt b/requirements.txt index 248a5ba..c62a881 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,5 @@ markdown==3.3.4 jinja2==3.0.1 +yafg==0.3 +MarkdownHighlight==0.1.3 +markdown-checklist==0.4.3 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