About syntax highlighting
For syntax highlighting, use fenced code blocks optionally followed by the language syntax you want:
```ruby
def foo
puts 'foo'
end
```
This looks as follows:
def foo
puts 'foo'
end
Fenced code blocks require a blank line before and after.
If you’re using an HTML file, you can also use the highlight command with Liquid markup:
{% highlight ruby %}
def foo
puts 'foo'
end
{% endhighlight %}
It renders the same:
def foo
puts 'foo'
endThe theme has syntax highlighting specified in the configuration file as follows:
highlighter: rouge
The syntax highlighting is done via the css/syntax.css file.
Available lexers
The keywords you must add to specify the highlighting (in the previous example, ruby) are called “lexers.” You can search for “lexers.” Here are some common ones I use:
- js
- html
- yaml
- css
- json
- php
- java
- cpp
- dotnet
- xml
- http
pra_ngx_lua_continue_after_eof
pra_ngx_lua_how_one_instance_time
pra_ngx_lua_lua-variable-scope
pra_ngx_lua_resolve_the_domain_name
pra_redis_dynamic_redis_module_method
pra_postgres_not_support_transaction
pra_nginx_pitfalls_and_common_mistakes
candylab_common_sites_log_system
candylab_base_on_openresty_waf
mydoc_hyperlinks.html#automatedlinks