Skip to content

Commit

Permalink
doc: don't include exact version in manpages.
Browse files Browse the repository at this point in the history
This slows compilation somewhat when we make small changes (e.g. making the tree dirty).
Instead, simply mark them as "pre-XXX" or "XXX".

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and vincenzopalazzo committed Jul 2, 2024
1 parent d6ae456 commit d922c89
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,14 @@ else
LOWDOWN := lowdown
endif

$(MANPAGES): doc/%: doc/%.md tools/md2man.sh version_gen.h
@VERSION=$(VERSION) tools/md2man.sh $(LOWDOWN) $< > $@
# For versions in documentation, we don't change with every git version, to
# save build time. We simply to pre-XXX and XXX.
doc/.doc_version: version_gen.h
@if [ "$(VERSION)" = "$(CLN_NEXT_VERSION)" ]; then DOC_VERSION="$(VERSION)"; else DOC_VERSION="pre-$(CLN_NEXT_VERSION)"; fi; echo $$DOC_VERSION > $@.new
@if cmp $@.new $@ >/dev/null 2>&1; then rm -f $@.new; else mv $@.new $@; $(ECHO) Documentation version updated to `cat doc/.doc_version`; fi

$(MANPAGES): doc/%: doc/%.md tools/md2man.sh doc/.doc_version
@VERSION=`cat doc/.doc_version` tools/md2man.sh $(LOWDOWN) $< > $@

doc/protocol-%.svg: test/test_protocol
test/test_protocol --svg < test/commits/$*.script > $@
Expand Down Expand Up @@ -231,7 +237,7 @@ check-config-docs:
@for c in `grep -v '\[plugin ' doc/lightningd-config.5.md | sed -n 's/^ \*\*\([^*]*\)\*\*.*/\1/p' | grep -v '^\(help\|version\|mainnet\|testnet\|signet\|plugin\|important-plugin\|plugin-dir\|clear-plugins\)$$'`; do if ! grep -q '"'"$$c"'"' doc/schemas/lightning-listconfigs.json; then echo "$$c documented but not in schema!"; exit 1; fi; done

doc-clean:
$(RM) $(MANPAGES) $(MARKDOWN_WITH_SCHEMA)
$(RM) $(MANPAGES) $(MARKDOWN_WITH_SCHEMA) doc/.doc_version
$(RM) doc/deployable-lightning.{aux,bbl,blg,dvi,log,out,tex}

doc/index.rst: $(MANPAGES:=.md)
Expand Down

0 comments on commit d922c89

Please sign in to comment.