Skip to content

Commit 152dffd

Browse files
committed
Update
1 parent 3140b9d commit 152dffd

File tree

5 files changed

+36
-37
lines changed

5 files changed

+36
-37
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ jobs:
3737
podman run -v $PWD:/srv:z --workdir /srv/_build --rm rpm sh -c \
3838
"cmake .. && make man-html"
3939
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-
ls docs/man/*.html
40+
mv _build/docs/man/{*.html,index.md} docs/man/
4341
4442
- name: Setup Pages
4543
id: pages

docs/man/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ add_custom_target(man ALL DEPENDS ${manuals})
2121

2222
set(manuals-html ${manuals})
2323
list(TRANSFORM manuals-html APPEND .html)
24+
configure_file(index.sh index.sh @ONLY)
2425
configure_file(post.sh post.sh @ONLY)
2526
foreach(man ${manuals})
2627
add_custom_command(OUTPUT ${man}.html
@@ -30,7 +31,8 @@ foreach(man ${manuals})
3031
COMMAND ./post.sh ${man}.html
3132
DEPENDS ${man}.scd)
3233
endforeach()
33-
add_custom_target(man-html ALL DEPENDS ${manuals-html})
34+
add_custom_command(OUTPUT index.md COMMAND ./index.sh)
35+
add_custom_target(man-html ALL DEPENDS ${manuals-html} index.md)
3436

3537
# Install manuals for the enabled features
3638
set(manuals ${core})

docs/man/index.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/man/index.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
BLAH="\
4+
---
5+
layout: default
6+
title: rpm.org - RPM Manual Pages
7+
---
8+
# RPM Manual Pages
9+
10+
## Tools"
11+
12+
add_item() {
13+
file=$(basename $1)
14+
link=$(echo "$file" | sed 's/.scd$/.html/')
15+
name=$(echo "$file" | sed 's/^\(.\+\)\.\(.\+\)\.scd$/\1(\2)/')
16+
echo "* [$name]($link)"
17+
}
18+
19+
echo "$BLAH" > index.md
20+
21+
find @CMAKE_CURRENT_SOURCE_DIR@ -name "*.scd" ! -name "rpm-plugin-*" | sort | \
22+
while read file; do
23+
add_item $file >> index.md
24+
done
25+
26+
echo -e "\n## Plugins" >> index.md
27+
28+
find @CMAKE_CURRENT_SOURCE_DIR@ -name "rpm-plugin-*.scd" | sort | \
29+
while read file; do
30+
add_item $file >> index.md
31+
done

docs/man/post.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ title: rpm.org - $NAME
99
---
1010
"
1111
cat <(echo "$FRONT_MATTER") $1 > $1.tmp
12+
sed -i 's|<b>\(rpm[^<]*\)</b>(\(.\))|<a href="\1.\2.html">\1(\2)</a>|g' $1.tmp
1213
mv $1.tmp $1

0 commit comments

Comments
 (0)