summaryrefslogtreecommitdiffhomepage
path: root/dragon
diff options
context:
space:
mode:
authorKevin Fischer <[email protected]>2020-12-18 15:31:10 +0900
committerAmir Rajan <[email protected]>2021-01-05 22:45:01 -0600
commitce4b2aeea3ba79d2f3c2282cdaaed12bfbbf6cc9 (patch)
tree5f4ec5ad1ca48b2d12a73a2920a3028465a64e29 /dragon
parent169b8c90cc49457922db82d8716b7eb82bbbe2e4 (diff)
downloaddragonruby-game-toolkit-contrib-ce4b2aeea3ba79d2f3c2282cdaaed12bfbbf6cc9.tar.gz
dragonruby-game-toolkit-contrib-ce4b2aeea3ba79d2f3c2282cdaaed12bfbbf6cc9.zip
Add prism for syntax highlighting
Diffstat (limited to 'dragon')
-rw-r--r--dragon/docs.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/dragon/docs.rb b/dragon/docs.rb
index fd1c6c9..148eda8 100644
--- a/dragon/docs.rb
+++ b/dragon/docs.rb
@@ -257,6 +257,8 @@ S
<head>
<title>DragonRuby Game Toolkit Documentation</title>
<link href="docs.css?ver=#{Time.now.to_i}" rel="stylesheet" type="text/css" media="all">
+ <link href="prism.css?ver=#{Time.now.to_i}" rel="stylesheet" type="text/css" media="all">
+ <script src="prism.js?ver=#{Time.now.to_i}"></script>
</head>
<body>
<div id='toc'>
@@ -442,13 +444,13 @@ S
inside_ol = false
inside_ul = false
inside_pre = true
- content_html << "<pre>"
+ content_html << '<pre><code class="language-ruby">'
elsif l.start_with? "#+end_src"
parse_log << "- PRE end detected."
inside_ol = false
inside_ul = false
inside_pre = false
- content_html << "</pre>\n"
+ content_html << "</code></pre>\n"
elsif l.start_with? "#+begin_quote"
parse_log << "- BLOCKQUOTE start detected."
content_html += close_list_if_needed.call inside_ul, inside_ol