Browse Source

LaTeX: syntax highlighting

Simon Legner 4 years ago
parent
commit
f139802767
2 changed files with 971 additions and 948 deletions
  1. 966 948
      assets/javascripts/vendor/prism.js
  2. 5 0
      lib/docs/filters/latex/clean_html.rb

File diff suppressed because it is too large
+ 966 - 948
assets/javascripts/vendor/prism.js


+ 5 - 0
lib/docs/filters/latex/clean_html.rb

@@ -13,6 +13,11 @@ module Docs
 
 
         css('h1, h2, h3, h4').each { |node| node.content = node.content.sub /^[0-9A-Z]+(\.[0-9]+)* /, '' }
         css('h1, h2, h3, h4').each { |node| node.content = node.content.sub /^[0-9A-Z]+(\.[0-9]+)* /, '' }
 
 
+        css('pre').each do |node|
+          node.delete 'class'
+          node['data-language'] = 'latex'
+        end
+
         doc
         doc
       end
       end
     end
     end

Some files were not shown because too many files changed in this diff