jbms / sphinx-immaterial

Adaptation of the popular mkdocs-material material design theme to the sphinx documentation system
https://jbms.github.io/sphinx-immaterial/
Other
177 stars 28 forks source link

remove unnecessary permalink to `depart_term()` #252

Closed 2bndy5 closed 1 year ago

2bndy5 commented 1 year ago

resolves #248

The problem doesn't seem instigated by any changes to docutils or sphinx. So, it may have been something that was originally overlooked in #157.

Use rst-example for the glossary directive in additional_samples.rst

jbms commented 1 year ago

The original code is intended to support this use case:

.. _a-term:

a term:
  a definition

In fact I was not aware that the default depart_term definition in Sphinx has a special case for glossary nodes:

https://github.com/sphinx-doc/sphinx/blob/ba7408209e84ee413f240afc20f3c6b484a81f8f/sphinx/writers/html5.py#L361

In fact I was not even familiar with the glossary directive at all.

I think it would be good to still support permalinks for definition list definitions outside of a glossary.

2bndy5 commented 1 year ago

Ah, ok. Should I revert and add a condition to exclude the extra permalink for the glossary directive?

jbms commented 1 year ago

Ah, ok. Should I revert and add a condition to exclude the extra permalink for the glossary directive?

Yeah, though it looks like a special case is also required for nodes.classifier.