Update code samples with line numbers
Update code samples with line numbers
This commit is contained in:
parent
51f33ac94b
commit
15519ca776
1 changed files with 11 additions and 0 deletions
|
@ -29,3 +29,14 @@ The following is a code sample using the "highlight" shortcode provided in Hugo.
|
|||
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
|
||||
alert("Sum = " + sum) // "+" means combine into a string
|
||||
{{</ highlight >}}
|
||||
|
||||
|
||||
And here is the same code with line numbers:
|
||||
|
||||
{{< highlight javascript "linenos=inline">}}
|
||||
var num1, num2, sum
|
||||
num1 = prompt("Enter first number")
|
||||
num2 = prompt("Enter second number")
|
||||
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
|
||||
alert("Sum = " + sum) // "+" means combine into a string
|
||||
{{</ highlight >}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue