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
Isaac Ullah
committed
Jun 10, 2020
1 parent
0bbe2f9
commit 9dba3f3
Showing
3 changed files
with
520 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
## Converts an html file generated from markdown into | ||
## the format expected for GRASS documentation. | ||
## Specifcally, html tags are converted to expected | ||
## ones, and unacceptable tags are removed. Lines are | ||
## then wrapped at 80 chars. | ||
if [ "$1" == "-h" ] || [ $# -eq 0 ] ; then | ||
echo "Converts an html file generated from markdown | ||
into the format expected for GRASS documentation." | ||
echo "Usage: `basename $0` inputfile.html [-h]" | ||
exit 0 | ||
fi | ||
tf=$!"tmp.txt" | ||
sed -r -i 's|<head>.*</head>||g' $1 | ||
sed -r -i 's|<(/)?html>||g' $1 | ||
sed -r -i 's|<(/)?body>||g' $1 | ||
sed -r 's|<(/)?strong>|<\1b>|g' $1 >$tf | ||
fmt -w 80 $tf >$1 | ||
rm -f $tf | ||
|
Oops, something went wrong.