2017-01-23 10:35:27 +10:30
#! /usr/bin/make
# Designed to be run one level up
doc-wrongdir :
$( MAKE) -C .. doc-all
2024-03-03 18:30:24 -08:00
GENERATE_MARKDOWN := doc/lightning-addgossip.7 \
doc/lightning-addpsbtoutput.7 \
2022-12-06 05:35:01 +10:30
doc/lightning-autoclean-once.7 \
2022-09-19 10:23:00 +09:30
doc/lightning-autoclean-status.7 \
2022-09-19 10:24:23 +09:30
doc/lightning-batching.7 \
2022-07-19 17:04:39 +09:30
doc/lightning-bkpr-channelsapy.7 \
doc/lightning-bkpr-dumpincomecsv.7 \
doc/lightning-bkpr-inspect.7 \
doc/lightning-bkpr-listaccountevents.7 \
doc/lightning-bkpr-listbalances.7 \
doc/lightning-bkpr-listincome.7 \
2023-07-21 10:55:45 +09:30
doc/lightning-blacklistrune.7 \
2018-12-07 11:31:16 -06:00
doc/lightning-check.7 \
2019-10-13 15:49:37 +10:30
doc/lightning-checkmessage.7 \
2023-07-21 10:55:45 +09:30
doc/lightning-checkrune.7 \
2018-04-10 06:03:15 +00:00
doc/lightning-close.7 \
2023-03-31 12:26:18 +10:30
doc/lightning-commando-blacklist.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-commando.7 \
2023-03-31 12:26:18 +10:30
doc/lightning-commando-listrunes.7 \
2022-07-16 22:48:27 +09:30
doc/lightning-commando-rune.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-connect.7 \
2020-12-14 11:51:48 +10:30
doc/lightning-createinvoice.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-createonion.7 \
2023-07-21 10:55:45 +09:30
doc/lightning-createrune.7 \
2021-08-25 12:20:12 +09:30
doc/lightning-datastore.7 \
2023-07-24 20:47:46 +02:00
doc/lightning-datastoreusage.7 \
2021-01-08 05:18:47 +10:30
doc/lightning-decode.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-decodepay.7 \
2021-08-25 12:20:12 +09:30
doc/lightning-deldatastore.7 \
2022-09-19 10:22:58 +09:30
doc/lightning-delforward.7 \
2017-01-23 10:35:27 +10:30
doc/lightning-delinvoice.7 \
2020-08-08 17:47:53 +02:00
doc/lightning-delpay.7 \
2024-01-25 10:58:54 +10:30
doc/lightning-deprecations.7 \
2024-02-05 21:56:24 -08:00
doc/lightning-dev-forget-channel.7 \
2023-03-06 13:30:58 +10:30
doc/lightning-disableinvoicerequest.7 \
2021-02-18 10:26:19 +10:30
doc/lightning-disableoffer.7 \
2018-12-03 05:20:25 +00:00
doc/lightning-disconnect.7 \
2022-06-24 07:09:12 +05:30
doc/lightning-emergencyrecover.7 \
2020-07-12 11:30:35 +08:00
doc/lightning-feerates.7 \
2021-01-08 05:15:47 +10:30
doc/lightning-fetchinvoice.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-fundchannel_cancel.7 \
doc/lightning-fundchannel_complete.7 \
2018-05-03 09:54:39 -05:00
doc/lightning-fundchannel.7 \
2019-06-05 16:32:04 -07:00
doc/lightning-fundchannel_start.7 \
2021-07-15 11:48:36 -05:00
doc/lightning-funderupdate.7 \
2020-07-15 15:09:47 +09:30
doc/lightning-fundpsbt.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-getinfo.7 \
doc/lightning-getlog.7 \
2017-01-23 10:35:27 +10:30
doc/lightning-getroute.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-help.7 \
2017-01-23 10:35:27 +10:30
doc/lightning-invoice.7 \
2023-03-06 13:30:58 +10:30
doc/lightning-invoicerequest.7 \
2020-07-01 13:35:58 +02:00
doc/lightning-keysend.7 \
2019-01-07 19:09:59 +00:00
doc/lightning-listchannels.7 \
2023-03-20 10:51:50 +10:30
doc/lightning-listclosedchannels.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-listconfigs.7 \
2021-08-25 12:20:12 +09:30
doc/lightning-listdatastore.7 \
2019-01-11 23:05:46 +01:00
doc/lightning-listforwards.7 \
2018-04-26 13:22:09 +03:00
doc/lightning-listfunds.7 \
2022-09-19 10:19:53 +09:30
doc/lightning-listhtlcs.7 \
2023-03-06 13:30:58 +10:30
doc/lightning-listinvoicerequests.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-listinvoices.7 \
doc/lightning-listnodes.7 \
2021-02-18 10:26:19 +10:30
doc/lightning-listoffers.7 \
2019-02-23 15:30:04 +10:30
doc/lightning-listpays.7 \
2023-01-12 11:46:10 +10:30
doc/lightning-listpeerchannels.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-listpeers.7 \
2019-02-23 15:30:04 +10:30
doc/lightning-listsendpays.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-listtransactions.7 \
2022-06-24 07:09:12 +05:30
doc/lightning-makesecret.7 \
2020-09-09 12:41:37 +09:30
doc/lightning-multifundchannel.7 \
2020-09-09 19:56:14 +09:30
doc/lightning-multiwithdraw.7 \
2018-04-26 13:22:09 +03:00
doc/lightning-newaddr.7 \
2020-10-12 16:03:50 +10:30
doc/lightning-notifications.7 \
2021-01-08 05:15:47 +10:30
doc/lightning-offer.7 \
2021-03-09 15:14:08 -06:00
doc/lightning-openchannel_abort.7 \
2021-03-10 22:33:47 -06:00
doc/lightning-openchannel_bump.7 \
2020-09-03 13:01:45 -05:00
doc/lightning-openchannel_init.7 \
2020-09-10 14:43:40 -05:00
doc/lightning-openchannel_signed.7 \
doc/lightning-openchannel_update.7 \
2021-06-23 14:31:47 -05:00
doc/lightning-parsefeerate.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-pay.7 \
doc/lightning-ping.7 \
2019-08-10 01:22:23 +02:00
doc/lightning-plugin.7 \
2022-09-13 09:37:05 -07:00
doc/lightning-preapproveinvoice.7 \
2022-12-05 20:11:36 -08:00
doc/lightning-preapprovekeysend.7 \
2022-06-24 07:09:12 +05:30
doc/lightning-recoverchannel.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-recover.7 \
2023-08-07 10:30:20 +01:00
doc/lightning-renepay.7 \
doc/lightning-renepaystatus.7 \
2020-06-09 19:20:18 -05:00
doc/lightning-reserveinputs.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-sendcustommsg.7 \
2021-01-08 05:15:47 +10:30
doc/lightning-sendinvoice.7 \
2019-11-14 17:51:28 +01:00
doc/lightning-sendonion.7 \
2021-01-14 14:06:49 +10:30
doc/lightning-sendonionmessage.7 \
2017-01-23 10:35:27 +10:30
doc/lightning-sendpay.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-sendpsbt.7 \
2022-03-21 11:28:28 +10:30
doc/lightning-setchannel.7 \
2023-06-06 10:08:52 +09:30
doc/lightning-setconfig.7 \
2023-03-02 15:45:40 -05:00
doc/lightning-setpsbtversion.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-showrunes.7 \
2022-11-06 19:45:47 -05:00
doc/lightning-signinvoice.7 \
2019-10-13 15:49:37 +10:30
doc/lightning-signmessage.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-signpsbt.7 \
2023-08-03 15:34:14 -04:00
doc/lightning-splice_init.7 \
doc/lightning-splice_signed.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-splice_update.7 \
2024-03-25 11:07:45 +10:30
doc/lightning-staticbackup.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-stop.7 \
2019-06-05 16:30:05 +09:30
doc/lightning-txdiscard.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-txprepare.7 \
2019-06-05 16:30:05 +09:30
doc/lightning-txsend.7 \
2020-06-09 19:20:18 -05:00
doc/lightning-unreserveinputs.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-upgradewallet.7 \
2020-08-18 11:52:53 +09:30
doc/lightning-utxopsbt.7 \
2018-03-08 00:19:55 +00:00
doc/lightning-waitanyinvoice.7 \
2019-12-26 10:19:09 +00:00
doc/lightning-waitblockheight.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-waitinvoice.7 \
doc/lightning-wait.7 \
2018-04-26 13:12:17 +03:00
doc/lightning-waitsendpay.7 \
2024-03-03 18:30:24 -08:00
doc/lightning-withdraw.7
2017-01-23 10:35:27 +10:30
2023-02-06 12:21:30 +10:30
i f e q ( $( HAVE_SQLITE 3) , 1 )
2024-03-03 18:30:24 -08:00
GENERATE_MARKDOWN += doc/lightning-listsqlschemas.7 \
doc/lightning-sql.7
2023-02-06 12:21:30 +10:30
e n d i f
2024-03-03 18:30:24 -08:00
MANPAGES := $( GENERATE_MARKDOWN) \
doc/lightning-cli.1 \
doc/lightningd.8 \
doc/lightningd-config.5 \
doc/lightningd-rpc.7 \
doc/lightning-hsmtool.8 \
doc/reckless.7
MARKDOWN_WITH_SCHEMA := $( GENERATE_MARKDOWN:= .md)
2024-02-22 21:45:08 -08:00
# - Read the json template from schemas/lightning-sql-template.json
# - Generate the tables schema via plugins/sql
# - Merge both and generate final schemas/lightning-sql.json
doc/schemas/lightning-sql.json : doc /schemas /lightning -sql -template .json plugins /sql
@plugins/sql --print-docs | jq --arg sqldata " $$ (awk '{printf " %s\n " , $$ 0}') " '.tables += [$$sqldata]' $< > " $@ .tmp " && mv " $@ .tmp " " $@ " ;
2024-03-03 18:30:24 -08:00
2021-12-06 10:33:52 +10:30
doc-all : $( MANPAGES ) doc /index .rst
2021-11-04 15:13:43 +01:00
2024-03-03 18:30:24 -08:00
SCHEMAS := $( wildcard doc/schemas/lightning-*.json)
# Don't try to build lightning-sql.json tables with plugins/sql if we don't have sqlite3
i f e q ( $( HAVE_SQLITE 3) , 0 )
SCHEMAS := $( filter-out doc/schemas/lightning-sql.json, $( SCHEMAS) )
e n d i f
2021-12-06 10:33:52 +10:30
check-fmt-schemas : $( SCHEMAS :%=check -fmt -schema /%)
2022-02-05 14:38:18 +01:00
fmt-schemas : $( SCHEMAS :%=fmt -schema /%)
2021-11-04 15:13:43 +01:00
2021-12-06 10:33:52 +10:30
check-fmt-schema/% : %
@jq . < " $* " > " $* " .fmt && diff -u " $* " " $* .fmt " && rm " $* .fmt "
2022-02-05 14:38:18 +01:00
fmt-schema/% : %
@jq . < " $* " > " $* " .fmt && cat " $* " .fmt > " $* " && rm " $* .fmt "
2021-12-06 10:33:52 +10:30
check-doc : check -config -docs check -manpages check -fmt -schemas
2017-01-23 10:35:27 +10:30
2021-05-26 15:19:01 +09:30
# These are hard to use in $(call) functions.
LBRACKET = (
RBRACKET = )
2024-03-03 18:30:24 -08:00
$(MARKDOWN_WITH_SCHEMA) : doc /lightning -%.7.md : doc /schemas /lightning -%.json tools /fromschema .py
@tools/fromschema.py --markdownfile= $@ $< > $@ .tmp && mv $@ .tmp $@
2021-05-26 15:19:01 +09:30
2022-09-06 13:40:32 +09:30
# If we need to build lowdown, make tools/md2man.sh depend on it.
# That way it's not used in SHA256STAMP (which only uses direct
# dependencies), but make will be forced to build it.
i f e q ( $( HAVE_LOWDOWN ) , 0 )
LOWDOWN := $( TARGET_DIR) /lowdown-build/bin/lowdown
tools/md2man.sh : $( LOWDOWN )
touch $@
e l s e
LOWDOWN := lowdown
e n d i f
Makefile: replace mrkd with lowdown(1).
Here's the before-vs-after comparison (ignoring whitespace changes):
```diff
--- /tmp/before 2022-07-20 21:52:44.336641810 +0930
+++ /tmp/after 2022-07-20 21:55:54.355487769 +0930
@@ -1,7 +1,7 @@
-LIGHTNING-CLI(1) lightning-cli LIGHTNING-CLI(1)
+LIGHTNING-CLI(1) LIGHTNING-CLI(1)
NAME
- lightning-cli - Control lightning daemon
+ lightning-cli -- Control lightning daemon
SYNOPSIS
lightning-cli [OPTIONS] command
@@ -14,10 +14,7 @@
--conf=PATH Sets configuration file (default: lightning-dir/config ).
- --network=network
- --mainnet
- --testnet
- --signet Sets network explicitly.
+ --network=network --mainnet --testnet --signet Sets network explicitly.
--rpc-file=FILE Named pipe to use to talk to lightning daemon: default is lightning-rpc in the lightning directory.
@@ -43,8 +40,8 @@
--version/-V Print version number to standard output and exit.
- allow-deprecated-apis=BOOL Enable deprecated options. It defaults to true, but you should set it to false when testing
- to ensure that an upgrade won't break your configuration.
+ allow-deprecated-apis=BOOL Enable deprecated options. It defaults to true, but you should set it to false when testing to
+ ensure that an upgrade won't break your configuration.
COMMANDS
lightning-cli simply uses the JSON RPC interface to talk to lightningd, and prints the results. Thus the commands avail‐
@@ -67,7 +64,7 @@
lightning-cli help
- 1. Fund a 10k sat channel using uncomfirmed outputs
+ 2. Fund a 10k sat channel using uncomfirmed outputs
lightning-cli --keywords fundchannel id=028f...ae7d amount=10000sat minconf=0
@@ -84,4 +81,4 @@
Note: the modules in the ccan/ directory have their own licenses, but the rest of the code is covered by the BSD-style
MIT license.
- LIGHTNING-CLI(1)
+Core Lightning v0.11.0.1-350-gac2e137 LIGHTNING-CLI(1)
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: #5437
2022-09-01 04:12:41 +09:30
$(MANPAGES) : doc /%: doc /%.md tools /md 2man .sh version_gen .h
2024-03-03 18:30:24 -08:00
@VERSION= $( VERSION) tools/md2man.sh $( LOWDOWN) $< > $@
2017-01-23 10:35:27 +10:30
doc/protocol-%.svg : test /test_protocol
test/test_protocol --svg < test/commits/$* .script > $@
protocol-diagrams : $( patsubst %.script , doc /protocol -%.svg , $ ( notdir $ ( wildcard test /commits /*.script ) ) )
doc/deployable-lightning.pdf : doc /deployable -lightning .lyx doc /bitcoin .bib
lyx -E pdf $@ $<
doc/deployable-lightning.tex : doc /deployable -lightning .lyx
lyx -E latex $@ $<
state-diagrams : doc /normal -states .svg doc /simplified -states .svg doc /error -states .svg doc /full -states .svg
%.svg : %.dot
dot -Tsvg $< > $@ || ( rm -f $@ ; false )
doc/simplified-states.dot : test /test_state_coverage
test/test_state_coverage --dot --dot-simplify > $@
doc/normal-states.dot : test /test_state_coverage
test/test_state_coverage --dot > $@
doc/error-states.dot : test /test_state_coverage
test/test_state_coverage --dot-all --dot-include-errors > $@
doc/full-states.dot : test /test_state_coverage
test/test_state_coverage --dot-all --dot-include-errors --dot-include-nops > $@
clean : doc -clean
2018-05-17 14:16:22 +09:30
check : check -manpages
2019-08-22 15:47:24 +09:30
# This needs plugins, too.
2022-04-12 14:29:30 +09:30
check-manpages : all -programs check -config -docs default -targets
2019-08-10 12:50:31 +02:00
@tools/check-manpage.sh cli/lightning-cli doc/lightning-cli.1.md
@tools/check-manpage.sh "lightningd/lightningd --lightning-dir=/tmp/" doc/lightningd-config.5.md
2022-11-10 20:49:29 -05:00
@awk '/^$$/ { do { getline } while ($$0 ~ /^( {4,}|\t)/) } /^\s*```/ { do { getline } while ($$0 !~ /^\s*```/) } /^([^`_\\]|`([^`\\]|\\.)*`|\b_|_\b|\\.)*\B_\B/ { print "" ; print "Unescaped underscore at " FILENAME ":" NR ":" ; print ; ret = 1 } ENDFILE { NR = 0 } END { exit ret }' doc/*.[ 0-9] .md
2017-01-23 10:35:27 +10:30
2021-06-16 10:42:17 +09:30
# Makes sure that fields mentioned in schema are in man page, and vice versa.
check-config-docs :
2024-03-03 18:30:24 -08:00
@for c in ` sed -n 's/^ "\(.*\)": {/\1/p' doc/schemas/lightning-listconfigs.json | grep -v '^# version$$' | grep -v '^plugins$$' | grep -v '^important-plugins$$' ` ; do if ! grep -q " ^ \*\* $$ c\*\* " doc/lightningd-config.5.md; then echo " $$ c undocumented! " ; exit 1; fi ; done
@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
2021-06-16 10:42:17 +09:30
2017-01-23 10:35:27 +10:30
doc-clean :
2024-03-25 11:07:52 +10:30
$( RM) $( MANPAGES) $( MARKDOWN_WITH_SCHEMA)
2017-01-23 10:35:27 +10:30
$( RM) doc/deployable-lightning.{ aux,bbl,blg,dvi,log,out,tex}
2020-08-25 11:03:08 +09:30
doc/index.rst : $( MANPAGES :=.md )
2022-12-01 13:31:30 +01:00
@$( call VERBOSE, " genidx $@ " , \
find doc -maxdepth 1 -name '*\.[0-9]\.md' | \
cut -b 5- | LC_ALL = C sort | \
2023-01-31 16:06:27 +01:00
sed "s/\(.*\)\.\(.*\).*\.md/\1 <\1.\2.md>/" | \
2023-08-28 11:42:08 +09:30
$( PYTHON) devtools/blockreplace.py doc/index.rst manpages --language= rst --indent " " \
2022-12-01 13:31:30 +01:00
)
2023-01-10 10:23:26 +10:30
2023-06-01 15:47:20 +09:30
# Overridden by GH CI if necessary.
BASE_REF = master
2023-10-03 16:16:44 +02:00
check-source :