From 6f63baa95ab7b1ab13179784f18d6ee1820cb86c Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 14 Mar 2021 19:13:31 +0100 Subject: [PATCH] Documentation --- docs/reference/code-blocks.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/reference/code-blocks.md b/docs/reference/code-blocks.md index 982cc00d3..bdf68f088 100644 --- a/docs/reference/code-blocks.md +++ b/docs/reference/code-blocks.md @@ -215,7 +215,7 @@ import tensorflow as tf Annotations offer a comfortable and friendly way to attach explanations to arbitrary sections of code blocks by adding simple markers within block/inline comments that refer to items of a list following the code block, i.e. `(1)`, -`(2)`, etc. Material for MkDocs removes the list from the flow of the document, +`(2)`, etc. Material for MkDocs detaches the list from the flow of the document, injects the content of each list item into a tooltip, and links each list marker to the corresponding tooltip. @@ -223,6 +223,10 @@ In order to opt-in to annotation support, a slightly different syntax is required – just add the respective [language short code][17] and the `.annotate` class, after the three backticks. +Note that annotations can be __placed anywhere__ in a code block where a comment +for the language can be placed, which for JavaScript is `// (1)` and +`/* (2) */`, for Yaml `# (3)`, etc. + _Example_: ```` markdown