mirror of
https://github.com/MillironX/nfdocs-parser.git
synced 2024-11-22 00:56:04 +00:00
Add error catching
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
This commit is contained in:
parent
6377725abc
commit
48c2d7a151
1 changed files with 17 additions and 11 deletions
|
@ -5,6 +5,7 @@ import yaml
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive
|
from docutils.parsers.rst import Directive
|
||||||
from docutils.parsers.rst import directives
|
from docutils.parsers.rst import directives
|
||||||
|
from sphinx.util import logging
|
||||||
|
|
||||||
def definition_type(signature):
|
def definition_type(signature):
|
||||||
# Returns "name", workflow|process|function
|
# Returns "name", workflow|process|function
|
||||||
|
@ -175,6 +176,7 @@ class NFDocs(Directive):
|
||||||
|
|
||||||
# Create a subsection for each block
|
# Create a subsection for each block
|
||||||
for proc_name, proc_docs in sorted_block_docs.items():
|
for proc_name, proc_docs in sorted_block_docs.items():
|
||||||
|
try:
|
||||||
# Create the section and heading
|
# Create the section and heading
|
||||||
proc_section = nodes.section()
|
proc_section = nodes.section()
|
||||||
proc_section += nodes.title(text=proc_name)
|
proc_section += nodes.title(text=proc_name)
|
||||||
|
@ -186,6 +188,10 @@ class NFDocs(Directive):
|
||||||
if met in proc_docs.keys():
|
if met in proc_docs.keys():
|
||||||
io_table = self.params_to_table(met, proc_docs[met])
|
io_table = self.params_to_table(met, proc_docs[met])
|
||||||
proc_section += io_table
|
proc_section += io_table
|
||||||
|
except:
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
logger.warning(f"Could not write docs for {proc_name}")
|
||||||
|
|
||||||
|
|
||||||
# Add the block section to the parent node
|
# Add the block section to the parent node
|
||||||
self.state_machine.document.note_implicit_target(proc_section)
|
self.state_machine.document.note_implicit_target(proc_section)
|
||||||
|
@ -200,5 +206,5 @@ class NFDocs(Directive):
|
||||||
def setup(app):
|
def setup(app):
|
||||||
app.add_directive('nfdocs', NFDocs)
|
app.add_directive('nfdocs', NFDocs)
|
||||||
return {
|
return {
|
||||||
"version": "0.1.0"
|
"version": "0.1.1"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue