2013年3月7日木曜日

SyntaxHighlighterをHTMLに適用

SyntaxhighlighterをHTMLに適用するには、
  • SyntaxHighlighterからダウンロードし、サーバーにアップする
  • 適用したいHTMLにCSSを適用し、Scriptを記述する
    <head>部
       <link rel = "stylesheet" type = "text/css" href = "../../material/SyntaxHighlighter/3.0.83/styles/shCore.css">
       <link rel = "stylesheet" type = "text/css" href = "../../material/SyntaxHighlighter/3.0.83/styles/shThemeDefault.css">
    
       <script type = "text/javascript" src = "../../material/SyntaxHighlighter/3.0.83/scripts/shCore.js"></script>
       <script type = "text/javascript" src = "../../material/SyntaxHighlighter/3.0.83/scripts/shBrushJScript.js"></script>
       <script type = "text/javascript">
        SyntaxHighlighter.all()
       </script>
       
      
    <body>部
       <pre class = "brush : js">
        function func()
        {
        }
       </pre>
      
sample