Skip to content

Commit

Permalink
[doc] Build man page as HTML.
Browse files Browse the repository at this point in the history
Update version in URL.

Shell scripts to download the mandoc tool itself.
  • Loading branch information
Andy Chu committed Jul 10, 2019
1 parent 8a87333 commit 19b6731
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
31 changes: 30 additions & 1 deletion build/doc.sh
Expand Up @@ -41,6 +41,28 @@ log() {
echo "$@" 1>&2
}

#
# Deps (similar to devtools/cmark.sh and build/codegen.sh)
#

readonly MANDOC_DIR='_deps/mdocml-1.14.1'

download-mandoc() {
mkdir -p _deps
wget --no-clobber --directory _deps \
https://mandoc.bsd.lv/snapshots/mdocml-1.14.1.tar.gz
}

build-mandoc() {
cd $MANDOC_DIR
./configure
make
}

mandoc() {
$MANDOC_DIR/mandoc "$@"
}

_build-timestamp() {
echo '<hr/>'
echo "<i>Generated on $(date)</i>"
Expand Down Expand Up @@ -188,6 +210,13 @@ manual() {
ls -l $root_dir/doc
}

# TODO: This could use some CSS.
man-page() {
local root_dir=${1:-_release/VERSION}
mandoc -T html doc/osh.1 > $root_dir/osh.1.html
ls -l $root_dir
}

# I want to ship the INSTALL file literally, so just mutate things
_sed-ext() {
sed --regexp-extended -i "$@"
Expand All @@ -203,7 +232,7 @@ update-src-versions() {

_sed-ext \
"s;/release/[0-9]+\.[0-9]+\.[a-z0-9]+/;/release/$OIL_VERSION/;g" \
INSTALL.txt doc/osh-quick-ref-toc.txt
INSTALL.txt doc/osh-quick-ref-toc.txt doc/osh.1
}

oil-grammar() {
Expand Down
5 changes: 3 additions & 2 deletions devtools/cmark.sh
Expand Up @@ -8,11 +8,12 @@ set -o pipefail
set -o errexit

download() {
wget --directory _tmp \
mkdir -p _deps
wget --no-clobber --directory _deps \
https://github.com/commonmark/cmark/archive/0.28.3.tar.gz
}

readonly CMARK_DIR=_tmp/cmark-0.28.3
readonly CMARK_DIR=_deps/cmark-0.28.3

build() {
pushd $CMARK_DIR
Expand Down
2 changes: 1 addition & 1 deletion doc/osh.1
Expand Up @@ -74,7 +74,7 @@ The referenced command or script could not be found.
.Xr busybox 1 ,
.Xr sh 1
.Pp
.Lk http://www.oilshell.org/release/0.6.pre22/doc/osh-quick-ref.html OSH Quick Reference
.Lk http://www.oilshell.org/release/0.6.0/doc/osh-quick-ref.html OSH Quick Reference
.Sh AUTHORS
The
.Nm
Expand Down

0 comments on commit 19b6731

Please sign in to comment.