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

How to ignore tags directive on a specific page #105

Open
RemDelaporteMathurin opened this issue Jul 25, 2024 · 7 comments
Open

How to ignore tags directive on a specific page #105

RemDelaporteMathurin opened this issue Jul 25, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@RemDelaporteMathurin
Copy link

We added a page to explain how to add tags to pages with two example tags (tag1 and tag2) however, these tags show up in the tag list and we would like to avoid this.

Is there a way to ignore the {tags} directive in one specific page?

@story645
Copy link
Collaborator

story645 commented Jul 25, 2024

My rough guess is this can maybe be implemented as add an 'ignore_file' config value that then gets parsed as part of this statement:

https://github.com/melissawm/sphinx-tags/blob/main/src%2Fsphinx_tags%2F__init__.py#L373-L377

@melissawm
Copy link
Owner

This is a limitation of how the parsing is done right now, and the work on #101 should fix it, but ignoring the page seems like a reasonable solution while that's not finished. Thanks for the issue!

@rekomodo
Copy link

rekomodo commented Jul 26, 2024

My rough guess is this can maybe be implemented as add an 'ignore_file' config value that then gets parsed as part of this statement:

https://github.com/melissawm/sphinx-tags/blob/main/src%2Fsphinx_tags%2F__init__.py#L373-L377

I tried this for our case and this approach ignores the page altogether, which makes sense since it's a sphinx setting, not a sphinx-tags setting (we wanted to have the page and ignore the tags).

Our hacky workaround was to replace the a in {tags} for the homoglyph а to avoid detection by the parser
https://github.com/rekomodo/V-V-report/blob/e67161f2444af45c9c1e4beff467b4795ad2765d/report/how_to.md?plain=1#L49-L51

Thanks for the support!

@story645
Copy link
Collaborator

which makes sense since it's a sphinx setting, not a sphinx-tags setting (we wanted to have the page and ignore the tags).

Sorry, what I meant was add a new sphinx-tags config value ignore-this-page that then gets used as part of that lookup, not use the sphinx ignore config.

@melissawm
Copy link
Owner

I will try to submit a PR for this later this week, and I'm happy to do a minor release for it unless I can fix it definitively as part of #101 sooner than that. If you can do it before then, I'm happy to accept any contributions!

@espwangning
Copy link

espwangning commented Aug 2, 2024

Thanks for the initiative and support!

In my documentation, I use the .. only:: directive together with .. tag::, for example

.. only:: v1.0
   
    .. tags:: Fixed

.. only:: v1.1
   
    .. tags:: Not fixed

When generating the tag list, it would be good for me if irrelevant .. tag:: can be ignored. Probably this can also be achieved with "new sphinx-tags config value ignore-this-page".

@story645
Copy link
Collaborator

story645 commented Aug 2, 2024

When generating the tag list, it would be good for me if irrelevant .. tag:: can be ignored. Probably this can also be achieved with "new sphinx-tags config value ignore-this-page".

I think that would need a different sphinx-tags config #81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants