Reorder Code Sample to show default method first
Reorder Code Sample to show default method first
This commit is contained in:
parent
04617ddabb
commit
51f33ac94b
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Code Sample
|
||||
subtitle: Using Pygments or Highlight.js
|
||||
subtitle: Using Hugo or Pygments
|
||||
date: 2016-03-08
|
||||
tags: ["example", "code"]
|
||||
---
|
||||
@ -9,17 +9,6 @@ The following are two code samples using syntax highlighting.
|
||||
|
||||
<!--more-->
|
||||
|
||||
The following is a code sample using the "highlight" shortcode provided in Hugo. This is server side highlighting and requires Python and Pygments to be installed.
|
||||
|
||||
{{< highlight javascript >}}
|
||||
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 >}}
|
||||
|
||||
|
||||
The following is a code sample using triple backticks ( ``` ) code fencing provided in Hugo. This is client side highlighting and does not require any special installation.
|
||||
|
||||
```javascript
|
||||
@ -29,3 +18,14 @@ The following is a code sample using triple backticks ( ``` ) code fencing provi
|
||||
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
|
||||
alert("Sum = " + sum) // "+" means combine into a string
|
||||
```
|
||||
|
||||
|
||||
The following is a code sample using the "highlight" shortcode provided in Hugo. This is server side highlighting and requires Python and Pygments to be installed.
|
||||
|
||||
{{< highlight javascript >}}
|
||||
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…
Reference in New Issue
Block a user