Closed charego closed 4 years ago
The same problem is not seen with other extensions. For example when I add sphinxcontrib-blockdiag to the build, the manpage output contains "[image]", which is acceptable and definitely preferred to failing the build. I believe that output comes from sphinx/writers/manpage.py.
But neither this extension nor sphinxcontrib-blockdiag refers directly to that function (visit_image
), so I'm not sure how it all works. Any idea?
will look into this in a couple of days
I've added empty visit method for mans. It works, but asciinema tag in man files is currently simply removed.
Thanks! With v0.1.8 it works with a hosted video like .. asciinema:: 261648
.
Now I get this error on manpages with .. asciinema:: local_file.cast
:
> make doc
[ 21%] Built target pcre2-32
[ 21%] Built target CHECK-FISH-BUILD-VERSION-FILE
[ 94%] Built target fishlib
[ 97%] Built target fish_indent
[ 98%] Building man pages with Sphinx
Exception occurred:
File "/usr/local/lib/python3.7/site-packages/sphinx/builders/manpage.py", line 56, in get_target_uri
raise NoUri(docname, typ)
sphinx.errors.NoUri: ('tutorial', None)
The full traceback has been saved in /var/folders/j6/5pd6brws00n7k_6l6j_v8v840000gy/T/sphinx-err-3gy7dzlc.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make[3]: *** [CMakeFiles/sphinx-manpages] Error 2
make[2]: *** [CMakeFiles/sphinx-manpages.dir/all] Error 2
make[1]: *** [CMakeFiles/doc.dir/rule] Error 2
make: *** [doc] Error 2
I don't understand what's different about this extension. The blockdiag one doesn't reference manpages, so why should yours need to?
sphinx man builder is different from HTML builder, I've added a couple of fixes. should work now, check 0.1.9
Just re-tested .. asciinema:: local_file.cast
and while the NoUri problem is fixed for the man pages (thank you), now the generated HTML is
<script id="asciicast-None" src="https://asciinema.org/a/None.js" async>
sorry can't reproduce this. "asciicast-None" can appear only if sphinx raises NoUri exception for some reason. It's raised for man files (that's fine) but it shouldn't for HTML. could you please give a full example? (repo+branch+build command)
The directory structure for fish is like this:
.
├── build
│ ├── Makefile
│ └── user_doc
├── doc_src
│ ├── _static <-- on my branch, local_file.cast is here
│ ├── conf.py
│ └── tutorial.rst
I'm testing out the directive in tutorial.rst.
With valid path .. asciicast:: _static/local_file.cast
:
<script id="asciicast-None" src="https://asciinema.org/a/None.js" async></script>
With invalid path .. asciicast:: _static/invalid_file.cast
:
<script id="asciicast-_static/invalid_file.cast" src="https://asciinema.org/a/_static/invalid_file.cast.js" async>
Here's the full info you requested:
mkdir build && cd build
cmake ..
(usually I do cmake -DWITH_GETTEXT=OFF ..
to skip translations)make doc
open user_doc/html/tutorial.html
Just tried, got
<asciinema-player src="_casts/72dda36451c97b022e1eb358f22444fe/_static/local_file.cast"></asciinema-player>
sphinxcontrib.asciinema 0.1.9 sphinx 3.0.2 Python 3.8.2
<link rel="stylesheet" type="text/css" href="_static/asciinema-player_2.6.1.css" />
<link rel="stylesheet" type="text/css" href="_static/asciinema-custom.css" />
<script src="_static/asciinema-player_2.6.1.js"></script>
<asciinema-player src="_casts/72dda36451c97b022e1eb358f22444fe/_static/local_file.cast"></asciinema-player><p>Once installed, just type in <code class="docutils literal notranslate"><span class="pre">fish</span></code> into your current shell to try it out!</p>
that's inserted
Weird, ok. Let's close this. I'll open a new one if I figure out my problem.
Thanks for the help!
Thanks for the extension, it works great for HTML. I'm trying to build the fish-shell docs (https://github.com/charego/fish-shell/commit/85ff7f89a56abb963a53efcf4c5667fe0051ebd9) and it builds fine when manpages are excluded.
But when manpages are enabled again, I get this error:
Full error: