Forum tags and Zig syntax highlighting

Hey everybody! I’ve been adding some tags that will help in further categorizing content on the forum. When you create or edit a post, you’ll see the drop-down to the right of the Category drop-down; it says “optional tags”. If you don’t see the tag you’re looking for, start typing and if it exists, it’ll show up in a second or so. If it doesn’t exist, you can create it if you’ve been here long enough, or feel free to ask for it to be added in the Site Feedback category. I’ve used my moderator super-powers to add these tags to some existing posts, just to get the ball rolling.

Also we now have Zig syntax highlighting for code blocks, so you can add zig after the opening triple backticks (or if you don’t, it’s the default language anyway) to make that Zig code look awesome!

9 Likes

Great update!

Can we get a “comptime” or “compile-time” optional tag?

1 Like

There’s comptime and compiler tags in there. If you don’t see them in the list, start typing and after a second they should show up.

1 Like

Perfect, sorry didn’t try typing

No worries! I edited the original post to make this part clearer.

1 Like

@dude_the_builder a “testing” optional tag might be helpful

1 Like

Good idea! I just added it.

1 Like

I think discourse allows defining default language for code blocks, such that one does not have to specify zig? At least, users.rust-lang.org detects Rust automatically.

2 Likes

Excellent! I found the setting. Let’s see if it works:

const std = @import("std");

pub fn main() void {
    const answer: u8 = 42;
    std.debug.print("Hello, world! {d}\n", .{answer});
}

Thanks!

2 Likes