From 68e53dc43c3fb66f064643d0fb9170f04e8f8833 Mon Sep 17 00:00:00 2001 From: Kevin Ernst Date: Mon, 15 Jun 2026 15:47:09 -0400 Subject: [PATCH] docs: add inline code spans to Markdown intro Signed-off-by: ernstki --- content/markdown/introduction-to-markdown.md | 19 +++++++++++++++++++ content/markdown/preformatted-text.md | 14 ++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/content/markdown/introduction-to-markdown.md b/content/markdown/introduction-to-markdown.md index 55aa03c..968cef1 100644 --- a/content/markdown/introduction-to-markdown.md +++ b/content/markdown/introduction-to-markdown.md @@ -95,6 +95,25 @@ is rendered as This is ~~strikethrough text~~. +### Monospaced font (code) + +_For preformatted code blocks, see "[Preformatted Text](../preformatted-text)."_ + +It is a common convention in technical writing to use a monospaced or +fixed-width font to indicate code, literal text to be typed at a command +prompt, or program output. + +To create a span of inline text with a monospaced font, wrap the text in +backtick (\`) characters, like so: + +```markdown +This text contains an `inline code` span. +``` + +which renders as + +This text contains an `inline code` span. + ### Footnotes To add footnotes use the syntax `[^name]` inline, and define them with:
diff --git a/content/markdown/preformatted-text.md b/content/markdown/preformatted-text.md index ddf7afb..66eb986 100644 --- a/content/markdown/preformatted-text.md +++ b/content/markdown/preformatted-text.md @@ -6,9 +6,11 @@ eleventyNavigation: order: 50 --- - -In technical writing, code blocks, commands to be typed, or verbatim output are commonly represented by monospaced or fixed-width fonts. These blocks considered _preformatted_ text, because internal whitespace is preserved. +In technical writing, code blocks, commands to be typed verbatim, or program +output are commonly represented by monospaced or fixed-width fonts. These +blocks are considered _preformatted_, because internal whitespace is to be +preserved. There are three ways to use preformatted text within your Markdown documents: @@ -41,7 +43,7 @@ will be preformatted Using indentation, it's not possible to add a rendering hint, so the block will not be syntax-highlighted. Indentation-based preformatting sometimes causes false positives where text is -uninentionally preformatted; for this reason, it is disabled in some +unintentionally preformatted; for this reason, it is disabled in some Markdown renderers, including in Codeberg Documentation. ## Using backticks @@ -108,4 +110,8 @@ The result: #!/bin/bash echo "Hello world" -``` \ No newline at end of file +``` + +## See also + + - [Introduction to Markdown § Monospaced font (code)](../introduction-to-markdown#monospaced-font-(code)).