[TIP] markdown에서 syntax highlighting 적용하기
markdown에서 syntax highlighting 적용하는 방법을 정리한다.
요즘 github에서 TIL(Today I Learned)를 진행하고 있다.
markdown 형식으로 작성하며, 소스 코드를 추가하는 경우도 있다.
이런 경우에 syntax highlighting(구문 강조)를 하면 가독성이 뛰어납니다.
markdown에 대해 잘 모르신다면??
제가 github에 정리한 자료가 도움이 될지도 모르겠네요??
markdown 정리 <--- 클릭
## before syntax highlighting
``` def sumMatrix(A,B): answer = [] if len(A) != len(B): return answer for i in range(len(A)): tmp = [] for j in range(len(A[i])): tmp.append(A[i][j] + B[i][j]) answer.append(tmp) return answer` ``` |
## after syntax highlighting
```python <----- 언어만 명시해주면 된다!! def sumMatrix(A,B): answer = [] if len(A) != len(B): return answer for i in range(len(A)): tmp = [] for j in range(len(A[i])): tmp.append(A[i][j] + B[i][j]) answer.append(tmp) return answer` ``` |
# Reference
https://help.github.com/articles/creating-and-highlighting-code-blocks/
https://support.codebasehq.com/articles/tips-tricks/syntax-highlighting-in-markdown