Skip to content

Commit b7f81df

Browse files
authored
Merge pull request #128 from oracle/gen-docs
Generate gh-pages
2 parents 142ee70 + a1778f3 commit b7f81df

File tree

21 files changed

+4362
-349
lines changed

21 files changed

+4362
-349
lines changed
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
name: Generate public documentation
3+
4+
on:
5+
release:
6+
types: [published]
7+
workflow_dispatch:
8+
9+
jobs:
10+
generate-docs:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
environment:
17+
name: github-pages
18+
url: ${{ steps.deployment.outputs.page_url }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Cache dependencies
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
/var/cache/apt
28+
~/.cache
29+
key: ${{ runner.os }}-docs-${{ hashFiles('.github/workflows/documentation.yml') }}
30+
restore-keys: |
31+
${{ runner.os }}-docs-
32+
33+
- name: Install build dependencies
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get -y install \
37+
build-essential \
38+
autoconf \
39+
automake \
40+
gnutls-dev \
41+
libkeyutils-dev \
42+
libnl-3-dev \
43+
libnl-genl-3-dev \
44+
libglib2.0-dev
45+
46+
- name: Install documentation tools
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y \
50+
doxygen \
51+
graphviz \
52+
man2html
53+
54+
- name: Configure
55+
run: |
56+
./autogen.sh
57+
./configure --with-systemd
58+
59+
- name: Generate HTML man pages
60+
run: |
61+
mkdir -p docs/man/html
62+
if ! ls man/man* >/dev/null 2>&1; then
63+
echo "No man page directories found, skipping HTML generation"
64+
exit 0
65+
fi
66+
for section_dir in man/man*
67+
do
68+
if [ ! -d "$section_dir" ]; then
69+
continue
70+
fi
71+
section_num=$(basename "$section_dir" | sed 's/man//')
72+
echo "Processing section $section_num pages..."
73+
find "$section_dir" -name "*.$section_num" -print0 | while IFS= read -r -d '' manpage; do
74+
basename_file=$(basename "$manpage")
75+
section=${basename_file##*.}
76+
name=${basename_file%.*}
77+
if ! man2html "$manpage" > "docs/man/html/${name}.${section}.html"; then
78+
echo "Failed to convert $manpage"
79+
exit 1
80+
fi
81+
done
82+
done
83+
ls -lR docs/man
84+
85+
- name: Generate Doxygen documentation
86+
run: |
87+
(cd docs && doxygen Doxyfile)
88+
89+
- name: Assemble final site
90+
run: |
91+
echo "::group::Assembling Documentation Site"
92+
93+
# Copy Doxygen HTML output
94+
if [ -d docs/doxygen/html ]; then
95+
cp -r docs/doxygen/html _site/
96+
echo "✓ Doxygen HTML documentation copied"
97+
else
98+
echo "✗ No Doxygen HTML documentation found"
99+
exit 1
100+
fi
101+
102+
# Copy man page HTML and index
103+
if [ -d docs/man/html ]; then
104+
cp -r docs/man/html _site/
105+
echo "✓ Manual page documentation copied"
106+
else
107+
echo "ℹ️ No manual pages to copy"
108+
# Create empty man directory with placeholder
109+
mkdir -p _site/man
110+
cat > _site/man/index.html <<EOF
111+
<!DOCTYPE html>
112+
<html><head><title>Manual Pages</title></head>
113+
<body>
114+
<h1>Manual Pages</h1>
115+
<p><a href="../index.html">← Back to Documentation Home</a></p>
116+
<p><em>No manual pages available yet.</em></p>
117+
</body></html>
118+
EOF
119+
fi
120+
121+
# Copy configuration examples
122+
if [ -d docs/examples ]; then
123+
cp -r docs/examples _site/
124+
echo "✓ Configuration examples copied"
125+
else
126+
echo "ℹ️ No configuration examples to copy"
127+
fi
128+
129+
# Add .nojekyll to disable Jekyll processing
130+
touch _site/.nojekyll
131+
132+
# Create sitemap
133+
find _site -name "*.html" | sed 's|_site/||' | while read file; do
134+
echo "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/$file"
135+
done > _site/sitemap.txt
136+
137+
echo "Documentation site assembled successfully"
138+
echo "Total files: $(find _site -type f | wc -l)"
139+
echo "Site size: $(du -sh _site | cut -f1)"
140+
141+
echo "::endgroup::"
142+
143+
- name: Setup Pages
144+
uses: actions/configure-pages@v4
145+
146+
- name: Upload Pages artifact
147+
uses: actions/upload-pages-artifact@v3
148+
with:
149+
path: _site
150+
151+
- name: Deploy to GitHub Pages
152+
if: github.ref == 'refs/heads/main'
153+
id: deployment
154+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ configure.ac~
55
configure
66
configure~
77
cscope.*
8+
docs/doxygen/
89
Makefile
910
Makefile.in
1011
.deps/

Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ AUTOMAKE_OPTIONS = foreign
2020

2121
EXTRA_DIST = autogen.sh CONTRIBUTING.md LICENSE.txt \
2222
README.md SECURITY.md
23-
SUBDIRS = etc man src systemd
23+
SUBDIRS = docs etc man src systemd
24+
2425
MAINTAINERCLEANFILES = Makefile.in cscope.* ktls-utils*.tar.gz

configure.ac

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ PKG_CHECK_MODULES([LIBNL_GENL3], libnl-genl-3.0 >= 3.1)
6464
AC_SUBST([LIBNL_GENL3_CFLAGS])
6565
AC_SUBST([LIBNL_GENL3_LIBS])
6666

67-
AC_CHECK_HEADER([linux/quic.h],
68-
[AC_CHECK_LIB([gnutls], [gnutls_handshake_set_secret_function],
69-
[AC_DEFINE([HAVE_GNUTLS_QUIC], [1], [Define to 1 if QUIC is found.])])])
67+
AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, false)
68+
if test "$DOXYGEN" = false; then
69+
AC_MSG_WARN([Doxygen not found - documentation will not be built])
70+
fi
71+
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$DOXYGEN" != "false"])
7072

73+
AC_CHECK_LIB([gnutls], [gnutls_handshake_set_secret_function],
74+
[AC_DEFINE([HAVE_GNUTLS_QUIC], [1],
75+
[Define to 1 if you have the gnutls_handshake_set_secret_function function.])])
7176
AC_CHECK_LIB([gnutls], [gnutls_transport_is_ktls_enabled],
7277
[AC_DEFINE([HAVE_GNUTLS_TRANSPORT_IS_KTLS_ENABLED], [1],
7378
[Define to 1 if you have the gnutls_transport_is_ktls_enabled function.])])
@@ -95,6 +100,8 @@ fi
95100
AC_SUBST([AM_CPPFLAGS])
96101

97102
AC_CONFIG_FILES([Makefile \
103+
docs/Doxyfile \
104+
docs/Makefile \
98105
etc/Makefile \
99106
etc/tlshd/Makefile \
100107
man/Makefile \

0 commit comments

Comments
 (0)