Skip to content

Commit

Permalink
Merge pull request chocolate-doom#1692 from chocolate-doom/qr-pandoc-…
Browse files Browse the repository at this point in the history
…formatting

win32: Tweaks to pandoc-formatted HTML
  • Loading branch information
fragglet authored Aug 23, 2024
2 parents e0ce031 + 7a75ee8 commit 53e0e7b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ win32/GNUmakefile \
win32/cp-with-libs \
win32/README

EXTRA_DIST=$(OSX_FILES) $(WIN32_FILES)
EXTRA_DIST=style.html $(OSX_FILES) $(WIN32_FILES)

48 changes: 48 additions & 0 deletions pkg/style.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

<!-- Tweaks to the pandoc output style to make the resulting HTML
look much nicer. -->

<style>
body {
background-color: white;
margin-top: 1.5em;
margin-bottom: 4em;

max-width: 38em;
margin-left: auto;
margin-right: auto;
box-sizing: border-box;

padding: 0;
padding-left: 1.3em;
padding-right: 1.3em;

font-size: large;
color: #555;
line-height: 1.6;

text-align: justify;
overflow-wrap: break-word;
}

header {
font-family: serif;
margin-top: 0;
margin-bottom: 0.2em;
}

h1, h2, h3, h4, h5, h6 {
margin-top: 0.5em;
margin-bottom: 0.2em;
}

p {
margin-top: 0;
margin-bottom: 0.8em;
}

dl {
margin-block-start: 0.5em;
}
</style>

14 changes: 8 additions & 6 deletions pkg/win32/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ else
POSTFIX=win32
endif

PANDOC_FLAGS = -f gfm -s --template=default.html5 -H ../style.html

DOOM_ZIP=$(PROGRAM_PREFIX)doom-$(PACKAGE_VERSION)-$(POSTFIX).zip
HERETIC_ZIP=$(PROGRAM_PREFIX)heretic-$(PACKAGE_VERSION)-$(POSTFIX).zip
HEXEN_ZIP=$(PROGRAM_PREFIX)hexen-$(PACKAGE_VERSION)-$(POSTFIX).zip
Expand All @@ -32,12 +34,12 @@ $(STRIFE_ZIP): staging-strife hook-strife
# Special hooks to custom modify files for particular games.

hook-doom: staging-doom
-pandoc -f gfm -s -o $</NOT-BUGS.html $(TOPLEVEL)/NOT-BUGS.md
-pandoc $(PANDOC_FLAGS) -o $</NOT-BUGS.html $(TOPLEVEL)/NOT-BUGS.md

# Chocolate Strife has its own custom README file:

hook-strife: staging-strife
-pandoc -f gfm -s -o $</README.html $(TOPLEVEL)/README.Strife.md
-pandoc $(PANDOC_FLAGS) -o $</README.html $(TOPLEVEL)/README.Strife.md

# Build up a staging dir for a particular game.

Expand All @@ -52,11 +54,11 @@ staging-%:
$(STRIP) $@/*.exe $@/*.dll

-for f in $(DOC_FILES); do \
pandoc -f gfm -o $@/$$(basename $$f .md).html \
-s $(TOPLEVEL)/$$f; \
pandoc $(PANDOC_FLAGS) $@/$$(basename $$f .md).html \
$(TOPLEVEL)/$$f; \
done
-pandoc -f gfm -s -o $@/CMDLINE.html $(TOPLEVEL)/man/CMDLINE.$*.md
-pandoc -f gfm -s -o $@/INSTALL.html $(TOPLEVEL)/man/INSTALL.$*
-pandoc $(PANDOC_FLAGS) -o $@/CMDLINE.html $(TOPLEVEL)/man/CMDLINE.$*.md
-pandoc $(PANDOC_FLAGS) -o $@/INSTALL.html $(TOPLEVEL)/man/INSTALL.$*

clean:
rm -f $(ZIPS)
Expand Down

0 comments on commit 53e0e7b

Please sign in to comment.