doc: simplify CSS customization for Doxygen
authorDmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Wed, 6 Apr 2022 17:10:10 +0000 (20:10 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 1 Jun 2022 09:26:11 +0000 (11:26 +0200)
CSS for API documentation was customized by a shell script
modifying the file that Doxygen produces.
This way CSS code is kept in a script and an extra build step is added.
Move custom style to a plain CSS file.
Use Doxygen capability to attach this extra stylesheet.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
doc/api/custom.css [new file with mode: 0644]
doc/api/doxy-api.conf.in
doc/api/doxy-html-custom.sh [deleted file]
doc/api/generate_doxygen.sh
doc/api/meson.build

diff --git a/doc/api/custom.css b/doc/api/custom.css
new file mode 100644 (file)
index 0000000..66360f9
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2013 6WIND S.A.
+ */
+
+/* space between item and its comment */
+dd td:first-child { padding-right: 2em; }
index e355e66..608494a 100644 (file)
@@ -103,6 +103,7 @@ ALPHABETICAL_INDEX      = NO
 
 HTML_TIMESTAMP          = NO
 HTML_DYNAMIC_SECTIONS   = YES
+HTML_EXTRA_STYLESHEET   = @TOPDIR@/doc/api/custom.css
 SEARCHENGINE            = YES
 SORT_MEMBER_DOCS        = NO
 SOURCE_BROWSER          = YES
diff --git a/doc/api/doxy-html-custom.sh b/doc/api/doxy-html-custom.sh
deleted file mode 100755 (executable)
index 3802007..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /bin/sh -e
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright 2013 6WIND S.A.
-
-CSS=$1
-
-# space between item and its comment
-echo 'dd td:first-child {padding-right: 2em;}' >> $CSS
index 1350e50..1940ea4 100755 (executable)
@@ -4,12 +4,9 @@
 
 DOXYCONF=$1
 OUTDIR=$2
-SCRIPTCSS=$3
 
 OUT_FILE=$(dirname $OUTDIR)/doxygen.out
 
 # run doxygen, capturing all the header files it processed
 doxygen "${DOXYCONF}" > $OUT_FILE
 echo "$OUTDIR: $(awk '/Preprocessing/ {printf("%s ", substr($2, 1, length($2) - 3))}' $OUT_FILE)" > $OUTDIR.d
-
-"${SCRIPTCSS}" "${OUTDIR}"/doxygen.css
index 5c25b92..53338a0 100644 (file)
@@ -13,7 +13,6 @@ endif
 # script to run the CSS modification afterwards
 generate_doxygen = find_program('generate_doxygen.sh')
 generate_examples = find_program('generate_examples.sh')
-generate_css = find_program('doxy-html-custom.sh')
 
 htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk')
 
@@ -52,7 +51,7 @@ doxy_build = custom_target('doxygen',
         input: doxy_conf,
         output: 'html',
         depfile: 'html.d',
-        command: [generate_doxygen, '@INPUT@', '@OUTPUT@', generate_css],
+        command: [generate_doxygen, '@INPUT@', '@OUTPUT@'],
         install: get_option('enable_docs'),
         install_dir: htmldir,
         build_by_default: get_option('enable_docs'))