Как я могу включить файл plantuml в reStructuredText с помощью Sphinx - PullRequest
0 голосов
/ 12 февраля 2020

У меня есть файл plantuml composite.puml со следующим содержимым:

package composite {
  class Letter {
    + __init__(char: str)
    # print_this_before()
  }

И я пытаюсь включить это в документ reStructuredText (который использует плагин sphinxcontrib.plantuml):

.. uml::
    .. include:: composite.puml

Но это вызывает исключение при запуске make html

Running Sphinx v2.4.1
/Users/jve23941
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 10 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] structural_patterns/composite
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:51: WARNING: Bullet list ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:52: WARNING: Definition list ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:54: WARNING: Unexpected indentation.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:57: WARNING: Bullet list ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:59: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:61: WARNING: Unexpected indentation.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:63: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:65: WARNING: Unexpected indentation.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:65: WARNING: Inline emphasis start-string without end-string.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:66: WARNING: Bullet list ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:67: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:69: WARNING: Unexpected indentation.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:69: WARNING: Inline emphasis start-string without end-string.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:70: WARNING: Inline emphasis start-string without end-string.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:71: WARNING: Bullet list ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:72: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:73: WARNING: Definition list ends without a blank line; unexpected unindent.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:73: WARNING: Inline substitution_reference start-string without end-string.
/Users/jve23941/workspace/python-design-patterns/docs/structural_patterns/composite.rst:73: WARNING: Undefined substitution referenced: "> LetterComposite Sentence --".
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] structural_patterns/index
generating indices...  genindex py-modindexdone
highlighting module code... [100%] python_design_patterns.composite
writing additional pages...  search/Users/jve23941/workspace/python-design-patterns/.venv/lib/python3.8/site-packages/sphinx_rtd_theme/search.html:21: RemovedInSphinx30Warning: To modify script_files in the theme is deprecated. Please insert a <script> tag directly in your theme instead.
  {% endblock %}
done
copying static files... ... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 19 warnings.

The HTML pages are in _build/html.

Я думаю, это потому, что Sphinx не может обрабатывать контент, который я помещаю в файл plantuml.

Как включить файл plantuml, чтобы он работал

1 Ответ

2 голосов
/ 12 февраля 2020

Разве включение внешнего файла не должно выглядеть следующим образом?

.. uml:: composite.puml
...