Font size of code inserts in posts

#1

The font size of code inserts seems unreasonably large, especially compared to the old forum.

For example, you used to be able to fit a line like this into a window without scrolling on the old system:

local tripped_bedroom = luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", 32)

Any possibility to change this for the better?

0 Likes

#2

I’ve slightly increased the post screen width size so the “white” to “content” ratio is 75% for content now.
This should also give you more screen real estate for the code snippet. Code size just for the “code snippets” has too many dependencies as far as I can tell and it might break/make look awkward some other text locations. I’ll see what I can do about this.

I don’t want to stretch this too much as I’m not sure if this will break anything for small screens. I will keep an eye on this.
If you guys notice any buttons overlaps or similar, please let me know.

Before:

After:

1 Like

#3

Managed to make just the “code” snippet a tad smaller.
That’s about the smallest it can get so it doesn’t cause any weird complications.

0 Likes

#4

I’ve just been watching the first post on this page and the size of the code insert has been jumping around.

This was you playing?

0 Likes

#5

yeah :slight_smile: did you saw that even “smaller” version?

0 Likes

#6

Yes, loved it!

Did that break something else?

0 Likes

#7

yes, it was barely visible on mobile devices. So I had to pick this “mid-way”

0 Likes

#8

Fair enough. Thanks for trying!

0 Likes

#9

Not that I ever use it, but how would I insert a code snippet?

Cheers

C

0 Likes

#10

You can use the preformatted text </> or blockquote (") buttons at the top of the composing box

Blockquote

indent preformatted text by 4 spaces

Preformatted works best, because it forces a fixed-width font which works best for code.

AK

0 Likes

#11
    is this a code snippet?

Like that?

Cheers

C

0 Likes

#12

You can also do a code block by putting three backticks (```) on a line by itself before and after the code. You can also specify language on the start line (e.g. ```lua) to get syntax highlighting.

local var = luup.variable_get( "urn:example-com:serviceId:Blahblah1", "Variable", 23 )
if var == "test" then
    luup.log( "It's a test!" )
end
2 Likes

#13

Thanks for telling the proper way to do it!

I’m sure I knew that once, but it had fallen through the gaps somehow. I guess if you don’t use it, you lose it…

1 Like