Browse Source

Improve point_cloud_library clean_html

Aditya Ardiya 3 years ago
parent
commit
20445fd37e
1 changed files with 12 additions and 0 deletions
  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