Browse Source

build: fix and simplify doc/index.rst generation

* Fix usage of `echo "...\n..."` (without `-e`), generating a
broken output:
```
   lightningd-config <lightningd-config.5.md>
   lightningd\nlightning-autocleaninvoice.7.md <lightningd.8.md\nlightning-autocleaninvoice.7.md>
```

* Use `$(SORT)` instead of bare `sort` to avoid locale-dependent sort.

* Strip the trailing .[0-9].md without invoking sed.

* Sort all man pages as one block.

Changelog-None
travis-debug
Vasil Dimov 5 years ago
committed by ZmnSCPxj, ZmnSCPxj jxPCSmnZ
parent
commit
149620ee0f
  1. 2
      doc/Makefile
  2. 4
      doc/index.rst

2
doc/Makefile

@ -97,6 +97,6 @@ doc-clean:
$(RM) doc/deployable-lightning.{aux,bbl,blg,dvi,log,out,tex} $(RM) doc/deployable-lightning.{aux,bbl,blg,dvi,log,out,tex}
doc/index.rst: doc/index.rst:
(grep -v '^ lightning.*\.[0-9]\.md>$$' $@; for m in $$(cd doc && echo "$$(ls lightningd*.[0-9].md | sort)\n$$(ls lightning-*.[0-9].md | sort)"); do echo " $$(echo $$m | sed 's/.[0-9].md//') <$$m>"; done) > $@.tmp.$$$$ && mv $@.tmp.$$$$ $@ (grep -v '^ lightning.*\.[0-9]\.md>$$' $@; for m in $$(cd doc && ls lightningd*.[0-9].md lightning-*.[0-9].md); do echo " $${m%.[0-9].md} <$$m>"; done |$(SORT)) > $@.tmp.$$$$ && mv $@.tmp.$$$$ $@
.PHONY: doc/index.rst .PHONY: doc/index.rst

4
doc/index.rst

@ -27,8 +27,6 @@ c-lightning Documentation
:maxdepth: 1 :maxdepth: 1
:caption: Manpages :caption: Manpages
lightningd <lightningd.8.md>
lightningd-config <lightningd-config.5.md>
lightning-autocleaninvoice <lightning-autocleaninvoice.7.md> lightning-autocleaninvoice <lightning-autocleaninvoice.7.md>
lightning-check <lightning-check.7.md> lightning-check <lightning-check.7.md>
lightning-checkmessage <lightning-checkmessage.7.md> lightning-checkmessage <lightning-checkmessage.7.md>
@ -69,3 +67,5 @@ c-lightning Documentation
lightning-waitinvoice <lightning-waitinvoice.7.md> lightning-waitinvoice <lightning-waitinvoice.7.md>
lightning-waitsendpay <lightning-waitsendpay.7.md> lightning-waitsendpay <lightning-waitsendpay.7.md>
lightning-withdraw <lightning-withdraw.7.md> lightning-withdraw <lightning-withdraw.7.md>
lightningd <lightningd.8.md>
lightningd-config <lightningd-config.5.md>

Loading…
Cancel
Save