Browse files

Added ability to automatically insert custom CSS, Slidedown style (st…

…yle.css in the same dir as the doc)
  • Loading branch information...
1 parent 9dd67e6 commit ea4743188aa93d731dce3383ca31afd8ca97ab22 @karmi karmi committed Feb 3, 2010
View
6 lib/markout/formatters/html/html.rb
@@ -35,6 +35,12 @@ def print_style
File.read template_path.join('print.css')
end
+ # TODO : Tests, doc
+ def custom_style
+ css_file = @document.base_path.join('style.css')
+ @custom_style ||= css_file && File.exist?(css_file) ? File.read(css_file) : nil
+ end
+
def syntax_highlighter
s = ''
s << '<script type="text/javascript">' + File.read( template_path.join('..', 'common', 'code_highlighter.js') ) + '</script>'
View
1 lib/markout/formatters/html/templates/default/content.rhtml
@@ -9,6 +9,7 @@
<style type="text/css" media="screen"><%= screen_style %></style>
<style type="text/css" media="print"><%= print_style %></style>
+ <% if custom_style %><style type="text/css" media="screen"><%= custom_style %></style><% end %>
<script type="text/javascript"><%= jquery %></script>
<script type="text/javascript"><%= application_js %></script>

0 comments on commit ea47431

Please sign in to comment.