File: docgen-wrapper.sh

package info (click to toggle)
tinysparql 3.11~beta-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,632 kB
  • sloc: ansic: 119,093; python: 6,139; javascript: 725; sh: 121; perl: 106; xml: 67; makefile: 31; sql: 1
file content (24 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

src_dir=`dirname $0`
output_dir=$1; shift
docgen_command=$1; shift

# Build docs
$docgen_command $@

pushd $output_dir >/dev/null
docname=`ls -1 | head -n 1`

# Add ontology keywords to .devhelp2 file
devhelp_file="${docname}/${docname}.devhelp2"
cat $devhelp_file | sed "s/<\/functions>//" - | sed "s/<\/book>//" - >fixed.devhelp2 2>/dev/null
cat ../*-ontology.keywords >>fixed.devhelp2 2>/dev/null
echo -e "  </functions>\n</book>" >>fixed.devhelp2
mv fixed.devhelp2 $devhelp_file

# Also add ontology keywords to index.json for web UI search
index_json="${docname}/index.json"
python3 "${src_dir}/merge-json.py" "${index_json}" ../*-ontology.index.json

popd >/dev/null