highlight.js

+ line numbering plugin; https://github.com/wcoder/highlightjs-line-numbers.js/


Usage:

<pre><code> (insert code here) </code></pre>

<pre><code class="___"> (insert code here) </code></pre>



Examples:


C++

#include <iostream>
using namespace std;

int main() {
    cout << "hello world!" << endl;
    return 0;
}

C
#include <stdio.h>

int main(void) {
    printf("Hello world!\n");
    return 0;
}


코드 입력 시, <> 안의 내용을 html 태그로 인식하는 경우가 발생할 수 있다.

입력하기 전에 <>를 미리 &lt; &gt;로 교체해두자...

'etc' 카테고리의 다른 글

파이썬으로 이미지 크롤링 해보기  (0) 2019.03.06

+ Recent posts