Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
name: Generate public documentation

on:
release:
types: [published]
workflow_dispatch:

jobs:
generate-docs:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
/var/cache/apt
~/.cache
key: ${{ runner.os }}-docs-${{ hashFiles('.github/workflows/documentation.yml') }}
restore-keys: |
${{ runner.os }}-docs-

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get -y install \
build-essential \
autoconf \
automake \
gnutls-dev \
libkeyutils-dev \
libnl-3-dev \
libnl-genl-3-dev \
libglib2.0-dev

- name: Install documentation tools
run: |
sudo apt-get update
sudo apt-get install -y \
doxygen \
graphviz \
man2html

- name: Configure
run: |
./autogen.sh
./configure --with-systemd

- name: Generate HTML man pages
run: |
mkdir -p docs/man/html
if ! ls man/man* >/dev/null 2>&1; then
echo "No man page directories found, skipping HTML generation"
exit 0
fi
for section_dir in man/man*
do
if [ ! -d "$section_dir" ]; then
continue
fi
section_num=$(basename "$section_dir" | sed 's/man//')
echo "Processing section $section_num pages..."
find "$section_dir" -name "*.$section_num" -print0 | while IFS= read -r -d '' manpage; do
basename_file=$(basename "$manpage")
section=${basename_file##*.}
name=${basename_file%.*}
if ! man2html "$manpage" > "docs/man/html/${name}.${section}.html"; then
echo "Failed to convert $manpage"
exit 1
fi
done
done
ls -lR docs/man

- name: Generate Doxygen documentation
run: |
(cd docs && doxygen Doxyfile)

- name: Assemble final site
run: |
echo "::group::Assembling Documentation Site"

# Copy Doxygen HTML output
if [ -d docs/doxygen/html ]; then
cp -r docs/doxygen/html _site/
echo "✓ Doxygen HTML documentation copied"
else
echo "✗ No Doxygen HTML documentation found"
exit 1
fi

# Copy man page HTML and index
if [ -d docs/man/html ]; then
cp -r docs/man/html _site/
echo "✓ Manual page documentation copied"
else
echo "ℹ️ No manual pages to copy"
# Create empty man directory with placeholder
mkdir -p _site/man
cat > _site/man/index.html <<EOF
<!DOCTYPE html>
<html><head><title>Manual Pages</title></head>
<body>
<h1>Manual Pages</h1>
<p><a href="../index.html">← Back to Documentation Home</a></p>
<p><em>No manual pages available yet.</em></p>
</body></html>
EOF
fi

# Copy configuration examples
if [ -d docs/examples ]; then
cp -r docs/examples _site/
echo "✓ Configuration examples copied"
else
echo "ℹ️ No configuration examples to copy"
fi

# Add .nojekyll to disable Jekyll processing
touch _site/.nojekyll

# Create sitemap
find _site -name "*.html" | sed 's|_site/||' | while read file; do
echo "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/$file"
done > _site/sitemap.txt

echo "Documentation site assembled successfully"
echo "Total files: $(find _site -type f | wc -l)"
echo "Site size: $(du -sh _site | cut -f1)"

echo "::endgroup::"

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ configure.ac~
configure
configure~
cscope.*
docs/doxygen/
Makefile
Makefile.in
.deps/
Expand Down
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ AUTOMAKE_OPTIONS = foreign

EXTRA_DIST = autogen.sh CONTRIBUTING.md LICENSE.txt \
README.md SECURITY.md
SUBDIRS = etc man src systemd
SUBDIRS = docs etc man src systemd

MAINTAINERCLEANFILES = Makefile.in cscope.* ktls-utils*.tar.gz
13 changes: 10 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ PKG_CHECK_MODULES([LIBNL_GENL3], libnl-genl-3.0 >= 3.1)
AC_SUBST([LIBNL_GENL3_CFLAGS])
AC_SUBST([LIBNL_GENL3_LIBS])

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

AC_CHECK_LIB([gnutls], [gnutls_handshake_set_secret_function],
[AC_DEFINE([HAVE_GNUTLS_QUIC], [1],
[Define to 1 if you have the gnutls_handshake_set_secret_function function.])])
AC_CHECK_LIB([gnutls], [gnutls_transport_is_ktls_enabled],
[AC_DEFINE([HAVE_GNUTLS_TRANSPORT_IS_KTLS_ENABLED], [1],
[Define to 1 if you have the gnutls_transport_is_ktls_enabled function.])])
Expand Down Expand Up @@ -95,6 +100,8 @@ fi
AC_SUBST([AM_CPPFLAGS])

AC_CONFIG_FILES([Makefile \
docs/Doxyfile \
docs/Makefile \
etc/Makefile \
etc/tlshd/Makefile \
man/Makefile \
Expand Down
Loading