MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

Warning "local id not found in doc" in translated docs since MyST-parser 0.19.0

Open n-peugnet opened this issue 8 months ago • 5 comments

What version of myst-parser are you using?

>=0.19.0

What version dependencies are you using?

Any version compatible with the version of MyST Parser used.

What operating system are you using?

Linux

Describe the Bug

Since MyST-parser, I get the local id not found in doc when I compile the docs in another language, but the links are correctly produced.

/home/nicolas/GoogleDrive/Projets/Club1/docs/cgu.md:48:<translated>:1: WARNING: local id not found in doc 'info/general': 'demandes-et-incidents' [myst.xref_missing]
/home/nicolas/GoogleDrive/Projets/Club1/docs/faq.md:29: WARNING: local id not found in doc 'info/general': 'identifiant' [myst.xref_missing]
/home/nicolas/GoogleDrive/Projets/Club1/docs/faq.md:37: WARNING: local id not found in doc 'services/email': 'sous-adresses' [myst.xref_missing]
/home/nicolas/GoogleDrive/Projets/Club1/docs/info/espace-personnel.md:47:<translated>:1: WARNING: local id not found in doc 'services/web': 'dossier-static' [myst.xref_missing]
/home/nicolas/GoogleDrive/Projets/Club1/docs/info/infrastructure-materielle.md:131:<translated>:1: WARNING: local id not found in doc 'info/general': 'sauvegardes' [myst.xref_missing]
/home/nicolas/GoogleDrive/Projets/Club1/docs/info/politique-de-vie-privee.md:15:<translated>:1: WARNING: local id not found in doc 'info/general': 'sauvegardes' [myst.xref_missing]
/home/nicolas/GoogleDrive/Projets/Club1/docs/outils/newsletter.md:77: WARNING: local id not found in doc 'outils/aliases': 'modifier-les-alias-de-réception' [myst.xref_missing]
/home/nicolas/GoogleDrive/Projets/Club1/docs/tutos/mes-premiers-pas-sur-le-web.md:112: WARNING: local id not found in doc 'services/web': 'index-des-fichiers' [myst.xref_missing]
/home/nicolas/GoogleDrive/Projets/Club1/docs/tutos/premiere-connexion-ssh.md:8:<translated>:1: WARNING: local id not found in doc 'info/general': 'demandes-et-incidents' [myst.xref_missing]

These happen only with links with anchors and the setting myst_heading_anchors enabled. But some of these links do not produce warnings:

$ grep -nrIE "\.md#" [^_]*
cgu.md:50:un [signalement](./info/general.md#demandes-et-incidents) est le bienvenu.
faq.md:29:Il n'y a rien de prévu actuellement pour permettre aux membres de modifier leur [identifiant CLUB1](./info/general.md#identifiant).
faq.md:39:avec une adresse principale et toutes ses [sous-adresses](services/email.md#sous-adresses).
info/politique-de-vie-privee.md:7:Nos engagement dans les [CGU](../cgu.md#nos-engagements)
info/politique-de-vie-privee.md:15:- Les [sauvegardes](./general.md#sauvegardes) sont, elles, chiffrées.
info/espace-personnel.md:48:car il permet de [publier des sites Web](../services/web.md#dossier-static).
info/infrastructure-materielle.md:131:Disque dur de 2To 5600tr/min. Non pris en charge par les [sauvegardes](./general.md#sauvegardes).
outils/newsletter.md:78:voir la section [Modifier les alias de réception](./aliases.md#modifier-les-alias-de-réception).
outils/forum.md:30:que votre mot de passe sera mis à jour si vous [modifiez celui de votre compte CLUB1](../faq.md#comment-modifier-mon-mot-de-passe-de-membre-club1-)
tutos/premiere-connexion-ssh.md:10:Si vous rencontrez un problème, la section "[](../info/general.md#demandes-et-incidents)"
tutos/mes-premiers-pas-sur-le-web.md:113:Voir les [services liés au dossier static](../services/web.md#index-des-fichiers)

These warning do not happen with untranslated version.

Expected Behavior

There should be no warnings.

To Reproduce

git clone -b issue https://github.com/club-1/docs
cd docs
make html/en

I could not make a smaller reproducer as the bug only happens chen there are a lot of files somehow. For instance on the branch no-issue I removed almost all the files but the problem does not arise.

n-peugnet avatar Dec 16 '23 11:12 n-peugnet

This seem to be duplicate of #839

thorge avatar Jan 12 '24 11:01 thorge

This seem to be duplicate of #839

I don't think so, but I think you have the same as mine. This one is specifically about this issue with translated documents only. I don't have the issue with untranslated documents.

n-peugnet avatar Jan 12 '24 11:01 n-peugnet

By the way @thorge, if you have a way to reproduce this issue on a smaller/simpler repository than mine, it would probably help locating the issue.

n-peugnet avatar Jan 12 '24 16:01 n-peugnet

This seem to be duplicate of #839

I don't think so, but I think you have the same as mine. This one is specifically about this issue with translated documents only. I don't have the issue with untranslated documents.

This works for me, thanks you @n-peugnet

macagua avatar Feb 22 '24 08:02 macagua

I can not reproduce this on our latest main branch, but I can still reproduce it consistently on the issue branch.

As it is related to translations, I tested the issue branch with https://github.com/executablebooks/MyST-Parser/compare/master...n-peugnet:MyST-Parser:add-parse-inline and https://github.com/sphinx-doc/sphinx/pull/12238 and I have no warning any-more.

n-peugnet avatar Apr 07 '24 19:04 n-peugnet