forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: add md2man.sh tool, using lowdown.
Signed-off-by: Rusty Russell <[email protected]>
- Loading branch information
1 parent
0798a5d
commit 5865fce
Showing
1 changed file
with
15 additions
and
0 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,15 @@ | ||
#! /bin/sh | ||
|
||
if [ $# != 1 ]; then | ||
echo "Usage: $0 <markdownpage>" >&2 | ||
exit 1 | ||
fi | ||
SOURCE=$1 | ||
SECTION="$(basename "$SOURCE" .md | cut -d. -f2-)" | ||
TITLE="$(basename "$(basename "$SOURCE" .md)" ."$SECTION" | tr '[:lower:]' '[:upper:]')" | ||
|
||
# First two lines are title, which needs to be turned into NAME for proper manpage | ||
# format. mrkd used to do this for us, lowdown(1) doesn't. | ||
TITLELINE="$(head -n1 "$SOURCE")" | ||
|
||
(echo "NAME"; echo "----"; echo "$TITLELINE"; tail -n +3 "$SOURCE") | lowdown -s --out-no-smarty -Tman -m "title:$TITLE" -m "section:$SECTION" -m "source:Core Lightning $VERSION" -m "shiftheadinglevelby:-1" |