You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.4 KiB
Bash
64 lines
1.4 KiB
Bash
10 years ago
|
#! /bin/bash
|
||
|
|
||
|
if [ -z "$1" ]; then
|
||
9 years ago
|
echo "Expected /includes/head.html file as 1st arg."
|
||
10 years ago
|
exit 1
|
||
|
fi
|
||
|
|
||
9 years ago
|
if [ -z "$2" ]; then
|
||
|
echo "Expected /includes/nav.html file as 2nd arg."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [ -z "$3" ]; then
|
||
|
echo "Expected /includes/footer.html file as 3rd arg."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
|
||
|
HEADER=$1
|
||
|
NAV_BAR=$2
|
||
|
FOOTER=$3
|
||
|
|
||
|
if [ ! -f $HEADER ]; then
|
||
|
echo $HEADER " does not exist"
|
||
|
exit 1
|
||
|
fi
|
||
10 years ago
|
|
||
|
if [ ! -f $NAV_BAR ]; then
|
||
|
echo $NAV_BAR " does not exist"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
9 years ago
|
if [ ! -f $FOOTER ]; then
|
||
|
echo $FOOTER " does not exist"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
10 years ago
|
python gendoc.py
|
||
|
|
||
9 years ago
|
perl -MFile::Slurp -pi -e 'BEGIN { $header = read_file("'$HEADER'") } s#<head>#<head>$header
|
||
|
<link rel="stylesheet" href="//matrix.org/docs/guides/css/docs_overrides.css">
|
||
|
#' gen/specification.html gen/howtos.html
|
||
10 years ago
|
|
||
9 years ago
|
perl -MFile::Slurp -pi -e 'BEGIN { $nav = read_file("'$NAV_BAR'") } s#<body># <body class="blog et_fixed_nav et_cover_background et_right_sidebar">
|
||
|
<div id="page-wrapper">
|
||
|
<div class="page-content" id="page-container">
|
||
|
$nav
|
||
|
<div id="main-content">
|
||
|
<div class="wrapper" id="wrapper">
|
||
|
<div class="document_foo" id="document">
|
||
|
#' gen/specification.html gen/howtos.html
|
||
10 years ago
|
|
||
9 years ago
|
perl -MFile::Slurp -pi -e 'BEGIN { $footer = read_file("'$FOOTER'") } s#</body>#
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="push">
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
$footer
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>#' gen/specification.html gen/howtos.html
|