Hello Daniele,
you misunderstand what html_static_path and :doc: are doing.

html_static_path is intentioned for files like styles, fonts, icons. During the 
build, files end up in _static/. Usually, a HTML theme expects its resources 
here (e.g. <link rel="stylesheet" type="text/css" 
href="../_static/mytheme.css">)

:doc: is for creating links to Sphinx documents (files that are processed and 
built). The path is without the file extension. E.g., :doc:`installing/windows` 
will be a link to installing/windows.rst.

For the purposes, you ask, more suitable is html_extra_path 
(https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_extra_path).
 It copies extra paths to the output root.

1. Add
   
      html_extra_path = ["_pages"]

   to conf.py

2. Create _pages/ in the root (where is conf.py)

3. Create my.html here.

4. In any Sphinx document, use hyperlink reference 
(https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#embedded-uris-and-aliases),
 e.g.
   
   See `extra document <my.html>`_.

--
Matt
https://techwriter.documatt.com

> On 21. 12. 2021, at 9:11, Daniele Zambelli <daniele.zambe...@gmail.com> wrote:
> 
> Hi Sphinx Users!
> 
> I'm using Sphinx to build a site that allows you to view html pages
> produced with tools other than Sphinx.
> 
> I have placed these documents as a subdirectory of _static.
> 
> In config.py I have the following line:
> 
> html_static_path = ['_static',]
> 
> In source I have the following directory tree:
> ...
> └── source
>    ├── ...
>    ├── 04link.rst
>    ├── conf.py
>    ├── img
>    │   ├── ...
>    ├── index.rst
>    ├── _static
>    │   └── mypages
>    │       └── provaesp
>    │           ├── provaesp.css
>    │           └── provaesp.html
>    └── _templates
> ...
> 
> and in the file "04link.rst" the instruction:
> 
> :doc:`Html with an expression <_static/mypages/provaesp/provaesp>`.
> 
> In compilation I get:
> ...
> /.../source/04link.rst:65: WARNING: unknown document:
> _static/mypages/provaesp/provaesp
> ...
> 
> In the produced html file I don't get the link to the provesp.html file.
> 
> Where am I wrong?
> 
> Thanks for your attention.
> 
> -- 
> 
> Daniele
> 
> www.fugamatematica.blogspot.com
> 
>    giusto!
>    nel verso
>    forse è perché non guardiamo le cose
>    Quando non ci capiamo,
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sphinx-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sphinx-users/CAE512rMKhpvs9-a7L1qep74MJqE1JxmTnh%3DezN4pVyf61Aww3w%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/90CD89B7-9B65-4CF7-B0BB-2A1CEE231B19%40documatt.com.

Reply via email to