melissawm / sphinx-tags

A tiny Sphinx extension that implements blog-style tags for documentation.
https://sphinx-tags.readthedocs.io/en/latest/
MIT License
44 stars 11 forks source link

Use sphinx-design to format tags as pills/buttons #9

Closed melissawm closed 1 year ago

melissawm commented 2 years ago

See https://sphinx-design.readthedocs.io/en/latest/badges_buttons.html

nebelgrau77 commented 2 years ago

I really like the buttons! But some questions come to mind:

JWCook commented 1 year ago

I'd really like to see this feature too.

but then how could the user choose different styles

It would probably make the most sense to put that info in config. For example, a mapping from tag names to colors:

tag_colors= {
    'tag_1': 'primary',
    'tag_2': 'info',
    ...
}
JWCook commented 1 year ago

An incremental improvement to that would be glob patterns:

tag_colors = {
    'tag_2':     'info',
    'prefix:*':  'warning',
    '*':         'light',  # default role for any tags that don't one of these patterns
}

I have some changes for this in #35. That's just one way to do it, though, so I'm open to suggestions.