TYPO3-Documentation / sphinx_typo3_theme

Sphinx theme for docs.typo3.org
https://typo3-documentation.github.io/sphinx_typo3_theme
MIT License
28 stars 17 forks source link

Clamp multiple paragraphs of directives like "versionadded" visually #177

Closed brotkrueml closed 1 year ago

brotkrueml commented 1 year ago

We use the directives "versionadded", "versionchanged" and "deprecated" quite often in the docs - often also with mulitple paragraphos or in combination with a list. Sometimes it is not clear where the directive ends and a "normal" paragraph starts:

image

One solution might be to add a left border to clamp them:

image

Another solution might be to set a background colour:

image

Personally, I like the left border more because the background color is used by admonitions and sometimes admontition and those version directives follow in the text.

Also a single directive without additional text should be considered:

image

sypets commented 1 year ago

Sometimes it is not clear where the directive ends and a "normal" paragraph starts:

I agree. I think it is a good idea to generally have it in some kind of a box visually separated, whether that is a frame or with a border on the left side, I don't care much as long as it is obvious.

marble commented 1 year ago

To deal with that issue: Can you come up with a list of links to usecase which you would consider 'sub-optimal'? Then we can check whether this is best be solved by writing the RST source differently or by tweaking the theme.

brotkrueml commented 1 year ago

This one for example: https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/Configuration/ConfigurationFiles.html?highlight=localconfiguration#migration

It is not clear where the "changed" ends.

brotkrueml commented 1 year ago

Also for this PR with a mix of different hints: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/3157/files It is hard to grasp where they real text starts and what are just annotations.

brotkrueml commented 1 year ago

Another example: Where ends the new note and starts the real text? https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/Events/Events/Frontend/AfterCacheableContentIsGeneratedEvent.html

And even better: the new note spans three paragraphs: https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/Events/Events/Frontend/AfterLinkIsGeneratedEvent.html

marble commented 1 year ago

Looks like this is easy to do. What about this: image

marble commented 1 year ago

In an extreme demo case this looks like: image

Not bad, I'd say.

brotkrueml commented 1 year ago

Fine for me, it has now a clear separation to the surrounding text.

@linawolf What do you think?

marble commented 1 year ago

Done with https://github.com/TYPO3-Documentation/sphinx_typo3_theme/commit/9f72698869b36dddf0ff15830c6bb5fba99d99de