save the world

Tistory블로그에 코드 입력하기 본문

기타

Tistory블로그에 코드 입력하기

함안조씨 2018. 1. 23. 17:12

글을 쓰는 도중 코드가 입력하고 싶을 때

syntaxhighlighter_3.0.83.zip을 다운받아 style 폴더와 script 폴더의 모든 내용을 Tistory 홈페이지 관리에서 HTML/CSS 에 모두 업로드 시킨다.이 작업은 한번만 수행하면 된다.
(자료출처: 
https://github.com/gadicc/meteor-SyntaxHighlighter/tree/master/lib/syntaxhighlighter_3.0.83)


새 글을 작성할 때 외부컨텐츠를 눌러 "html(embed,object 소스입력)" 을 선택하고 아래의 코드를 입력하면 된다.

보라색 두줄 사이에 코드를 작성하면 되고 초록색 부분에는 원하는 코딩용 언어를 넣는다.

예시1
<textarea name="code" class="brush:
cpp;"> 
#include <iostream>
using namespace std;

void main(){
  cout << "";
}
</textarea>

결과

예시2
<textarea name="code" class="brush:py;"> 
import tensorflow as tf
print("tensorflow code")
</textarea>

결과


'기타' 카테고리의 다른 글

무선프린터/복합기 사용하기  (1) 2017.09.25
Filzilla 사용법  (0) 2017.02.07