Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #78 from docascode/yitian/suppress-todo
Browse files Browse the repository at this point in the history
Add a new directive to suppress useless TODO information
  • Loading branch information
killa1218 committed Aug 27, 2018
2 parents eb345bb + ce79d47 commit 1f9749c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docfx_yaml/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,17 @@ def run(self):
return_nodes.append(node)

return return_nodes

class TodoDirective(Directive):
"""
Class to ignore todo directive.
"""

# Enable content in the directive
has_content = True

# Directive class must override run function.
def run(self):
return_nodes = []

return return_nodes
3 changes: 2 additions & 1 deletion docfx_yaml/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from .utils import transform_node, transform_string
from .settings import API_ROOT
from .monkeypatch import patch_docfields
from .directives import RemarksDirective
from .directives import RemarksDirective, TodoDirective
from .nodes import remarks


Expand Down Expand Up @@ -706,6 +706,7 @@ def setup(app):

app.add_node(remarks, html = (remarks.visit_remarks, remarks.depart_remarks))
app.add_directive('remarks', RemarksDirective)
app.add_directive('todo', TodoDirective)

app.connect('builder-inited', build_init)
app.connect('autodoc-process-docstring', process_docstring)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name='sphinx-docfx-yaml',
version='1.2.41',
version='1.2.42',
author='Eric Holscher',
author_email='eric@ericholscher.com',
url='https://github.com/ericholscher/sphinx-docfx-yaml',
Expand Down

0 comments on commit 1f9749c

Please sign in to comment.