Explorar o código

Improve point_cloud_library clean_html

Aditya Ardiya %!s(int64=3) %!d(string=hai) anos
pai
achega
20445fd37e
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      lib/docs/filters/point_cloud_library/clean_html.rb

+ 12 - 0
lib/docs/filters/point_cloud_library/clean_html.rb

@@ -5,6 +5,18 @@ module Docs
         @doc = at_css('.contents')
         css('.dynheader.closed').remove
         css('.permalink').remove
+        css('.memSeparator').remove
+
+        # Change div.fragment to C++ code with syntax highlight
+        css('div.fragment').each do |node|
+          node.name = 'pre'
+          node['data-language'] = 'cpp'
+          node_content = ""
+          node.css('div').each do |inner_node|
+            node_content += inner_node.text + "\n"
+          end
+          node.content = node_content
+        end
         doc
       end
     end