From a4d0f137a9948d158428d0a180eedd0102366fcd Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 8 May 2022 18:37:08 +0200 Subject: [PATCH] Documentation --- docs/reference/tooltips.md | 22 +++++++++++++++++++--- docs/setup/extensions/python-markdown.md | 2 ++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/reference/tooltips.md b/docs/reference/tooltips.md index 266636612..0a60c446b 100644 --- a/docs/reference/tooltips.md +++ b/docs/reference/tooltips.md @@ -19,15 +19,18 @@ following lines to `mkdocs.yml`: ``` yaml markdown_extensions: - abbr + - attr_list - pymdownx.snippets ``` See additional configuration options: - [Abbreviations] +- [Attribute Lists] - [Snippets] [Abbreviations]: ../setup/extensions/python-markdown.md#abbreviations + [Attribute Lists]: ../setup/extensions/python-markdown.md#attribute-lists [Snippets]: ../setup/extensions/python-markdown-extensions.md#snippets ### Improved tooltips @@ -60,9 +63,9 @@ Now, tooltips will be rendered for the following elements: The [Markdown syntax] allows to specify a `title` for each link, which will render as a beautiful tooltip when [improved tooltips] are enabled. Add a -tooltip to an link with the following lines: +tooltip to a link with the following lines: -``` markdown title="Link with title, inline syntax" +``` markdown title="Link with tooltip, inline syntax" [Hover me](https://example.com "I'm a tooltip!") ``` @@ -74,7 +77,7 @@ tooltip to an link with the following lines: Tooltips can also be added to link references: -``` markdown title="Link with title, reference syntax" +``` markdown title="Link with tooltip, reference syntax" [Hover me][example] [example]: https://example.com "I'm a tooltip!" @@ -84,6 +87,19 @@ Tooltips can also be added to link references: [Hover me](https://example.com "I'm a tooltip!") + + +For all other elements, a `title` can be added by using the [Attribute Lists] +extension: + +``` markdown title="Icon with tooltip" +:material-information-outline:{ title="Important information" } +``` + +
+ +:material-information-outline:{ title="Important information" } +
[Markdown syntax]: https://daringfireball.net/projects/markdown/syntax#link diff --git a/docs/setup/extensions/python-markdown.md b/docs/setup/extensions/python-markdown.md index e733dcae3..097085814 100644 --- a/docs/setup/extensions/python-markdown.md +++ b/docs/setup/extensions/python-markdown.md @@ -84,6 +84,7 @@ No configuration options are available. See reference for usage: - [Using annotations] - [Using grids] - [Adding buttons] +- [Adding tooltips] - [Using icons with colors] - [Using icons with animations] - [Image alignment] @@ -94,6 +95,7 @@ No configuration options are available. See reference for usage: [Attribute Lists limitations]: https://python-markdown.github.io/extensions/attr_list/#limitations [Using grids]: ../../reference/grids.md#using-grids [Adding buttons]: ../../reference/buttons.md#adding-buttons + [Adding tooltips]: ../../reference/tooltips.md#adding-tooltips [Using icons with colors]: ../../reference/icons-emojis.md#with-colors [Using icons with animations]: ../../reference/icons-emojis.md#with-animations [Image alignment]: ../../reference/images.md#image-alignment