<!-- 출처: https://bumcrush.tistory.com/182 [맑음때때로 여름] -->
<!-- 코드 하이라이트 -->
<script src="./images/highlight.pack.js"></script>
<link rel="stylesheet" href="./images/vs2015.css">
<script>hljs.initHighlightingOnLoad();</script>
<!-- 코드 블럭 라인 넘버 표시 -->
<script src="./images/highlightjs-line-numbers.js"></script>
<script> hljs.initLineNumbersOnLoad();
$(document).ready(function() {
$('code.hljs').each(function(i, block) {
hljs.lineNumbersBlock(block);
});
});
</script>
출처: https://bumcrush.tistory.com/182 [맑음때때로 여름]
//===========================================
다른 방법 참조 출처 : https://bcp0109.tistory.com/254
<link rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/styles/atom-one-dark.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.1/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
<script>
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
</script>
/* Line Number CSS */
/* for block of numbers */
.hljs-ln-numbers {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-align: center;
color: #ccc;
border-right: 1px solid #CCC;
vertical-align: top;
width: 25px;
}
/* your custom style here */
.hljs-ln td.hljs-ln-code {
padding-left: 5px;
https://highlightjs.org/
https://github.com/wcoder/highlightjs-line-numbers.js
'Tip&Tech' 카테고리의 다른 글
Windows 7 & 2008 & 2008 R2에서 암호정책 복잡성 해제 (0) | 2012.05.04 |
---|---|
[익스체인지 2010 서버] 데이타베이스 제한 용량 변경 (0) | 2010.10.29 |
AIX에서 Apache2 + Tomcat5.5 + JK Connector설치 (0) | 2010.07.06 |
RemoteApp™를 사용하기 위한 Windows® XP SP3 업데이트 (0) | 2009.10.07 |
XnView를 이용한 다중 TIFF 만들기 / 자동 분할 (0) | 2008.09.08 |