From 5a1f9e044acfdc6e053655c598a10853a6a580ca Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Wed, 13 Jan 2021 21:36:29 -0800 Subject: [PATCH] refactor: Adjust to latest commit of simple plugin Now reiterates significantly less code from the simple plugin. Also, adjusted the default for extract_standard_markdown when copy_standard_markdown is true. --- mkdocs_semiliterate/plugin.py | 97 ++++++++++++++--------------------- setup.cfg | 2 +- tests/sites.bash | 2 +- 3 files changed, 41 insertions(+), 60 deletions(-) diff --git a/mkdocs_semiliterate/plugin.py b/mkdocs_semiliterate/plugin.py index a11636e..78a9bbc 100644 --- a/mkdocs_semiliterate/plugin.py +++ b/mkdocs_semiliterate/plugin.py @@ -12,7 +12,7 @@ of the `simple` plugin.) from mkdocs import utils from mkdocs.config import config_options -from mkdocs_simple_plugin.plugin import SimplePlugin, StreamExtract, LazyFile +from mkdocs_simple_plugin.plugin import SimplePlugin, StreamExtract import re import yaml @@ -62,17 +62,14 @@ parameters makes it easier to extract "front-matter" style documentation from files. It also means that a plain `{! file.md !}` directive will simply incorporate the full contents of `file.md`. """ - self.start_hot = False + start_hot = False if 'start' not in kwargs: kwargs['start'] = 'dummy' - self.start_hot = True + start_hot = True super().__init__(input_stream, output_stream, **kwargs) - - def extract(self): - if self.start_hot: + if start_hot: self.extracting = True self.start = False - super().extract() include_open = re.compile(r'''(? site/croppedindex.html rm site/index.html