Skip to content

Commit 14477fe

Browse files
committed
docs: make an index.html page for the PDF docs
1 parent 8d2521a commit 14477fe

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# generated when building pdf docs
2+
index.html

docs/src/Submakefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,10 @@ ifeq ($(BUILD_DOCS_HTML),yes)
434434
docs: htmldocs
435435
install-doc: install-doc-html
436436
endif
437+
437438
pdfdocs: $(PDF_TARGETS)
439+
../scripts/make-docs-pdf-index
440+
438441
htmldocs: .htmldoc-stamp checkref
439442

440443
.htmldoc-stamp: copy_asciidoc_files $(HTML_TARGETS) .html-images-stamp

scripts/make-docs-pdf-index

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
#
3+
# Make a pretty(?) index page of the PDF docs.
4+
#
5+
6+
set -e
7+
8+
# Assume we're running in src/, we can't call `git rev-parse
9+
# --show-toplevel` because when building from dsc we don't have a
10+
# git repo.
11+
TOPLEVEL=${PWD}/..
12+
cd ${TOPLEVEL}/docs
13+
14+
TITLE="LinuxCNC PDF docs ($(cat ${TOPLEVEL}/VERSION))"
15+
16+
rm -f index.html
17+
18+
echo "<html>" >> index.html
19+
echo "<head><title>${TITLE}</title></head>" >> index.html
20+
echo "<body><h1>${TITLE}</h1><p>" >> index.html
21+
22+
for F in $(ls -1 *.pdf | sort); do
23+
echo " <a href=\"${F}\">$F</a><br>" >> index.html
24+
done
25+
26+
echo "</body>" >> index.html
27+
echo "</html>" >> index.html

0 commit comments

Comments
 (0)