[devdocsgjs/main: 1061/1867] ocaml: enable highlighting of caml-example code fragments
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 1061/1867] ocaml: enable highlighting of caml-example code fragments
- Date: Fri, 19 Nov 2021 23:47:41 +0000 (UTC)
commit c39f1a138b5056c6c43bc1972be8b0fa0ce80e38
Author: Antoine Pietri <antoine pietri1 gmail com>
Date: Sun May 24 14:29:08 2020 +0200
ocaml: enable highlighting of caml-example code fragments
lib/docs/filters/ocaml/clean_html.rb | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/lib/docs/filters/ocaml/clean_html.rb b/lib/docs/filters/ocaml/clean_html.rb
index 44f3fb5a..dea7a59a 100644
--- a/lib/docs/filters/ocaml/clean_html.rb
+++ b/lib/docs/filters/ocaml/clean_html.rb
@@ -6,6 +6,17 @@ module Docs
node['data-language'] = 'ocaml'
end
+ css('.caml-input').each do |node|
+ node.content = '# ' + node.content.strip
+ end
+
+ css('.caml-example').each do |node|
+ node.name = 'pre'
+ node.traverse { |n| n.remove if n.text? && n.text !~ /\S/ }
+
+ node['data-language'] = 'ocaml'
+ end
+
doc
end
end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]