The TTN forum is using Discourse, which supports several ways to format your post:
- Markdown
- BBCode
- HTML
- Any combination of the above
Quite often you’ll need an empty line above specific formatting to make it work. You’ll also have to type blank lines to create proper paragraphs; just pressing Return once and then typing a new block of text right below a previous block only creates a so-called line break, which might be harder to read.
Leaving one blank line between two blocks of texts nicely creates a new paragraph with some whitespace, which looks great on both mobile and in a regular desktop browser.
Toolbar
The toolbar above the editor’s input helps create mostly Markdown posts:
-
To apply formatting to parts of your post, first select the text you want to format and then click one of the toolbar buttons.
-
See the button’s tooltip for some hints. From left to right: quote post you’re replying to, bold, emphasis (italic), hyperlink, blockquote, preformatted text, upload an image or file, bulleted list, numbered list, heading, horizontal rule, emoij, other options (such as hidden details).
Code and logs
There are many options to format your code or logs:
-
“Fenced code blocks”: type 3 backticks above and below your text, optionally followed by a specification of the language for syntax highlighting, like
```cpp
for C++, and likewisejavascript
,json
andsql
:Here is my code: ```cpp #define LMIC_DEBUG_LEVEL 0 #include <avr/sleep.h> #ifdef PROGMEM // On AVR, these values are stored in flash and only copied to RAM int a = 0; ```
…yielding highlighted C++ code:
Here is my code:
#define LMIC_DEBUG_LEVEL 0 #include <avr/sleep.h> #ifdef PROGMEM // On AVR, these values are stored in flash and only copied to RAM int a = 0;
-
…or, as highlighting might be wrong, use
```text
to suppress any highlighting:```text ## some log output ## here ```
-
Or, also without any highlighting: indent the code with 4 spaces (or select your code and use the toolbar
</>
button to make the editor indent the selected code for you):Here is my code: #define LMIC_DEBUG_LEVEL 0 #include <avr/sleep.h> #ifdef PROGMEM // On AVR, these values are stored in flash and only copied to RAM int a = 0;
-
Or: use BBCode
[code]
above your code or logs, and[/code]
below it. -
If you have many details, you can collapse them to avoid a very long post:
[details=Click to see the full logs] ```text This text will be hidden, until clicked ``` [/details]
…which will get you:
Click to see the full logs
This text will be hidden, until clicked
Markdown
See Markdown Reference for a nice overview. It’s really easy; just a few of its options:
Just type, **use plenty of whitespace** and [link your sources](https:/thethingsnetwork.org)!
- An unordered list.
- Item B.
Or:
1. An ordered list
1. Nested item
2. Nested item
2. Item 2.
- Nested unordered list
3. Item 3.
Nested paragraph.
> Nested quote.
Nested code
> A quote
>
> with nested code
Images have a Discourse-specific option to scale down the preview size: add a percentage such as ,10%
after the image size that is already added when uploading an image:
![TTN logo|649x500,10%](upload://svFg8QtnafrQD36BNhWCepOMnzG.png)
…to get a small image that is still clickable for the full version (which should be clickable for the full version, but that is broken in TTN’s installation ):
HTML
Only some limited tags are supported; other HTML will be invisible, so use code to see that. Like type `<include ...>`
to see <include ...>
.
BBCode
[b]strong[/b]
[i]emphasis[/i]
[u]underlined[/u]
[s]strikethrough[/s]
[ul][li]option one[/li][/ul]
[quote="eviltrout"]They said...[/quote]
[quote="eviltrout, post:1, topic:2"]They said...[/quote]
[img]http://eviltrout.com/eviltrout.png[/img]
[url]http://bettercallsaul.com[/url]
[email]eviltrout@mailinator.com[/email]
[code]\nx++\n[/code]