# Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## Removed - Disable the Markdownlint rule MD024 (`Multiple headings with the same content`). ## Fixed - Syntax errors in `.markdownlint.yaml`. - Markdownlint issues: - Heading levels should only increment by one level at a time([MD001](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md001.md)) - Hard tabs ([MD010](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md010.md)) - Reversed link syntax ([MD011](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md011.md)) - Dollar signs used before commands without showing output ([MD014](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md014.md)) - Multiple top-level headings in the same document ([MD025](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md025.md)) - Trailing punctuation in heading ([MD026](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md026.md)) - Ordered list item prefix([MD029](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md029.md)) - Emphasis used instead of a heading([MD036](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md036.md)) - Fenced code blocks should have a language specified ([MD040](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md040.md)) - Link fragments should be valid ([MD051](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md051.md)) - Link text should be descriptive ([MD059](https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md059.md)) - Prettier issues. Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/626 Reviewed-by: Patrick Schratz <pat-s@noreply.codeberg.org> Co-authored-by: Javier Pérez <walpo@noreply.codeberg.org> Co-committed-by: Javier Pérez <walpo@noreply.codeberg.org>
1.7 KiB
| eleventyNavigation | ||||||||
|---|---|---|---|---|---|---|---|---|
|
There are two ways to use monospace preformatted text within your Markdown document:
- Using indentation
- Using one or more backticks at the beginning and the end of a preformatted section
Using indentation
You can preformat a section of text or code by indenting the code with 4 or more spaces, or a tab.
Using indentation, it's not possible to add a rendering hint. It's also not possible to preformat text within a line using this syntax.
Indentation-based preformatting sometimes causes false positives where text is preformatted that isn't supposed to. For this reason, it is disabled in some Markdown renderers, including in Codeberg Documentation.
Using backticks
A better way of preformatting a section of text is by starting a section of text with one or more backtick characters.
Here, we use 3 backtick characters on its own line, then our text, then another line containing 3 more backticks.
this
is
displayed
as
preformatted
You can also preformat a section of text within a line using backtick syntax.
The following text is for example preformatted by using the backtick syntax.
Rendering hints
Sometime renderers use hints to syntax highlight the code in a preformatted section.
To provide a hint, simply add the language name at the end of the introductory backtick(s).
For example, using shell as the hint will tell the renderer that the given code should be highlighted as a shell script:
#!/bin/bash
echo "Hello world"
The same thing would be rendered without syntax highlighting if the hint is not given:
#!/bin/bash
echo "Hello world"