diff --git a/ablog/__init__.py b/ablog/__init__.py index cf9946b2..f7255c0b 100755 --- a/ablog/__init__.py +++ b/ablog/__init__.py @@ -7,6 +7,7 @@ from .blog import CONFIG, Blog from .post import ( + CheckFrontMatter, PostDirective, PostListDirective, UpdateDirective, @@ -17,7 +18,6 @@ process_postlist, process_posts, purge_posts, - CheckFrontMatter, ) from .version import version as __version__ @@ -100,8 +100,7 @@ def setup(app): def config_inited(app, config): app.config.templates_path.append(get_html_templates_path()) - app.config.matched_blog_posts = [os.path.splitext(ii)[0] - for ii in glob(config.blog_post_pattern)] + app.config.matched_blog_posts = [os.path.splitext(ii)[0] for ii in glob(config.blog_post_pattern)] def get_html_templates_path(): diff --git a/ablog/post.py b/ablog/post.py index d5aaa76b..3ecf495d 100644 --- a/ablog/post.py +++ b/ablog/post.py @@ -12,8 +12,8 @@ from docutils.parsers.rst.directives.admonitions import BaseAdmonition from feedgen.feed import FeedGenerator from sphinx.locale import _ -from sphinx.util.nodes import set_source_info from sphinx.transforms import SphinxTransform +from sphinx.util.nodes import set_source_info import ablog @@ -152,7 +152,7 @@ def run(self): class CheckFrontMatter(SphinxTransform): """Check the doctree for frontmatter meant for a blog post. - + This is mutually-exclusive with the PostDirective. Only one much be used.""" # Priority before 880 so that it runs before the `doctree-read` event @@ -186,7 +186,7 @@ def apply(self): elif isinstance(option_spec[key], directives.flag): new_val = True metadata[key] = new_val - + node = PostNode() node.document = self.document node = _update_post_node(node, metadata, [])