-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
501 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
rm -r ./build | ||
|
||
./make--index | ||
./make--stringsext--manpage | ||
./make--rustdoc-link | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
mkdir --parents ./build/html | ||
mkdir --parents ./build/html/_downloads | ||
mkdir --parents ./build/man/man1 | ||
|
||
cp ../README.md ./source/index.md | ||
sed -i 's/http.*\.getreu\.net//g' ./source/index.md | ||
|
||
./md2docbook2html ./source/index.md ./build/html/index.html | ||
#rm index.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
mkdir --parents ./build/html | ||
mkdir --parents ./build/html/_downloads | ||
mkdir --parents ./build/man/man1 | ||
|
||
cd ./build/html/_downloads | ||
ln -sf ../../../../target/* . | ||
ln -sf ../../../build/man/man1/stringsext.1.gz . | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
mkdir --parents ./build/html | ||
mkdir --parents ./build/html/_downloads | ||
mkdir --parents ./build/man/man1 | ||
|
||
# Html page | ||
./md2man ./source/stringsext--manpage.md ./build/man/man1/stringsext.1 | ||
./md2docbook2pdf ./source/stringsext--manpage.md ./build/pdf/stringsext--manpage.pdf | ||
./md2docbook2html ./source/stringsext--manpage.md ./build/html/stringsext--manpage.html | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
# Author: Jens Getreu | ||
|
||
# apt install pandoc docbook-xsl-ns xsltproc | ||
|
||
|
||
render () { | ||
### parse args | ||
|
||
#set -x | ||
InPath="$1" | ||
InFile="${InPath##*/}" | ||
InBase="${InFile%.*}" | ||
InDir="${InPath%/*}" | ||
if [ "$InDir" = "$InPath" ] ; then | ||
InDir="." | ||
fi | ||
|
||
OutPath="$2" | ||
OutFile="${OutPath##*/}" | ||
OutBase="${OutFile%.*}" | ||
OutDir="${OutPath%/*}" | ||
if [ "$OutDir" = "$OutPath" ] ; then | ||
OutDir="." | ||
fi | ||
|
||
|
||
### Prepare | ||
|
||
XmlPath="$OutDir/$OutBase.xml" | ||
HtmlPath="$OutDir/$OutBase.html" | ||
TemplatePath="$OutDir/template.db" | ||
mkdir -p "$OutDir" | ||
|
||
|
||
### Generate XML | ||
|
||
# unfortunately the chain does not honor --number-section yet | ||
pandoc -s -t docbook5 -o "$XmlPath" "$InPath" | ||
|
||
# this is only needed for html output | ||
cp -r "$InDir/images/" "$OutDir" | ||
cp "$InDir/docutils_basic.css" "$OutDir" | ||
|
||
### Generate HTML | ||
|
||
# Xsltproc also take parameters e.g. --stringparam use.extensions 0\ | ||
# Schema 1.79.1 does not render figure references correctly: | ||
# /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/html/docbook.xsl\ | ||
# Use snapshot with UTF-8 in docbook.xsl instead | ||
xsltproc --stringparam html.stylesheet docutils_basic.css --output "$HtmlPath" \ | ||
/usr/local/share/xml/dokbook/stylesheet/docbook-xsl-snapshot/html/docbook.xsl\ | ||
"$XmlPath" && \ | ||
rm "$XmlPath" | ||
} | ||
|
||
#/usr/local/share/xml/dokbook/stylesheet/docbook-xsl-1.79.2/html/docbook.xsl\ | ||
|
||
|
||
### Main | ||
# usage: | ||
# render FILE [FILE] | ||
# render report.md ./rendition/report.html | ||
|
||
if [[ -n "${2/[ ]*\n/}" ]] ; then | ||
OutPath="$2" | ||
else | ||
OutPath="${1%.*}.html" # $2 is empty | ||
fi | ||
render "$1" "$OutPath" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
# Author: Jens Getreu | ||
|
||
# apt install pandoc asciidoctor-fopub | ||
FOPUB_PATH="/usr/local/java-deployment/asciidoctor-fopub/bin/" | ||
|
||
render () { | ||
### parse args | ||
|
||
#set -x | ||
InPath="$1" | ||
InFile="${InPath##*/}" | ||
InBase="${InFile%.*}" | ||
InDir="${InPath%/*}" | ||
if [ "$InDir" = "$InPath" ] ; then | ||
InDir="." | ||
fi | ||
|
||
OutPath="$2" | ||
OutFile="${OutPath##*/}" | ||
OutBase="${OutFile%.*}" | ||
OutDir="${OutPath%/*}" | ||
if [ "$OutDir" = "$OutPath" ] ; then | ||
OutDir="." | ||
fi | ||
|
||
|
||
### Prepare | ||
|
||
XmlPath="$OutDir/$OutBase.xml" | ||
PdfPath="$OutDir/$OutBase.pdf" | ||
TemplatePath="$OutDir/template.db" | ||
|
||
mkdir -p "$OutDir" | ||
|
||
|
||
### Make docbook-template | ||
# quoting EOF means parameter substitution turned off | ||
cat << "EOF" > "$TemplatePath" | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?asciidoc-toc?> | ||
<?asciidoc-numbered?> | ||
EOF | ||
|
||
|
||
|
||
# Strip off first line of the docbook5 default template and append it | ||
pandoc -D docbook5 | tail -n +2 >> "$TemplatePath" | ||
|
||
|
||
### Generate XML | ||
|
||
# unfortunately the chain does not honor --number-section yet | ||
pandoc --template "$TemplatePath" -s -t docbook5 -o "$XmlPath" "$InPath" | ||
|
||
# this is only needed for html and xml output | ||
cp -r "$InDir/images/" "$OutDir" | ||
|
||
|
||
### Generate PDF | ||
"$FOPUB_PATH/fopub" -H "$XmlPath" && \ | ||
rm "$XmlPath" && \ | ||
rm "$TemplatePath" && \ | ||
rm -f -r "$OutDir/images/" | ||
|
||
} | ||
|
||
|
||
|
||
### Main | ||
# usage: | ||
# render FILE [FILE] | ||
# render report.md ./rendition/report.pdf | ||
|
||
if [[ -n "${2/[ ]*\n/}" ]] ; then | ||
OutPath="$2" | ||
else | ||
OutPath="${1%.*}.pdf" # $2 is empty | ||
fi | ||
render "$1" "$OutPath" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
# Author: Jens Getreu | ||
|
||
|
||
# sudo apt install pandoc | ||
|
||
# parse args | ||
|
||
render () { | ||
#set -x | ||
InPath="$1" | ||
InFile="${InPath##*/}" | ||
InBase="${InFile%.*}" | ||
InDir="${InPath%/*}" | ||
if [ "$InDir" = "$InPath" ] ; then | ||
InDir="." | ||
fi | ||
|
||
OutPath="$2" | ||
OutFile="${OutPath##*/}" | ||
OutBase="${OutFile%.*}" | ||
OutDir="${OutPath%/*}" | ||
if [ "$OutDir" = "$OutPath" ] ; then | ||
OutDir="." | ||
fi | ||
|
||
|
||
# process | ||
|
||
ManFile="$OutBase.1" | ||
|
||
mkdir -p "$OutDir" | ||
|
||
pandoc -s -t man -o "$OutDir/$ManFile" "$InPath" | ||
|
||
gzip -f "$OutDir/$ManFile" | ||
} | ||
|
||
|
||
### Main | ||
# usage: | ||
# render FILE [FILE] | ||
# render report.md ./rendition/report.1 | ||
|
||
if [[ -n "${2/[ ]*\n/}" ]] ; then | ||
OutPath="$2" | ||
else | ||
OutPath="${1%.*}.html" # $2 is empty | ||
fi | ||
render "$1" "$OutPath" | ||
|
Oops, something went wrong.