update generate-code-docs, the old method for getting version no longer

works because we have no makefile
This commit is contained in:
speedie 2023-05-08 12:08:59 +02:00
parent ca9e57768e
commit e0a719e428
2 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>spmenu documentation unknown</title>
<title>spmenu documentation 1.1</title>
<style>
html {
color: #1a1a1a;
@ -166,7 +166,7 @@
</head>
<body>
<header id="title-block-header">
<h1 class="title">spmenu documentation unknown</h1>
<h1 class="title">spmenu documentation 1.1</h1>
</header>
<nav id="TOC" role="doc-toc">
<ul>

View file

@ -1,6 +1,6 @@
#!/bin/sh
VERSION="$([ -f "Makefile" ] && grep "VERSION" Makefile | head -n 1 | awk '{ print $3 }' || printf "unknown\n")"
version="$(grep "version : '" meson.build | awk '{ print $3 }' | sed "s/'\"//g; s/\"',//g")"
[ ! -f "$1" ] && printf "You must specify an input file.\n" && exit 1
[ -z "$2" ] && printf "You must specify an output file.\n" && exit 1
pandoc -f markdown -t html5 --metadata title="spmenu documentation $VERSION" -s --toc -o "$2" "$1" || exit 1
pandoc -f markdown -t html5 --metadata title="spmenu documentation ${version}" -s --toc -o "$2" "$1" || exit 1
exit 0