[tracker/wip/carlosg/dist-docs: 2/3] docs: Refactor devhelp generation scripts
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/dist-docs: 2/3] docs: Refactor devhelp generation scripts
- Date: Tue, 31 Aug 2021 20:12:22 +0000 (UTC)
commit e01295df4071de8e91cef94fe1a2a7003ec50180
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Aug 31 21:35:58 2021 +0200
docs: Refactor devhelp generation scripts
The intent is to generate devhelp documentation at dist time so it
is included in the tarball. The steps to generate the devhelp
documentation and fix the searchable keywords is the same, so refactor
this to a common script.
Also, trim a bit the devhelp book, since it can contain a lot of
unneeded files (like 27MB of search data, while devhelp does feature
search itself).
.../libtracker-sparql/generate-devhelp.sh | 27 ++++++++++++++++++++++
.../reference/libtracker-sparql/install-devhelp.sh | 24 ++++---------------
2 files changed, 31 insertions(+), 20 deletions(-)
---
diff --git a/docs/reference/libtracker-sparql/generate-devhelp.sh
b/docs/reference/libtracker-sparql/generate-devhelp.sh
new file mode 100755
index 000000000..cb7010782
--- /dev/null
+++ b/docs/reference/libtracker-sparql/generate-devhelp.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+cd ${MESON_BUILD_ROOT}/docs/reference/libtracker-sparql/
+
+docs_name=$1
+docs_path="${docs_name}-doc/devhelp/books/${docs_name}"
+devhelp_file="${docs_path}/*.devhelp2"
+
+# Step 1. Build devhelp documentation (we let meson do this)
+# hotdoc run --conf-file '${docs_name}-doc.json' --devhelp-activate
+
+# Step 2. Fix .devhelp2 file so it contains keywords from out ontologies
+cat $devhelp_file | sed "s/<\/functions>//" - | sed "s/<\/book>//" - >fixed.devhelp2
+
+for i in *-ontology.keywords
+do
+ cat $i >>fixed.devhelp2
+done
+
+echo -e " </functions>\n</book>" >>fixed.devhelp2
+mv fixed.devhelp2 $devhelp_file
+
+# Step 3. Trim unnecessary data
+rm ${docs_path}/assets/fonts/*.woff*
+rm ${docs_path}/assets/fonts/*.svg
+rm -rf ${docs_path}/assets/js/search
+find ${docs_path} -name "dumped.trie" -delete
diff --git a/docs/reference/libtracker-sparql/install-devhelp.sh
b/docs/reference/libtracker-sparql/install-devhelp.sh
index 75b50ec06..74aafaa54 100755
--- a/docs/reference/libtracker-sparql/install-devhelp.sh
+++ b/docs/reference/libtracker-sparql/install-devhelp.sh
@@ -1,28 +1,12 @@
#!/bin/sh
-cd ${MESON_BUILD_ROOT}/docs/reference/libtracker-sparql/
+# Generate fixed .devhelp2 file
+${MESON_SOURCE_ROOT}/docs/reference/libtracker-sparql/generate-devhelp.sh $1
+# Install all files
docs_name=$1
-echo $docs_name
docs_path="${docs_name}-doc/devhelp/books/${docs_name}"
-echo $docs_path
-devhelp_file="${docs_path}/*.devhelp2"
-echo $devhelp_file
-
-# Step 1. Build devhelp documentation (we let meson do this)
-# hotdoc run --conf-file '${docs_name}-doc.json' --devhelp-activate
-
-# Step 2. Fix .devhelp2 file so it contains keywords from out ontologies
-cat $devhelp_file | sed "s/<\/functions>//" - | sed "s/<\/book>//" - >fixed.devhelp2
-for i in *-ontology.keywords
-do
- cat $i >>fixed.devhelp2
-done
-
-echo -e " </functions>\n</book>" >>fixed.devhelp2
-mv fixed.devhelp2 $devhelp_file
-
-# Step 3. Install all files
+cd ${MESON_BUILD_ROOT}/docs/reference/libtracker-sparql/
mkdir -p ${MESON_INSTALL_DESTDIR_PREFIX}/share/devhelp/books
cp -a $docs_path ${MESON_INSTALL_DESTDIR_PREFIX}/share/devhelp/books/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]