Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
When writing a post, you may need to post things like source code or youtube videos, shortcodes make this really easy.
[code lang=cs] paste your code here... [/code]
The following attributes are supported
highlight: (comma-seperated list of numbers) - You can list the line numbers you want to be highlighted.
[code lang=cs highlight=1,3] your source code line 1 and 3 will be highlighted [/code]
gutter: (true/false) - If false, the line numbers on the left side will be hidden. Defaults to true.
[code lang=cs gutter=false] you won't see line numbers on the left [/code]
firstline: (number) - Use this to change what number the line numbering starts at. It defaults to 1.
[code lang=cs firstline=87] the line number on the left starts at 87 [/code]
htmlscript: (true/false) - If true, any HTML/XML in your code will be highlighted. This is useful when you are mixing code into HTML, such as razor content. Defaults to false. Only works with certain languages. Don't use this attribute when lang is already html or xml.
[code lang=cs htmlscript=true] paste your cshtml code here [/code]
To post a youtube video, get the video's url, any of the two formats will do.
[youtube https://www.youtube.com/watch?v=MNor4dYXa6U] or [youtube https://youtu.be/MNor4dYXa6U]
To embed the video with default width and height (560 x 315)
To specify the width and height explicitly
To specify the width only
To start at a certain point in the video, convert the time of that point from minutes and seconds to all seconds, then add that number as shown (using an example start point of 1 minute 15 seconds)