sphinx-contrib / plantuml

BSD 2-Clause "Simplified" License
117 stars 44 forks source link

not able to to include a uml #96

Closed ananttickoo closed 1 month ago

ananttickoo commented 1 month ago

Hi

I am not able to include the uml file in sphinx. I have tried to put the file in same folder as "smf.rst" and at pathe at with index.rst is present. Bothe time i get error

.. uml:: smf-saegwsess.uml

source/docs/concepts/smf.rst:52: WARNING: PlantUML file "smf-saegwsess.uml" cannot be read: [Errno 2] No such file or directory: '/home/xxxx/sphinx/source/smf-saegwsess.uml' [docutils]

Directory structure

source ├── 23.1.x ├── _static ├── _templates │   ├── versioning.html │   └── versions.html ├── architecture.png ├── conf.py ├── docs │   ├── commands │   ├── concepts │   │   ├── smf-saegwsess.uml │   │   └── smf.rst │   └── outputs ├── images │   └── architecture.png ├── index.rst └── uml └── smf_architechture.uml

It compiles only when i keep a copy of "smf-saegwsess.uml" in same folder as index.rst and smf.rst . Even in this case the file is added as text and image is not complied.

One more thing i call smf.rst in index.rst . So "smf-saegwsess.uml" is included post "smf.rst" is included.

.. include:: docs/concepts/smf.rst

yuja commented 1 month ago

As the error message suggests, the path has to be relative to the source directory, not to the document file? This option is copied from the graphviz extension. https://www.sphinx-doc.org/en/master/usage/extensions/graphviz.html

ananttickoo commented 1 month ago

@yuja thank for hint

so if i change the path from "uml/sample.uml" to "/uml/sample.uml" then it works. to me which is odd as "/uml/sample.uml" starts with "/"

yuja commented 1 month ago

That's indeed odd. Apparently, relative paths are resolved relative to the document directory, sorry. Maybe you had path resolution problem because of .. include:: .. (which I think would expand the file content there.) Anyway, absolute paths should work in that case.