this post was submitted on 22 Dec 2023
67 points (100.0% liked)

Programming.dev Meta

2455 readers
2 users here now

Welcome to the Programming.Dev meta community!

This is a community for discussing things about programming.dev itself. Things like announcements, site help posts, site questions, etc. are all welcome here.

Links

Credits

founded 1 year ago
MODERATORS
67
submitted 10 months ago* (last edited 10 months ago) by [email protected] to c/[email protected]
 

The instance has now been upgraded up to 0.19.1 from 0.18.5

Due to some authentication changes you will need to log in again and set up 2fa again if you had it previously enabled (since the 2fa process changed to prevent people locking themselves out)

Code Highlighting

If you make code blocks using the three backticks method the code in it will automatically be highlighted based on the detected language (in lemmy-ui aka the site)

Surrounding in 1 backtick lets you do it inline

E.g.

`console.log("hello world")` becomes console.log("hello world")

```
console.log("hello world")
```

Becomes

console.log("hello world")

The blocks will be light if youre on the light theme and dark if youre on the dark theme

Instance Blocking

This is for lemmy-ui, alt frontends may not have support yet or may be done a different way

Go to your profile settings by hitting your name, then settings in the top right

There should be a blocks section you can switch to. Go to the instances part of that and search for the instance you want to block

Blocking an instance will prevent you from seeing posts from that instance

Scaled sort

When you go to choose a sort while browsing posts you should see an option called scaled. This is hot but takes into account the active users to boost communities that need it. (E.g. a community with 20 active users will be shown more than a community with 10000)

Remote following

You can follow a community while browsing it from the site of another instance. To do this just hit subscribe for the community while not logged in on that other instance and it'll bring up a pop-up where you can enter your instance you want to subscribe from

Https://github.com/LemmyNet/lemmy-ui/pull/1875#issuecomment-1727790414

top 9 comments
sorted by: hot top controversial new old
[–] [email protected] 10 points 10 months ago (1 children)

Woohoo! You didn't even mention: code blocks no longer mangle ampersands and less-than symbols!

  • Is there any way to force it to be recognized as a specific programming language?
  • What library does it use? I'd like to see which langs are supported.
  • Might it become possible to have it use our system/browser-preferred mono font?

Anyway it looks great and is a much appreciated feature, thank you!

[–] [email protected] 8 points 10 months ago* (last edited 10 months ago) (2 children)

1 -> yep, to make it a certain language put that language after the first three backticks. For inline you can do it using curly braces after the second backtick with a dot and then the language in it

```abnf
x=4
```

x=4

`x=4`{.haskell}

x=4{.haskell}

`x=4`{.js}

x=4{.js}

2-> https://www.npmjs.com/package/markdown-it-highlightjs is the specific one but its basically just a wrapper around highlightjs

3 -> ~~unknown, I didnt mess around with that when implementing them and I dont think it supports it.~~ edit: can probably be added manually by messing around with css. Ill do a pull request after my exams

[–] [email protected] 2 points 10 months ago (1 children)

I had a look and it can be set by setting font-family inside the .hljs block within the theme (e.g. atom-one-dark.css).

[–] [email protected] 3 points 10 months ago* (last edited 10 months ago) (1 children)

Yeah setting that to monospace so browser determines it. Should just be two lines, one for each theme

Pull request maybe coming late tomorrow and then it'll probably be in 0.19.2

[–] [email protected] 2 points 10 months ago

Honestly that sounds good to me, but not everyone configures their own preferred fonts, so it may not be a crowd pleaser. It's not too bad for me to just override the style on my side.

[–] [email protected] 1 points 10 months ago
[–] [email protected] 7 points 10 months ago (1 children)

I thought you were just talking about not updating before the holidays. Either way 0.19 is looking good, these new features are sweet. Also code highlighting, nice!

[–] [email protected] 12 points 10 months ago

Yeah that was the plan but had a security vulnerability just brought up so we pushed early

[–] [email protected] 5 points 10 months ago

Looking forward to trying the new sort, ty!