Skip to content

Commit

Permalink
Makefile.mak: improve html generation
Browse files Browse the repository at this point in the history
Use sed where possible instead of perl.

Add explicit `align="left"` attribute to table headers so that
non-CSS browsers (e.g. w3m) will render the documentation properly.

Signed-off-by: Kyle J. McKay <[email protected]>
  • Loading branch information
mackyle committed Sep 28, 2020
1 parent fdad6f9 commit 7248b59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@
/tg-update.txt
/tg-update.html
/topgit.html
/topgit.html.tmp
7 changes: 4 additions & 3 deletions Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ topgit.html: README_DOCS.rst create-html-usage.pl $(commands_in)
$(Q)command -v "$${RST2HTML:-rst2html}" >/dev/null || \
{ echo "need $${RST2HTML:-rst2html} to make $@" >&2; exit 1; }
$(QPOUND)echo "# \$${RST2HTML:-rst2html} is \"$${RST2HTML:-rst2html}\""
$(QHTMLTOPGIT)perl ./create-html-usage.pl < README_DOCS.rst | "$${RST2HTML:-rst2html}" - $@ && \
perl -i -pe 's/&nbsp;/\&#160;/g' "$@"
$(QHTMLTOPGIT)perl ./create-html-usage.pl < README_DOCS.rst | "$${RST2HTML:-rst2html}" - $@.tmp && \
LC_ALL=C sed -e 's/&nbsp;/\&#160;/g' -e 's/<th class=/<th align="left" class=/g' <$@.tmp >$@ && \
rm -f $@.tmp

$(html_out): create-html.sh
$(QHTML)CMD="$@" && CMD="$${CMD#tg-}" && CMD="$${CMD%.html}" && \
Expand Down Expand Up @@ -201,7 +202,7 @@ install-html: html FORCE
install -m 644 topgit.html $(html_out) "$(DESTDIR)$(sharedir)"

clean: FORCE
rm -f tg $(commands_out) $(utils_out) $(awk_out) $(hooks_out) $(helpers_out) $(help_out) tg-tg.txt topgit.html $(html_out)
rm -f tg $(commands_out) $(utils_out) $(awk_out) $(hooks_out) $(helpers_out) $(help_out) tg-tg.txt topgit.html topgit.html.tmp $(html_out)
rm -f TG-BUILD-SETTINGS Makefile.dep Makefile.var
rm -rf bin-wrappers
+-$(Q)cd t && $(MAKE) clean
Expand Down

0 comments on commit 7248b59

Please sign in to comment.