Syntax highlighting for the coders, invites for everyone

Deimos
2018-11-06T23:52:32Z

Another open-source contribution has now been implemented - @Soptik wrote the code to add support for syntax highlighting, which should be great for topics like the programming challenges in ~comp.

I'll update the formatting documentation to include info about it shortly, but it's straightforward to use. You have to use a "fenced code block", which usually means that you put 3 backticks above and below the code, and include the name of the language after the 3 backticks above it. So for example, markdown like this:

```python
def word_count(string: str) -> int:
    """Count the number of words in the string."""
    return len(WORD_REGEX.findall(string))
```

will render as:

def word_count(string: str) -> int:
    """Count the number of words in the string."""
    return len(WORD_REGEX.findall(string))

This is being done by the "Pygments" library, which supports a lot of languages: http://pygments.org/docs/lexers/

And completely unrelated to that, it's been a while since I gave everyone some invite codes, so I've topped everyone back up to 5 (and as always, feel free to let me know if you need more). You can access them on this page: https://tildes.net/invite

That's all for now, thanks everyone (and @Soptik in particular). There should also be more changes coming before too long, I've been working on some major updates to the comment-tagging system and hopefully should be able to implement those soon.

Comments URL: https://tildes.net/~tildes.official/6o6/syntax_highlighting_for_the_coders_invites_for_everyone

Votes: 78

Comments: 22