개발/기타

Prism 를 이용한 코드조각 만들기

xwing 2017. 3. 23. 23:47

정말 오랜만에 글하나 올리네요.


Prism 를 이용해서 Code snippet 을 blog에 게시하는 방법을 몇자 적어 봅니다.

http://prismjs.com/ 에서 

Download 를 눌러서 다운로드 페이지로 이동합니다.

필요한 테마와 언어를 선택하고 JS 와 CSS 파일을 다운로드 합니다.

그런다음...

블로그에 두개의 파일을 업로드 하고

헤더에

<link href="themes/prism.css" rel="stylesheet" />

body 맨 아래

<script src="prism.js"></script>
// Use this for initialization
void Start () {
	LeanTween.move(this.gameObject, this.gameObject.transform.position + new Vector3(0, 4, 0), 2f).setDelay(1f);
}
	
// Update is called once per frame
void Update () {
		
}


<pre><code class="language-csharp">여기코드</code></pre>

code class에는 language-xxxx (csharp, markup, java 등)

이런식으로 코드를 넣어 주면 됩니다.