[gtk-doc] tools/c10e-html: strip html produced by xslt
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] tools/c10e-html: strip html produced by xslt
- Date: Mon, 16 Apr 2018 19:25:59 +0000 (UTC)
commit 6a9b3c293af818b1a3db8acf39c7758828284abc
Author: Stefan Sauer <ensonic users sf net>
Date: Fri Apr 13 09:38:15 2018 +0200
tools/c10e-html: strip html produced by xslt
Remove some content that we won't produce in the new version to ease diffing.
tools/c10e-html.py | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/tools/c10e-html.py b/tools/c10e-html.py
index d90ff7b..81e8a8d 100755
--- a/tools/c10e-html.py
+++ b/tools/c10e-html.py
@@ -6,6 +6,7 @@
import argparse
import glob
+import re
import os
import sys
@@ -16,7 +17,18 @@ def prettify(filename):
with open(filename, 'r') as doc:
soup = BeautifulSoup(doc.read(), 'lxml')
with open(filename, 'w') as doc:
- doc.write(soup.prettify())
+ html = soup.prettify()
+ # strip things that mkhtml2 is not producing to reduce the diff
+ html = html.replace('a class="link" href', 'a href')
+ html = html.replace('summary="Navigation header" ', '')
+ html = html.replace(""" <div class="footer">
+ <hr/>
+ Generated by GTK-Doc V1.28.1
+ </div>
+""", '')
+ html = re.sub(r'\s*<meta content="DocBook[^>]*>', '', html)
+ html = re.sub(r'\s*<meta content="GTK-Doc[^>]*>', '', html)
+ doc.write(html)
def main(htmldir):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]