瀏覽代碼

Improve point_cloud_library clean_html

Aditya Ardiya 3 年之前
父節點
當前提交
20445fd37e
共有 1 個文件被更改,包括 12 次插入0 次删除
  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')
         @doc = at_css('.contents')
         css('.dynheader.closed').remove
         css('.dynheader.closed').remove
         css('.permalink').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
         doc
       end
       end
     end
     end