[Forum Usage] Discourse Tips and Tricks

I typically use: bash,html,css,scss,php and a few others – text is usually the default state in most markdown capable apps I’ve used. Interestingly, not so with Discourse. Good tip!

I thought I remembered us finding it defaults to bash here but it would appear not … I actually cant seem to find which hint results in the default appearance.
(I’ve tried sooo many)

1 Like

Well, the default appearance is simple to explain.
Everyhing after # is a comment.

# This is a comment
## This should have been a markdown heading 2
### And so on...

And with the bash hint, it’s still a comment, only neater:

# This is a comment
## This should have been a markdown heading 2
### And so on...

Yeah … still … whether bash or js or css or ruby or … anything else I can think of … does not result in the default appearance.
Hence … I still dont know what the default is.

Unassigned. I think the default appearance must simply be inherited from the site or discourse stylesheet, without an actual default hint being applied. I don’t know what else would explain it.

??
I dunno.
I think its some language, I just dont know what. (not html, apache, java…)
A better default would probably be text … but this has been talked about before

Ah … actually that thread has it its ‘auto’

# This is a comment
## This should have been a markdown heading 2
### And so on...

But what thats defined as or how its parsed … :person_shrugging:

As you say, that would be better, and consistent with most other applications. The default appearance would then be preformatted text. Period. Not this mishmash. :wink:

Of course, then comes the annoyance of explaining the use of hints to the general populace.

Found it … its shell … whatever that means.

Undefined == Auto == Shell == ???     :sweat_smile:

1 Like

Just checked and it’s not shell.

```auto

# comment
echo something
## another comment
### yet another comment
echo something else

```shell

# comment
echo something
## another comment
### yet another comment
echo something else

```bash

# comment
echo something
## another comment
### yet another comment
echo something else

```

# comment 
echo something
## another comment
### yet another comment
echo something else

Im not sure why the discrepancy.

But it doesnt seem to match what happens here.


``` (or not putting anything)

# This is a comment
## This should have been a markdown heading 2
### And so on...
# comment 
echo something
## another comment
### yet another comment
echo something else

```auto

# This is a comment
## This should have been a markdown heading 2
### And so on...
# comment 
echo something
## another comment
### yet another comment
echo something else

```shell

# This is a comment
## This should have been a markdown heading 2
### And so on...
# comment 
echo something
## another comment
### yet another comment
echo something else

Oh wait. you are right. the last shell doesnt match. :thinking:

( nooooooooooooo )

1 Like

I wondered why the first comment was different for your tests.

Of course it’s auto detecting the language. I still wonder why the first comment is different.

FWIW, I almost always do blank, for:

$ free -h
total        used        free      shared  buff/cache   available
Mem:            15Gi       6.0Gi       2.3Gi       106Mi       7.8Gi       9.5Gi
Swap:          7.8Gi       1.1Gi       6.7Gi

Just in case it’s actually a client-side thing, this is what it looks like for me:

https://i.imgur.com/Yqk2LWq.png

But this is highlighted:

total        used        free      shared  buff/cache   available
Mem:            15Gi       6.0Gi       2.3Gi       106Mi       7.8Gi       9.5Gi
Swap:          7.8Gi       1.1Gi       6.7Gi

As far as I know, Discourse uses highlightjs to detect and highlight languages – probably the issue in somewhere in this library.

2 Likes

They did look the same for a while.

And now highlighting’s gone again:

https://i.imgur.com/sQB6f7L.png

https://xkcd.com/2880
How to stop discourse fetching web site preview

`https://xkcd.com/2880`

Markdown Link Title

Any sufficiently advanced technology is indistinguishable from magic

Markdown Link Title (code)
[Any sufficiently advanced technology is indistinguishable from magic](https://arthurcclarke.org/#start "The only way of discovering the limits of the possible is to venture a little way past them into the impossible. - Arthur C. Clarke")

If you simply start the line with one or several hashes (#), it’ll also automatically become a link. :wink:

Try it. :slight_smile:

The leading # makes it a heading, which is automatically converted to an anchor, essentially for internal navigation purposes.

Speaking of navigation, have you tried the new TOC functionality yet?

Yes, I did. That’s why I posted the Disco Duck. :stuck_out_tongue:

:musical_note: :duck: :musical_note: