From 2fd7e0b3a04b93def794153ec06ae71c88802221 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sun, 22 Oct 2023 14:36:17 -0400 Subject: [PATCH] Add specification for info strings with inline code Add RST-style colon-delimited info strings to inline code :python:`foo("abc", a=123)` --- spec.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/spec.txt b/spec.txt index df9599c3..22280c2a 100644 --- a/spec.txt +++ b/spec.txt @@ -5881,6 +5881,10 @@ following ways: or ends with backtick characters, which must be separated by whitespace from the opening or closing backtick strings. +Inline code spans may optionally be directly preceded by an [info string] +that is wrapped in single colon characters (`` :info:`code` ``). This +info string may not contain backtick characters. + This is a simple code span: ```````````````````````````````` example @@ -6094,6 +6098,26 @@ closing backtick strings to be equal in length:

`foobar

```````````````````````````````` +An [info string] can be wrapped in colon (`:`) characters and given +directly before the inline code. This spec does not mandate what to +do with the info string, but the first word is typically used to specify +the language. In HTML output, this is typically indicated by adding a +class to the `code` element consisting of `language-` followed by the +language name. + +```````````````````````````````` example +:python:`foo(x, a=100)` +. +

foo(x, a=100)

+```````````````````````````````` + +The info string may not be separated from the opening backtick. + +```````````````````````````````` example +:c: `printf("foo");` +. +

:c: printf("foo");

+```````````````````````````````` ## Emphasis and strong emphasis