docs: add inline code spans to Markdown intro

Signed-off-by: ernstki <ernstki@noreply.codeberg.org>
This commit is contained in:
Kevin Ernst 2026-06-15 15:47:09 -04:00
parent 1ec9cad276
commit 68e53dc43c
2 changed files with 29 additions and 4 deletions

View file

@ -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:<br>

View file

@ -6,9 +6,11 @@ eleventyNavigation:
order: 50
---
<!-- TODO: _For inline code spans, see [Introduction to Markdown § Monospaced font (code)](../introduction-to-markdown#monospaced-font-code)._ -->
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"
```
```
## See also
- [Introduction to Markdown § Monospaced font (code)](../introduction-to-markdown#monospaced-font-(code)).