Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepend prefix to all ids to guarantee that they are unique #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wlupton
Copy link

@wlupton wlupton commented Jun 6, 2020

I was including documentation for more than one python problem in the same file, and found that the ids were not unique, e.g.:

<div class="section" id="Named Arguments">

The suggested fix derives a prefix from func, ref etc. and passes it to ensureUniqueIDs(), which then unconditionally prefixes it to all ids to give, e.g.:

<div class="section" id="module-bin.onusim.argparser Named Arguments">

I realise it might be better to use a separate (new) function for doing this rather than overloading ensureUniqueIDs(), and would be happy to make this change.

@laf0rge
Copy link

laf0rge commented Apr 4, 2021

Is there any news about this/ Patch has been around for 9 months without any positive or negative feedback.

I would definitely find it useful to have uinique ids/labels as I'm getting the following when documenting many Argparse instances in one .rst document:

/space/home/laforge/projects/git/pysim/docs/shell.rst:94: WARNING: duplicate label positional arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:94: WARNING: duplicate label named arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:101: WARNING: duplicate label positional arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:101: WARNING: duplicate label named arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:108: WARNING: duplicate label positional arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:108: WARNING: duplicate label named arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:115: WARNING: duplicate label positional arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:115: WARNING: duplicate label named arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:139: WARNING: duplicate label named arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:146: WARNING: duplicate label named arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:168: WARNING: duplicate label positional arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:168: WARNING: duplicate label named arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:175: WARNING: duplicate label positional arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:182: WARNING: duplicate label positional arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst
/space/home/laforge/projects/git/pysim/docs/shell.rst:190: WARNING: duplicate label positional arguments, other instance in /space/home/laforge/projects/git/pysim/docs/shell.rst

@wlupton wlupton force-pushed the feature/ensure-unique-ids branch from 5591a2c to 2c554c4 Compare February 16, 2022 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants