Skip to content

Commit d83fe79

Browse files
committed
Update
1 parent 77464d8 commit d83fe79

File tree

4 files changed

+37
-12
lines changed

4 files changed

+37
-12
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,21 @@ jobs:
2828
steps:
2929
- name: Checkout
3030
uses: actions/checkout@v4
31-
- name: Setup Pages
32-
id: pages
33-
uses: actions/configure-pages@v5
3431

3532
- name: Test
3633
run: |
37-
podman run -v $PWD:/srv:z --workdir /srv -it --rm fedora \
38-
sh -c 'dnf install -y scd2html; \
39-
pre="---\nlayout: default\ntitle: Hello\n---\n"; \
40-
for file in docs/man/*.scd; do \
41-
out=$(basename $file | sed "s/scd$/html/"); \
42-
echo -e "$pre" > docs/man/$out; \
43-
scd2html -f < $file >> docs/man/$out; \
44-
done'
4534
46-
sed -i 's|<b>\(rpm[^<]*\)</b>(\(.\))|<a href="\1.\2.html">\1(\2)</a>|g' docs/man/rpm*.html
35+
podman build --target base --tag rpm -f tests/Dockerfile .
36+
mkdir _build
37+
podman run -v $PWD:/srv:z --workdir /srv/_build --rm rpm sh -c \
38+
"cmake .. && make man-html"
39+
40+
# sed -i 's|<b>\(rpm[^<]*\)</b>(\(.\))|<a href="\1.\2.html">\1(\2)</a>|g' docs/man/rpm*.html
41+
mv _build/docs/man/*.html docs/man/
42+
43+
- name: Setup Pages
44+
id: pages
45+
uses: actions/configure-pages@v5
4746

4847
- name: Build with Jekyll
4948
uses: actions/jekyll-build-pages@v1

docs/man/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ foreach(man ${manuals})
1919
endforeach()
2020
add_custom_target(man ALL DEPENDS ${manuals})
2121

22+
set(manuals-html ${manuals})
23+
list(TRANSFORM manuals-html APPEND .html)
24+
configure_file(post.sh post.sh @ONLY)
25+
foreach(man ${manuals})
26+
add_custom_command(OUTPUT ${man}.html
27+
COMMAND scd2html -f
28+
< ${CMAKE_CURRENT_SOURCE_DIR}/${man}.scd
29+
> ${man}.html
30+
COMMAND ./post.sh ${man}.html
31+
DEPENDS ${man}.scd)
32+
endforeach()
33+
add_custom_target(man-html ALL DEPENDS ${manuals-html})
34+
2235
# Install manuals for the enabled features
2336
set(manuals ${core})
2437
if (ENABLE_PLUGINS)

docs/man/post.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
FILE=$1
4+
NAME=$(echo "$FILE" | sed 's/^\(.\+\)\.\(.\+\)\.html$/\1(\2)/')
5+
FRONT_MATTER="\
6+
---
7+
layout: default
8+
title: rpm.org - $NAME
9+
---
10+
"
11+
cat <(echo "$FRONT_MATTER") $1 > $1.tmp
12+
mv $1.tmp $1

tests/Dockerfile.fedora

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ RUN dnf -y install \
5252
dwz \
5353
fsverity-utils fsverity-utils-devel \
5454
scdoc \
55+
scd2html \
5556
sequoia-sq \
5657
libasan \
5758
libubsan

0 commit comments

Comments
 (0)