Advanced Formatting
Formatting like syntax highlighting and embedding other sites allows you to arrange complex information.
Code and Syntax Highlighting
Code blocks are part of the Markdown spec, but syntax highlighting isn’t. However, many renderers - like GitHub or most Jekyll themes - support syntax highlighting. Which languages are supported and how those language names should be written will vary from renderer to renderer. You can find the full list of supported programming languages here. Also, it is possible to do fenced code blocks
, by wrapping the text in ` ` ` quotations.
Fenced code blocks
No language indicated, so no syntax highlighting.
Markdown syntax highlighting
Add an optional language identifier to enable syntax highlighting in your fenced code block.
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
Rouge syntax highlighting
Embed Gist
Another option is to embed your code through Gist.
Embedding
Plenty of social media sites offer the option of embedding certain parts of their site on your own site, such as YouTube and Twitter:
Youtube
Jekyll 4.2.1 has been released! This is a bug fix release for the 4.2 release series and more info on the included fixes can be found on the announcement post! https://t.co/jo0yl3Q8wI
— jekyll (@jekyllrb) September 27, 2021
Inline HTML elements
HTML defines a long list of available inline tags, which you can mix with Markdown if you like. A complete list of which can be found on the Mozilla Developer Network.
Useful Resources
More information on Markdown can be found at the following links: