Closed FredM67 closed 1 year ago
@FredM67 Thank you for using this extension. It worked fine in my environment. Please refer to the following steps.
pip install sphinx-new-tab-link
% python -V
Python 3.11.4
% pip list
Package Version
----------------------------- ---------
alabaster 0.7.13
Babel 2.13.0
certifi 2023.7.22
charset-normalizer 3.3.0
docutils 0.20.1
idna 3.4
imagesize 1.4.1
Jinja2 3.1.2
MarkupSafe 2.1.3
packaging 23.2
pip 23.2.1
Pygments 2.16.1
requests 2.31.0
setuptools 68.2.2
snowballstemmer 2.2.0
Sphinx 7.2.6
sphinx-new-tab-link 0.1.1
sphinxcontrib-applehelp 1.0.7
sphinxcontrib-devhelp 1.0.5
sphinxcontrib-htmlhelp 2.0.4
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.6
sphinxcontrib-serializinghtml 1.1.9
urllib3 2.0.6
% sphinx-quickstart \
--sep \
-p issue6 \
-a nikkie \
-l fr \
-r ''
.
├── build/
├── source/
│ ├── _static/
│ ├── _templates/
│ ├── conf.py
│ └── index.rst
├── Makefile
└── make.bat
source/conf.py
extensions = [
"sphinx_new_tab_link",
]
source/index.rst
`Wikipédia <https://fr.wikipedia.org/wiki/Circuit_imprim%C3%A9>`_
Run make html
build/html/index.html
<a class="reference external" href="https://fr.wikipedia.org/wiki/Circuit_imprim%C3%A9" rel="noopener noreferrer" target="_blank">Wikipédia</a>
Well, that's quite "strange"... I've done all these steps ! Except I've much more/other extensions active ! I'll try on a local Ubuntu machine !
Thanks for your reply.
Except I've much more/other extensions active !
If you could share the extensions
from your conf.py, that might be a clue to the solution.
Sure... here's the repo in case you want to look more in details: https://github.com/FredM67/Mk2PVRouter In my config.py, I've these extensions:
extensions = [
# githubpages just adds a .nojekyll file
'sphinx.ext.githubpages',
'sphinx.ext.autosummary',
'sphinx.ext.todo',
'sphinx_lesson',
# 'sphinx.ext.mathjax',
# 'sphinx-mathjax-offline',
'sphinx.ext.imgmath',
'sphinx_rtd_theme_ext_color_contrast',
'sphinx_copybutton',
'sphinx_simplepdf',
'sphinxcontrib.drawio',
'sphinx.ext.autosectionlabel',
# 'hoverxref.extension',
'sphinx_new_tab_link',
'sphinx_last_updated_by_git',
]
I've put the external link at 2 places, just to be sure, it was not related to the "glossary" directive. Once in glossary.rst
, once at the end of index.rst
Thank you for sharing your repository. I'll investigate if this issue can be reproduced.
Thx a lot... on this repo, it's for sure 100% reproducible :(
@FredM67 Interestingly, this issue did not reproduce in my environment. Please let me know if you notice anything about the following procedure.
latex
(seems low priority)$ git clone git@github.com:FredM67/Mk2PVRouter.git
$ cd full-Mk2PVRouter
$ python -m venv venv --upgrade-deps
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt
(venv) $ make html
_build/html/index.html
<p><a class="reference external" href="https://fr.wikipedia.org/wiki/Circuit_imprim%C3%A9" rel="noopener noreferrer" target="_blank">Wikipédia</a></p>
_build/html/glossary.html
<p class="last"><a class="reference external" href="https://fr.wikipedia.org/wiki/Pince_amp%C3%A8rem%C3%A9trique" rel="noopener noreferrer" target="_blank">Wikipédia, Pince ampèremétrique</a></p>
<p class="last"><a class="reference external" href="https://fr.wikipedia.org/wiki/Photocoupleur" rel="noopener noreferrer" target="_blank">Wikipédia, Photocoupleur</a></p>
<p class="last"><a class="reference external" href="https://fr.wikipedia.org/wiki/Circuit_imprim%C3%A9" rel="noopener noreferrer" target="_blank">Wikipédia, Circuit imprimé</a></p>
Well, until now, I didn't have time to check on a local Ubuntu machine. I'll do that this week-end, I've a Ubuntu virtual machine. I let you know about the results.
Well, I've tried on my virtual machine .... it's working fine ! So, it means, something is wrong in the GitHub environment ! But what ?!?
Is there a way to put some debug traces in your extension ?
I've found what's wrong.
When compiling on github, I call make dirhtml
which is for sure not recognized in your translator list !
Am I right?
I see, you use make dirhtml
https://github.com/FredM67/Mk2PVRouter/blob/4c7385e9155ca38097002a0d2509f4eed7127d89/.github/workflows/documentation.yaml#L89
and this extensions did not support the builder yet.
Thank you very much your pull request!
Thanks for the pr. Try https://pypi.org/project/sphinx-new-tab-link/0.2.0/
Works like a charm !
I've added the extension in my config.py, but after build, I get
<a class="reference external" href="https://fr.wikipedia.org/wiki/Circuit_imprim%C3%A9">Wikipédia</a>
for my external link !Source in rst file is