Skip to content

Commit

Permalink
Create manpages (#36)
Browse files Browse the repository at this point in the history
* Adds custom hugo environment for manpage build

* Adds original xslt for xhtml to man conversion

From https://github.com/EffinMaggie/xhtml2man

* Use <meta section> value if available

* Adds script that generates man pages from their html version

* Make it possible to autogenerate the driver lists for the manpages

* Update source and destination metadata

* Use automatic source and driver lists

* Adds a list of links to the end of the manpages

* Path updates

* Adds generating manpages to staging workflow
  • Loading branch information
eldarnash authored Nov 5, 2023
1 parent bdb612b commit 12d7fb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ jobs:
- name: Build
run: hugo --environment staging --baseURL ${{ steps.pages.outputs.base_url }}/

# Build hugo output with manpages environment, run scripts, copy output manpages to public so it gets uploaded
- name: Build manpage environment
run: hugo --environment manpage --baseURL ${{ steps.pages.outputs.base_url }}/ --destination manpages
- name: Convert manpages
run: |
sudo apt-get install -y xsltproc
python3 scripts/create-man-from-html.py
mv manpages/syslog-ng-manpages/ public/
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions scripts/create-man-from-html.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def convert_html_to_man(rawhtml, original_file, output_dir):
manfile.close()

## Delete html file
# subprocess.run(["rm", output_html_file])
subprocess.run(["rm", output_html_file])

global errors, unix_name, section
errors = []
Expand All @@ -117,8 +117,8 @@ def convert_html_to_man(rawhtml, original_file, output_dir):
# Process manpages files
print("Processing manpages files")

input_manpage_dir = "public/app-man-syslog-ng"
output_manpage_dir = "public/syslog-ng-manpages"
input_manpage_dir = "manpages/app-man-syslog-ng"
output_manpage_dir = "manpages/syslog-ng-manpages"

for root, dirs, files in os.walk(input_manpage_dir):
for file in files:
Expand Down

0 comments on commit 12d7fb7

Please sign in to comment.