Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ## syntax highlighter in DOKUWIKI `/conf/userstyle.css` 파일을 생성하고 스타일을 입력한다. ```javascript body p { font-size: medium; } body .syntaxhighlighter .line { white-space: pre-wrap !important; /* make code wrap */ } ``` js 파일에 줄바꿈에 대한 넘버링 수정 코드를 입력한다. `page.js` 파일에 추가하였습니다. ```java /* Syntax Highlighter Wrap */ function lineWrap(){ var wrap = function () { var elems = document.getElementsByClassName('syntaxhighlighter'); for (var j = 0; j < elems.length; ++j) { var sh = elems[j]; var gLines = sh.getElementsByClassName('gutter')[0].getElementsByClassName('line'); var cLines = sh.getElementsByClassName('code')[0].getElementsByClassName('line'); var stand = 15; for (var i = 0; i < gLines.length; ++i) { var h = jQuery(cLines[i]).height(); if (h != stand) { console.log(i); gLines[i].setAttribute('style', 'height: ' + h + 'px !important;'); } } } }; var whenReady = function () { if (jQuery('.syntaxhighlighter').length === 0) { setTimeout(whenReady, 800); } else { wrap(); } }; whenReady(); }; lineWrap(); jQuery(window).resize(function(){lineWrap()}); ``` open/syntax-highlighter-in-dokuwiki.txt Last modified: 2024/10/05 06:15by 127.0.0.1