mirror of
https://gitee.com/mirrors_adrian-thurston/yq.git
synced 2026-01-15 07:53:35 +08:00
Man page release workflow wip
This commit is contained in:
19
scripts/generate-man-page-md.sh
Executable file
19
scripts/generate-man-page-md.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#! /bin/bash
|
||||
set -e
|
||||
|
||||
# note that this reqires pandoc to be installed.
|
||||
|
||||
cat ./pkg/yqlib/doc/headers/Main.md > man.md
|
||||
printf "\n# HOW IT WORKS\n" >> man.md
|
||||
cat ./pkg/yqlib/doc/aa.md >> man.md
|
||||
|
||||
for f in ./pkg/yqlib/doc/*.md; do
|
||||
docNameWithExt="${f##*/}"
|
||||
docName="${docNameWithExt%.*}"
|
||||
docNameCap=$(echo $docName | tr [a-z] [A-Z])
|
||||
if [ "$docName" != "aa" ]; then
|
||||
printf "\n\n# ${docNameCap}\n" >> man.md
|
||||
cat "$f" >> man.md
|
||||
fi
|
||||
|
||||
done
|
||||
@@ -3,26 +3,9 @@ set -e
|
||||
|
||||
# note that this reqires pandoc to be installed.
|
||||
|
||||
cat ./pkg/yqlib/doc/headers/Main.md > man.md
|
||||
printf "\n# HOW IT WORKS\n" >> man.md
|
||||
cat ./pkg/yqlib/doc/aa.md >> man.md
|
||||
|
||||
for f in ./pkg/yqlib/doc/*.md; do
|
||||
docNameWithExt="${f##*/}"
|
||||
docName="${docNameWithExt%.*}"
|
||||
docNameCap=$(echo $docName | tr [a-z] [A-Z])
|
||||
if [ "$docName" != "aa" ]; then
|
||||
printf "\n\n# ${docNameCap}\n" >> man.md
|
||||
cat "$f" >> man.md
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
header=$(./yq --version)
|
||||
|
||||
pandoc \
|
||||
--variable=title:"YQ" \
|
||||
--variable=section:"1" \
|
||||
--variable=author:"Mike Farah" \
|
||||
--variable=header:"${header}" \
|
||||
--standalone --to man man.md -o build/yq.1
|
||||
--variable=header:"${MAN_HEADER}" \
|
||||
--standalone --to man man.md -o yq.1
|
||||
@@ -6,8 +6,6 @@ set -e
|
||||
|
||||
CGO_ENABLED=0 gox -ldflags "${LDFLAGS}" -output="build/yq_{{.OS}}_{{.Arch}}" --osarch="darwin/amd64 darwin/arm64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm linux/arm64 linux/mips linux/mips64 linux/mips64le linux/mipsle linux/ppc64 linux/ppc64le linux/s390x netbsd/386 netbsd/amd64 netbsd/arm openbsd/386 openbsd/amd64 windows/386 windows/amd64"
|
||||
|
||||
./scripts/generate-man-page.sh
|
||||
|
||||
cd build
|
||||
|
||||
find . -executable -type f | xargs -I {} tar czvf {}.tar.gz {} yq.1 -C ../scripts install-man-page.sh
|
||||
|
||||
Reference in New Issue
Block a user