[Tip] Please use Preformatted Text for Logs and Code Blocks for cleaner posts

To ensure our community can provide the best help, please use Preformatted Text for all technical content.

Why Use Preformatted Text?

When you paste logs, configuration files, or code snippets as plain text, Discourse often alters the formatting. This makes it difficult to read and can strip away crucial characters needed to diagnose your issue.

If you didn’t create it yourself, like logs or JSONs (interviews) paste it as Preformatted Text!

For smaller Code, Logs etc. in context of a topic, but want to share in the topic/reply past small Code blocks and code snips, preferably with the correct type of formatting.

How to Format Your Content

1. The Toolbar Method

Highlight your code or log block and click the </> icon in the composer toolbar. This will wrap your text in backticks.

2. The Keyboard Shortcut

Highlight your text and press Ctrl + e (or Cmd + e on Mac).

3. Manual Fencing (Best for long blocks)

For logs or multiple lines of code, place three backticks ``` on a separate line before and after your content:

Your code, config, or logs go here

What should be formatted?

  • Code snippets (Python, JS, C++, etc.)

  • Configuration files (.yaml, .json, .conf, etc.)

  • Terminal output and error logs

  • Commands you ran in the terminal

Pro-Tip

Enabling the “rich text editor“ you also can choose between many types of text (from plaintext, markdown, java, javascript, json and many more.)

image

image333×113 5.37 KB

image

image892×297 18.7 KB

For more advanced tips, you can check the Discourse Markdown Guide.

Created with AI, responses may include mistakes. Learn more

4 Likes

When you get a reply with a link to this post, read above Tip and edit your post to select the log/code/text block and apply the preformatted text. Your Post looks cleaner an many community members will be happier to read your post.

1 Like

There’s a typo here

1 Like