[Flang][Docs] Fix warnings when building docs.
Following warning were seen with recommonmark(0.5.0) and sphinx(1.8.5). `parser.py:75: UserWarning: Container node skipped: type=document warn("Container node skipped: type={0}".format(mdnode.t))` The warnings are due to an issue in recommonmark's(a python package) older versions. A better solution is to use the latest version of recommonmark(>=0.6.0) to avoid these issue in the first place. This patch fixes the warnings for older versions. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D91117
This commit is contained in:
parent
c981fa169a
commit
7282d9e170
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
import sys, os
|
import sys, os
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
from recommonmark.parser import CommonMarkParser
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
|
@ -19,6 +20,13 @@ from datetime import date
|
||||||
|
|
||||||
# -- General configuration -----------------------------------------------------
|
# -- General configuration -----------------------------------------------------
|
||||||
|
|
||||||
|
# https://github.com/readthedocs/recommonmark/issues/177
|
||||||
|
#Method used to remove the warning message.
|
||||||
|
class CustomCommonMarkParser(CommonMarkParser):
|
||||||
|
def visit_document(self, node):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
#needs_sphinx = '1.0'
|
#needs_sphinx = '1.0'
|
||||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||||
|
@ -44,7 +52,7 @@ else:
|
||||||
# This requires 0.5 or later.
|
# This requires 0.5 or later.
|
||||||
extensions.append('recommonmark')
|
extensions.append('recommonmark')
|
||||||
else:
|
else:
|
||||||
source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'}
|
source_parsers = {'.md': CustomCommonMarkParser}
|
||||||
source_suffix['.md'] = 'markdown'
|
source_suffix['.md'] = 'markdown'
|
||||||
extensions.append('sphinx_markdown_tables')
|
extensions.append('sphinx_markdown_tables')
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ Flang is LLVM's Fortran frontend
|
||||||
OptionComparison
|
OptionComparison
|
||||||
ParserCombinators
|
ParserCombinators
|
||||||
RuntimeDescriptor
|
RuntimeDescriptor
|
||||||
|
RuntimeTypeInfo
|
||||||
Calls
|
Calls
|
||||||
Character
|
Character
|
||||||
ArrayComposition
|
ArrayComposition
|
||||||
|
|
Loading…
Reference in New Issue