-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
106 lines (91 loc) · 3.18 KB
/
action.yml
File metadata and controls
106 lines (91 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: "Markdown to HTML Converter"
description: "Convert Markdown files to HTML with customizable templates and stylesheets using Pandoc"
author: "Cameron Brooks"
inputs:
source-dir:
description: "Directory containing Markdown files to convert"
required: false
default: "source"
source-file:
description: "Single Markdown file to convert (alternative to source-dir)"
required: false
default: ""
output-dir:
description: "Directory where HTML files will be generated"
required: false
default: "_website"
template:
description: 'HTML template to use. Built-in options: "default", "minimal", "github". Can also be path to custom template file'
required: false
default: "default"
stylesheet:
description: 'CSS stylesheet to use. Built-in options: "default", "minimal", "academic", "technical", "blog", "corporate". Can also be path to local file, or URL to remote stylesheet (e.g. GitHub)'
required: false
default: "default"
site-title:
description: "Title for the website (used in navigation and meta tags)"
required: false
default: "Documentation"
base-url:
description: "Base URL for the site (useful for GitHub Pages deployment)"
required: false
default: ""
include-toc:
description: "Include table of contents in generated HTML"
required: false
default: "true"
pandoc-options:
description: "Additional Pandoc command line options"
required: false
default: ""
outputs:
output-path:
description: "Path to the generated HTML files"
value: ${{ steps.convert.outputs.output-path }}
files-converted:
description: "Number of files converted"
value: ${{ steps.convert.outputs.files-converted }}
runs:
using: "composite"
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install Pandoc
shell: bash
run: |
if command -v pandoc &> /dev/null; then
echo "Pandoc already installed: $(pandoc --version | head -n1)"
else
echo "Installing Pandoc..."
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install -y pandoc
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install pandoc
elif [[ "$RUNNER_OS" == "Windows" ]]; then
choco install pandoc
fi
fi
- name: Convert Markdown to HTML
id: convert
shell: bash
env:
INPUT_SOURCE_DIR: ${{ inputs.source-dir }}
INPUT_SOURCE_FILE: ${{ inputs.source-file }}
INPUT_OUTPUT_DIR: ${{ inputs.output-dir }}
INPUT_TEMPLATE: ${{ inputs.template }}
INPUT_STYLESHEET: ${{ inputs.stylesheet }}
INPUT_SITE_TITLE: ${{ inputs.site-title }}
INPUT_BASE_URL: ${{ inputs.base-url }}
INPUT_INCLUDE_TOC: ${{ inputs.include-toc }}
INPUT_PANDOC_OPTIONS: ${{ inputs.pandoc-options }}
GITHUB_ACTION_PATH: ${{ github.action_path }}
run: |
# Make the convert script executable and run it
chmod +x "$GITHUB_ACTION_PATH/convert-action.sh"
"$GITHUB_ACTION_PATH/convert-action.sh"
branding:
icon: "file-text"
color: "blue"