summaryrefslogtreecommitdiff
path: root/build.sh
blob: 773518c83b89d33da7fc5eec12928abd84c5ba16 (plain)
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
# static site generator
# Copyright (C) 2022 w. kennedy
# Copyright (C) 2024, 2025 yctct

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#!/bin/bash
echo Welcome to the markdown to html converter.
markdown_file="$1"
echo file is "$markdown_file"

if [[ -z "$markdown_file" ]]; then
  printf "Usage: %s <markdown_file>\n" "$0"
    exit 1
    fi

    output_file="${markdown_file%%.*}.html"

    pandoc "$markdown_file" -f markdown+hard_line_breaks \
     -t html5 -H "header.html" \
        --template="default.html5" \
         -o "$output_file" --verbose --highlight-style=breezedark


         printf "markdown_file: %s\n" "$markdown_file"
         printf "output_file: %s\n" "$output_file"

         echo We did it capitan, we converted to html.