Skip to content

Commit

Permalink
build: fix and simplify doc/index.rst generation
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vasild authored and ZmnSCPxj committed Feb 3, 2020
1 parent 1015e37 commit 149620e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ doc-clean:
$(RM) doc/deployable-lightning.{aux,bbl,blg,dvi,log,out,tex}

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
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ c-lightning Documentation
:maxdepth: 1
:caption: Manpages

lightningd <lightningd.8.md>
lightningd-config <lightningd-config.5.md>
lightning-autocleaninvoice <lightning-autocleaninvoice.7.md>
lightning-check <lightning-check.7.md>
lightning-checkmessage <lightning-checkmessage.7.md>
Expand Down Expand Up @@ -69,3 +67,5 @@ c-lightning Documentation
lightning-waitinvoice <lightning-waitinvoice.7.md>
lightning-waitsendpay <lightning-waitsendpay.7.md>
lightning-withdraw <lightning-withdraw.7.md>
lightningd <lightningd.8.md>
lightningd-config <lightningd-config.5.md>

0 comments on commit 149620e

Please sign in to comment.