Replacing indented code blocks with fenced code blocks

This commit is contained in:
Lucas Hinderberger 2023-07-21 21:02:10 +02:00
parent 91fbf7a9a0
commit d55c1397f7
3 changed files with 22 additions and 20 deletions

View file

@ -12,11 +12,11 @@ You can also use Markdown in many parts of Codeberg (Issues, Pull Requests, etc.
## Text section
To write a Markdown file, simply create a new file, and edit it with a text editor of your choice.
Markdown doesn't consider single line breaks as the start of a new paragraph.
Markdown doesn't consider single line breaks as the start of a new paragraph.
You can write all your text into one long line or introduce a new line every once in a while.
It is common practice to introduce a new line at around 80 characters to enable users to easily read the plain un-rendered version of the Markdown file.
However, it's recommended to make a line break in Markdown when it makes sense, e.g. at the end of a sentence.
It makes diffs easier to understand, as the context of the complete sentence is preserved.
It makes diffs easier to understand, as the context of the complete sentence is preserved.
If you want to start a new paragraph, use two or more empty new lines to separate the text.
Beware that when rendering with Forgejo, line breaks are rendered differently in repos and comment fields.
@ -82,13 +82,13 @@ This is also _italic text_.
Text may contain references to emoticons which are rendered as a small image, similar to an emoji.
You can render these by typing the name of the emoticon you want to use, surrounded by colons (`:`), like this `:codeberg:`.
Some examples are `:codeberg:` which is rendered as <img src="https://codeberg.org/assets/img/emoji/codeberg.png" class="codeberg-design" style="border-style:none;width:1em;height:1em" alt="The Codeberg mountain" /> and `:gitea:` which is rendered as <img src="https://codeberg.org/assets/img/emoji/gitea.png" class="codeberg-design" style="border-style:none;height:1em;width=1em" alt="The Gitea tea cup" />.
Some examples are `:codeberg:` which is rendered as <img src="https://codeberg.org/assets/img/emoji/codeberg.png" class="codeberg-design" style="border-style:none;width:1em;height:1em" alt="The Codeberg mountain" /> and `:gitea:` which is rendered as <img src="https://codeberg.org/assets/img/emoji/gitea.png" class="codeberg-design" style="border-style:none;height:1em;width=1em" alt="The Gitea tea cup" />.
### Referencing issues and pull requests
Issues and pull requests in Codeberg/Forgejo can be referenced in the comments of an issue or a pull request by using a hash `#` followed by the number of the issue or pull request.
The renderer will then include a link to the referenced issue into the comment.
After that, a link to the comment containing the reference will be added to the issues referenced in this way.
After that, a link to the comment containing the reference will be added to the issues referenced in this way.
### Checkboxes
@ -103,12 +103,14 @@ Use the render hint `mermaid` on the preformatted section containing the code of
E.g.
```mermaid
graph TD;
A(stuff)-->B[one];
A-->C[two];
A-->D[three];
```
~~~markdown
```mermaid
graph TD;
A(stuff)-->B[one];
A-->C[two];
A-->D[three];
```
~~~
is rendered to:

View file

@ -13,19 +13,17 @@ There are two ways to use monospace preformatted text within your Markdown docum
## Using indentation
You can preformat a section of text or code by indenting the code with 4 or more spaces, or a tab:
this
is
displayed
as
preformatted
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
You can preformat a section of text by starting a section of text with one or more backtick characters.
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.

View file

@ -103,7 +103,9 @@ Password for 'https://username@codeberg.org': access-token
If you want to permanently save your generated access token you can use the following command to store it globally on your computer:
git config --global credential.helper cache
```
git config --global credential.helper cache
```
## Troubleshooting
@ -114,7 +116,7 @@ Codeberg's instance of Forgejo is using an [OTP library](https://github.com/pque
v v v
| <-----> | <-----> | <----->
^ ^ ^
Previous Current Next
Previous Current Next
```
Codeberg's server is always at the **Current** period. If a token of the **Previous** period is submitted, which was generated between 00:00-00:30, it will be accepted, as long as that token was submitted between 00:30-01:00. So at a minimum you always got 30 seconds to submit the token, before it becomes "invalid" and Codeberg always accept two codes (**Previous**, **Current**)