Closed kevung closed 3 years ago
Template files should be in one of the directories in the templates_path
configuration setting. See https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-templates_path for details.
I have proposed an update to the documentation in #77 to explain this.
Thanks for pointing out the gap in our documentation!
Hi @dhellmann , Thank you so much for your quick and precise answer.
I confirm that your indications are sufficient and I successfully could test your extension (by creating the sphinx template folder and adding to the templates_path
variable). I think I can close this issue.
Thanks again and take care.
I am sorry to come back to this issue, but I don't get it. Should I put the absolute template path in template_paths?
My config.py:
project = "Test"
extensions = ['myst_parser','sphinxcontrib.datatemplates']
templates_path = ['./templates']
html_theme = "sphinxdoc"
The template is called like this:
.. datatemplate:json:: status.json
:template: status.tmpl
My project looks like this:
documentation/
├── README.rst
├── docs
│ ├── Makefile
│ ├── build
│ ├── make.bat
│ └── source
└── templates
└── status.tmpl
According to the template_path
docs:
Relative paths are taken as relative to the configuration directory.
So, you need to move your templates
directory to the same place as your conf.py
file.
Thank you for the answer. I did not get that the configuration directory is where conf.py
is.
Trying to debug #75 , I have created a simple example with in the same folder
test.rst
test.json
Test