Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create manpages #36

Merged
merged 11 commits into from
Nov 5, 2023
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