about summary refs log tree commit diff
path: root/third_party/immer/doc/sphinx-html-hack.bash
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-07-15T07·20+0100
committerVincent Ambo <mail@tazj.in>2020-07-15T07·23+0100
commit1213b086a1015a662ab7ebd658f784534fd3116a (patch)
treed3bc8f3b7f40b8b60f0ef6fbd649cf765f4fdfb6 /third_party/immer/doc/sphinx-html-hack.bash
parent1390827b9ea1e04bc9863e48930bfd16db3b716e (diff)
parent7f19d641647ac4ef313ed88d6b5c140983ce5436 (diff)
merge(3p/immer): Subtree merge at 'ad3e3556d' as 'third_party/immer' r/1299
Change-Id: I9636a41ad44b4218293833fd3e9456d9b07c731b
Diffstat (limited to 'third_party/immer/doc/sphinx-html-hack.bash')
-rwxr-xr-xthird_party/immer/doc/sphinx-html-hack.bash101
1 files changed, 101 insertions, 0 deletions
diff --git a/third_party/immer/doc/sphinx-html-hack.bash b/third_party/immer/doc/sphinx-html-hack.bash
new file mode 100755
index 000000000000..1dccb9265dd0
--- /dev/null
+++ b/third_party/immer/doc/sphinx-html-hack.bash
@@ -0,0 +1,101 @@
+#!/bin/bash
+
+location=`dirname $0`
+
+echo "Running $0 at $location"
+
+# Fixes issues described here among others
+# https://github.com/michaeljones/breathe/issues/284
+
+fix-missing-class-name()
+{
+    src='<span id="\([^"]*\)"></span>\(.*\)<em class="property">class </em>'
+    dst='<span id=""></span>\2<em class="property">class</em><tt class="descname">\1</tt>'
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+
+fix-missing-struct-name()
+{
+    src='<span id="\([^"]*\)"></span>\(.*\)<em class="property">struct </em>'
+    dst='<span id=""></span>\2<em class="property">struct</em><tt class="descname">\1</tt>'
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+
+fix-double-using-keyword()
+{
+    src='<em class="property">using</em><em class="property">using </em>'
+    dst='<em class="property">using </em>'
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+
+fix-do-not-repeat-type-in-member-using-declaration()
+{
+    src='<em class="property">using </em><code class="descname">\(\([^:]*::\)*\)\([^ ]*\) = \([^<]*\)</code>'
+    dst='<em class="property">using </em><code class="descname">\3 = \4</code>'
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+fix-do-not-repeat-type-in-member-using-declaration
+
+fix-remove-double-class-name()
+{
+    # src='<code class="descclassname">\([^&]*\)&lt;\([^&]*\)&gt;::</code>'
+    # dst='<code class="descclassname">\1::</code>'
+    src='<code class="descclassname">\([^<]*\)</code>'
+    dst=''
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+
+fix-remove-straneous-typedefs()
+{
+    src='typedef '
+    dst=''
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+
+fix-remove-straneous-typedefs-2()
+{
+    src='= typedef '
+    dst='= '
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+fix-remove-straneous-typedefs-2
+
+fix-remove-straneous-using-declarations()
+{
+    src='<em class="property">using </em>template&lt;&gt;<br />'
+    dst=''
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+
+fix-remove-straneous-template-in-using-declarations-1()
+{
+    src='\(<dl class="type">\n<dt[^>]*>\)\ntemplate&lt;&gt;<br />'
+    dst='\1'
+    pre=':a;N;$!ba;'
+    sed -i "$pre;s@$src@$dst@g" $location/_build/html/*.html
+}
+fix-remove-straneous-template-in-using-declarations-1
+
+fix-remove-straneous-template-in-using-declarations-2()
+{
+    src='></span>template&lt;&gt;<br /><span '
+    dst='></span><span '
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+fix-remove-straneous-template-in-using-declarations-2
+
+fix-remove-countainer-css-class-in-member-definitions-causing-overflow()
+{
+    src='breathe-sectiondef\([[:alnum:] _-]*\)container'
+    dst='breathe-sectiondef'
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+fix-remove-countainer-css-class-in-member-definitions-causing-overflow
+
+fix-remove-inherits-from()
+{
+    src='<p>Inherits from [^/]*</p>'
+    dst=''
+    sed -i "s@$src@$dst@g" $location/_build/html/*.html
+}
+fix-remove-inherits-from