4
4
doc-wrongdir :
5
5
$(MAKE ) -C .. doc-all
6
6
7
- GENERATE_MARKDOWN := doc/lightning-addgossip.7 \
8
- doc/lightning-addpsbtoutput.7 \
9
- doc/lightning-askrene-age.7 \
10
- doc/lightning-askrene-bias-channel.7 \
11
- doc/lightning-askrene-create-layer.7 \
12
- doc/lightning-askrene-remove-layer.7 \
13
- doc/lightning-askrene-create-channel.7 \
14
- doc/lightning-askrene-update-channel.7 \
15
- doc/lightning-askrene-disable-node.7 \
16
- doc/lightning-askrene-inform-channel.7 \
17
- doc/lightning-askrene-listlayers.7 \
18
- doc/lightning-askrene-listreservations.7 \
19
- doc/lightning-askrene-reserve.7 \
20
- doc/lightning-askrene-unreserve.7 \
21
- doc/lightning-autoclean-once.7 \
22
- doc/lightning-autoclean-status.7 \
23
- doc/lightning-batching.7 \
24
- doc/lightning-bkpr-channelsapy.7 \
25
- doc/lightning-bkpr-dumpincomecsv.7 \
26
- doc/lightning-bkpr-editdescriptionbyoutpoint.7 \
27
- doc/lightning-bkpr-editdescriptionbypaymentid.7 \
28
- doc/lightning-bkpr-inspect.7 \
29
- doc/lightning-bkpr-listaccountevents.7 \
30
- doc/lightning-bkpr-listbalances.7 \
31
- doc/lightning-bkpr-listincome.7 \
32
- doc/lightning-blacklistrune.7 \
33
- doc/lightning-check.7 \
34
- doc/lightning-checkmessage.7 \
35
- doc/lightning-checkrune.7 \
36
- doc/lightning-close.7 \
37
- doc/lightning-commando.7 \
38
- doc/lightning-connect.7 \
39
- doc/lightning-createinvoice.7 \
40
- doc/lightning-createonion.7 \
41
- doc/lightning-createrune.7 \
42
- doc/lightning-datastore.7 \
43
- doc/lightning-datastoreusage.7 \
44
- doc/lightning-decode.7 \
45
- doc/lightning-decodepay.7 \
46
- doc/lightning-deldatastore.7 \
47
- doc/lightning-delforward.7 \
48
- doc/lightning-delinvoice.7 \
49
- doc/lightning-delpay.7 \
50
- doc/lightning-deprecations.7 \
51
- doc/lightning-dev-forget-channel.7 \
52
- doc/lightning-dev-splice.7 \
53
- doc/lightning-disableinvoicerequest.7 \
54
- doc/lightning-disableoffer.7 \
55
- doc/lightning-disconnect.7 \
56
- doc/lightning-emergencyrecover.7 \
57
- doc/lightning-enableoffer.7 \
58
- doc/lightning-exposesecret.7 \
59
- doc/lightning-feerates.7 \
60
- doc/lightning-fetchinvoice.7 \
61
- doc/lightning-fundchannel_cancel.7 \
62
- doc/lightning-fundchannel_complete.7 \
63
- doc/lightning-fundchannel.7 \
64
- doc/lightning-fundchannel_start.7 \
65
- doc/lightning-funderupdate.7 \
66
- doc/lightning-fundpsbt.7 \
67
- doc/lightning-getemergencyrecoverdata.7 \
68
- doc/lightning-getinfo.7 \
69
- doc/lightning-getlog.7 \
70
- doc/lightning-getroute.7 \
71
- doc/lightning-getroutes.7 \
72
- doc/lightning-help.7 \
73
- doc/lightning-injectonionmessage.7 \
74
- doc/lightning-injectpaymentonion.7 \
75
- doc/lightning-invoice.7 \
76
- doc/lightning-invoicerequest.7 \
77
- doc/lightning-keysend.7 \
78
- doc/lightning-listaddresses.7 \
79
- doc/lightning-listchannels.7 \
80
- doc/lightning-listclosedchannels.7 \
81
- doc/lightning-listconfigs.7 \
82
- doc/lightning-listdatastore.7 \
83
- doc/lightning-listforwards.7 \
84
- doc/lightning-listfunds.7 \
85
- doc/lightning-listhtlcs.7 \
86
- doc/lightning-listinvoicerequests.7 \
87
- doc/lightning-listinvoices.7 \
88
- doc/lightning-listnodes.7 \
89
- doc/lightning-listoffers.7 \
90
- doc/lightning-listpays.7 \
91
- doc/lightning-listpeerchannels.7 \
92
- doc/lightning-listpeers.7 \
93
- doc/lightning-listsendpays.7 \
94
- doc/lightning-listtransactions.7 \
95
- doc/lightning-makesecret.7 \
96
- doc/lightning-multifundchannel.7 \
97
- doc/lightning-multiwithdraw.7 \
98
- doc/lightning-newaddr.7 \
99
- doc/lightning-notifications.7 \
100
- doc/lightning-offer.7 \
101
- doc/lightning-openchannel_abort.7 \
102
- doc/lightning-openchannel_bump.7 \
103
- doc/lightning-openchannel_init.7 \
104
- doc/lightning-openchannel_signed.7 \
105
- doc/lightning-openchannel_update.7 \
106
- doc/lightning-parsefeerate.7 \
107
- doc/lightning-pay.7 \
108
- doc/lightning-ping.7 \
109
- doc/lightning-plugin.7 \
110
- doc/lightning-preapproveinvoice.7 \
111
- doc/lightning-preapprovekeysend.7 \
112
- doc/lightning-reckless.7 \
113
- doc/lightning-recoverchannel.7 \
114
- doc/lightning-recover.7 \
115
- doc/lightning-renepay.7 \
116
- doc/lightning-renepaystatus.7 \
117
- doc/lightning-reserveinputs.7 \
118
- doc/lightning-sendcustommsg.7 \
119
- doc/lightning-sendinvoice.7 \
120
- doc/lightning-sendonion.7 \
121
- doc/lightning-sendpay.7 \
122
- doc/lightning-sendpsbt.7 \
123
- doc/lightning-setchannel.7 \
124
- doc/lightning-setconfig.7 \
125
- doc/lightning-setpsbtversion.7 \
126
- doc/lightning-showrunes.7 \
127
- doc/lightning-signinvoice.7 \
128
- doc/lightning-signmessage.7 \
129
- doc/lightning-signpsbt.7 \
130
- doc/lightning-splice_init.7 \
131
- doc/lightning-splice_signed.7 \
132
- doc/lightning-splice_update.7 \
133
- doc/lightning-staticbackup.7 \
134
- doc/lightning-stop.7 \
135
- doc/lightning-txdiscard.7 \
136
- doc/lightning-txprepare.7 \
137
- doc/lightning-txsend.7 \
138
- doc/lightning-unreserveinputs.7 \
139
- doc/lightning-upgradewallet.7 \
140
- doc/lightning-utxopsbt.7 \
141
- doc/lightning-waitanyinvoice.7 \
142
- doc/lightning-waitblockheight.7 \
143
- doc/lightning-waitinvoice.7 \
144
- doc/lightning-wait.7 \
145
- doc/lightning-waitsendpay.7 \
146
- doc/lightning-withdraw.7 \
147
- doc/lightning-xpay.7
7
+ MARKDOWNPAGES := doc/addgossip.7 \
8
+ doc/addpsbtoutput.7 \
9
+ doc/askrene-age.7 \
10
+ doc/askrene-bias-channel.7 \
11
+ doc/askrene-create-layer.7 \
12
+ doc/askrene-remove-layer.7 \
13
+ doc/askrene-create-channel.7 \
14
+ doc/askrene-update-channel.7 \
15
+ doc/askrene-disable-node.7 \
16
+ doc/askrene-inform-channel.7 \
17
+ doc/askrene-listlayers.7 \
18
+ doc/askrene-listreservations.7 \
19
+ doc/askrene-reserve.7 \
20
+ doc/askrene-unreserve.7 \
21
+ doc/autoclean-once.7 \
22
+ doc/autoclean-status.7 \
23
+ doc/batching.7 \
24
+ doc/bkpr-channelsapy.7 \
25
+ doc/bkpr-dumpincomecsv.7 \
26
+ doc/bkpr-editdescriptionbyoutpoint.7 \
27
+ doc/bkpr-editdescriptionbypaymentid.7 \
28
+ doc/bkpr-inspect.7 \
29
+ doc/bkpr-listaccountevents.7 \
30
+ doc/bkpr-listbalances.7 \
31
+ doc/bkpr-listincome.7 \
32
+ doc/blacklistrune.7 \
33
+ doc/check.7 \
34
+ doc/checkmessage.7 \
35
+ doc/checkrune.7 \
36
+ doc/close.7 \
37
+ doc/commando-blacklist.7 \
38
+ doc/commando.7 \
39
+ doc/commando-listrunes.7 \
40
+ doc/commando-rune.7 \
41
+ doc/connect.7 \
42
+ doc/createinvoice.7 \
43
+ doc/createonion.7 \
44
+ doc/createrune.7 \
45
+ doc/datastore.7 \
46
+ doc/datastoreusage.7 \
47
+ doc/decode.7 \
48
+ doc/decodepay.7 \
49
+ doc/deldatastore.7 \
50
+ doc/delforward.7 \
51
+ doc/delinvoice.7 \
52
+ doc/delpay.7 \
53
+ doc/deprecations.7 \
54
+ doc/dev-forget-channel.7 \
55
+ doc/dev-splice.7 \
56
+ doc/disableinvoicerequest.7 \
57
+ doc/disableoffer.7 \
58
+ doc/disconnect.7 \
59
+ doc/emergencyrecover.7 \
60
+ doc/enableoffer.7 \
61
+ doc/exposesecret.7 \
62
+ doc/feerates.7 \
63
+ doc/fetchinvoice.7 \
64
+ doc/fundchannel_cancel.7 \
65
+ doc/fundchannel_complete.7 \
66
+ doc/fundchannel.7 \
67
+ doc/fundchannel_start.7 \
68
+ doc/funderupdate.7 \
69
+ doc/fundpsbt.7 \
70
+ doc/getemergencyrecoverdata.7 \
71
+ doc/getinfo.7 \
72
+ doc/getlog.7 \
73
+ doc/getroute.7 \
74
+ doc/getroutes.7 \
75
+ doc/help.7 \
76
+ doc/injectonionmessage.7 \
77
+ doc/injectpaymentonion.7 \
78
+ doc/invoice.7 \
79
+ doc/invoicerequest.7 \
80
+ doc/keysend.7 \
81
+ doc/listaddresses.7 \
82
+ doc/listchannels.7 \
83
+ doc/listclosedchannels.7 \
84
+ doc/listconfigs.7 \
85
+ doc/listdatastore.7 \
86
+ doc/listforwards.7 \
87
+ doc/listfunds.7 \
88
+ doc/listhtlcs.7 \
89
+ doc/listinvoicerequests.7 \
90
+ doc/listinvoices.7 \
91
+ doc/listnodes.7 \
92
+ doc/listoffers.7 \
93
+ doc/listpays.7 \
94
+ doc/listpeerchannels.7 \
95
+ doc/listpeers.7 \
96
+ doc/listsendpays.7 \
97
+ doc/listtransactions.7 \
98
+ doc/makesecret.7 \
99
+ doc/multifundchannel.7 \
100
+ doc/multiwithdraw.7 \
101
+ doc/newaddr.7 \
102
+ doc/notifications.7 \
103
+ doc/offer.7 \
104
+ doc/openchannel_abort.7 \
105
+ doc/openchannel_bump.7 \
106
+ doc/openchannel_init.7 \
107
+ doc/openchannel_signed.7 \
108
+ doc/openchannel_update.7 \
109
+ doc/parsefeerate.7 \
110
+ doc/pay.7 \
111
+ doc/ping.7 \
112
+ doc/plugin.7 \
113
+ doc/preapproveinvoice.7 \
114
+ doc/preapprovekeysend.7 \
115
+ doc/reckless.7 \
116
+ doc/recoverchannel.7 \
117
+ doc/recover.7 \
118
+ doc/renepay.7 \
119
+ doc/renepaystatus.7 \
120
+ doc/reserveinputs.7 \
121
+ doc/sendcustommsg.7 \
122
+ doc/sendinvoice.7 \
123
+ doc/sendonion.7 \
124
+ doc/sendpay.7 \
125
+ doc/sendpsbt.7 \
126
+ doc/setchannel.7 \
127
+ doc/setconfig.7 \
128
+ doc/setpsbtversion.7 \
129
+ doc/showrunes.7 \
130
+ doc/signinvoice.7 \
131
+ doc/signmessage.7 \
132
+ doc/signpsbt.7 \
133
+ doc/splice_init.7 \
134
+ doc/splice_signed.7 \
135
+ doc/splice_update.7 \
136
+ doc/staticbackup.7 \
137
+ doc/stop.7 \
138
+ doc/txdiscard.7 \
139
+ doc/txprepare.7 \
140
+ doc/txsend.7 \
141
+ doc/unreserveinputs.7 \
142
+ doc/upgradewallet.7 \
143
+ doc/utxopsbt.7 \
144
+ doc/waitanyinvoice.7 \
145
+ doc/waitblockheight.7 \
146
+ doc/waitinvoice.7 \
147
+ doc/wait.7 \
148
+ doc/waitsendpay.7 \
149
+ doc/withdraw.7 \
150
+ doc/xpay.7
148
151
149
152
ifeq ($(HAVE_SQLITE3 ) ,1)
150
- GENERATE_MARKDOWN += doc/lightning-listsqlschemas.7 \
151
- doc/lightning-sql.7
153
+ MARKDOWNPAGES += doc/listsqlschemas.7 doc/sql.7
152
154
endif
153
155
154
- MANPAGES := $(GENERATE_MARKDOWN ) \
155
- doc/lightning-cli.1 \
156
+ PREFIXED_MANPAGES := $(MARKDOWNPAGES:doc/%.7=doc/lightning-%.7 )
157
+ NON_PREFIXED_MANPAGES := doc/lightning-cli.1 \
156
158
doc/lightningd.8 \
157
159
doc/lightningd-config.5 \
158
160
doc/lightningd-rpc.7 \
159
- doc/lightning-hsmtool.8 \
160
- doc/reckless.7
161
+ doc/lightning-hsmtool.8
161
162
162
- MARKDOWN_WITH_SCHEMA := $(GENERATE_MARKDOWN:=.md )
163
+ MANPAGES := $(PREFIXED_MANPAGES ) $( NON_PREFIXED_MANPAGES )
163
164
164
- # - Read the json template from schemas/lightning-sql-template.json
165
+ MARKDOWNPAGES_WITH_EXT := $(MARKDOWNPAGES:=.md )
166
+ NON_PREFIXED_MARKDOWNPAGES_WITH_EXT := $(NON_PREFIXED_MANPAGES:=.md )
167
+ OLD_MARKDOWNPAGES_WITH_EXT := $(PREFIXED_MANPAGES:=.md )
168
+
169
+
170
+ # - Read the json template from schemas/sql-template.json
165
171
# - Generate the tables schema via plugins/sql
166
- # - Merge both and generate final schemas/lightning- sql.json
167
- doc/schemas/lightning- sql.json : doc/schemas/lightning- sql-template.json plugins/sql
172
+ # - Merge both and generate final schemas/sql.json
173
+ doc/schemas/sql.json : doc/schemas/sql-template.json plugins/sql
168
174
@plugins/sql --print-docs | jq --arg sqldata " $$ (awk '{printf " %s\n " , $$ 0}')" ' .tables += [$$sqldata]' $< > " $@ .tmp" && mv " $@ .tmp" " $@ " ;
169
175
170
176
doc-all : $(MANPAGES ) doc/index.rst
171
177
172
- SCHEMAS := $(wildcard doc/schemas/lightning- * .json) $(wildcard doc/schemas/notification/* .json)
178
+ SCHEMAS := $(wildcard doc/schemas/* .json) $(wildcard doc/schemas/notification/* .json)
173
179
174
- # Don't try to build lightning- sql.json tables with plugins/sql if we don't have sqlite3
180
+ # Don't try to build sql.json tables with plugins/sql if we don't have sqlite3
175
181
ifeq ($(HAVE_SQLITE3 ) ,0)
176
- SCHEMAS := $(filter-out doc/schemas/lightning- sql.json, $(SCHEMAS ) )
182
+ SCHEMAS := $(filter-out doc/schemas/sql.json, $(SCHEMAS ) )
177
183
endif
178
184
179
185
check-fmt-schemas : $(SCHEMAS:%=check-fmt-schema/% )
@@ -191,7 +197,7 @@ check-doc: check-config-docs check-manpages check-fmt-schemas
191
197
LBRACKET =(
192
198
RBRACKET =)
193
199
194
- $(MARKDOWN_WITH_SCHEMA ) : doc/lightning- % .7.md: doc/schemas/lightning- % .json tools/fromschema.py
200
+ $(MARKDOWNPAGES_WITH_EXT ) : doc/% .7.md: doc/schemas/% .json tools/fromschema.py
195
201
@tools/fromschema.py --markdownfile=$@ $< > $@ .tmp && mv $@ .tmp $@
196
202
197
203
# If we need to build lowdown, make tools/md2man.sh depend on it.
@@ -217,8 +223,10 @@ doc/.doc_version: version_gen.h
217
223
echo $$ DOC_VERSION > $@ .new
218
224
@if cmp $@ .new $@ > /dev/null 2>&1 ; then rm -f $@ .new; else mv $@ .new $@ ; $(ECHO ) Documentation version updated to ` cat doc/.doc_version` ; fi
219
225
220
- $(MANPAGES ) : doc/% : doc/% .md tools/md2man.sh doc/.doc_version
221
- @VERSION=` cat doc/.doc_version` tools/md2man.sh $(LOWDOWN ) $< > $@
226
+ $(PREFIXED_MANPAGES ) : doc/lightning-% : doc/% .md tools/md2man.sh doc/.doc_version
227
+ @VERSION=` cat doc/.doc_version` tools/md2man.sh $(LOWDOWN ) $<
228
+ $(NON_PREFIXED_MANPAGES ) : doc/% : doc/% .md tools/md2man.sh doc/.doc_version
229
+ @VERSION=` cat doc/.doc_version` tools/md2man.sh $(LOWDOWN ) $<
222
230
223
231
doc/protocol-% .svg : test/test_protocol
224
232
test/test_protocol --svg < test/commits/$* .script > $@
@@ -259,18 +267,21 @@ check-manpages: all-programs check-config-docs default-targets
259
267
260
268
# Makes sure that fields mentioned in schema are in man page, and vice versa.
261
269
check-config-docs :
262
- @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
263
- @for c in ` grep -v ' \[plugin ' doc/lightningd-config.5.md | sed -n ' s/^ \*\*\([^*]*\)\*\*.*/\1/p' | grep -v ' ^\(help\|version\|mainnet\|testnet\|testnet4\|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
270
+ @for c in ` sed -n ' s/^ "\(.*\)": {/\1/p' doc/schemas/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
271
+ @for c in ` grep -v ' \[plugin ' doc/lightningd-config.5.md | sed -n ' s/^ \*\*\([^*]*\)\*\*.*/\1/p' | grep -v ' ^\(help\|version\|mainnet\|testnet\|testnet4\|signet\|plugin\|important-plugin\|plugin-dir\|clear-plugins\)$$' ` ; do if ! grep -q ' "' " $$ c" ' "' doc/schemas/listconfigs.json; then echo " $$ c documented but not in schema!" ; exit 1; fi ; done
264
272
265
273
doc-clean :
266
- $(RM ) $(MANPAGES ) $(MARKDOWN_WITH_SCHEMA ) doc/.doc_version
274
+ $(RM ) $(MANPAGES ) $(MARKDOWNPAGES_WITH_EXT ) $( OLD_MARKDOWNPAGES_WITH_EXT ) doc/.doc_version
267
275
$(RM ) doc/deployable-lightning.{aux,bbl,blg,dvi,log,out,tex}
268
276
269
- doc/index.rst : $(MANPAGES:=.md ) Makefile
277
+ doc/index.rst : $(MARKDOWNPAGES_WITH_EXT ) $( NON_PREFIXED_MARKDOWNPAGES_WITH_EXT ) Makefile
270
278
@$(call VERBOSE, "genidx $@ ", \
271
- for m in $( MANPAGES) ; do basename $$ m; done | \
279
+ for m in $( MARKDOWNPAGES_WITH_EXT) $( NON_PREFIXED_MARKDOWNPAGES_WITH_EXT) ; do \
280
+ base=$$(basename "$$m") ; \
281
+ echo " $$ base" | \
282
+ sed -E ' s/^(.*)\.([0-9]+)\.md$$/\1 <\1.\2.md>/; t; s/^(.*)\.md$$/\1 <\1.md>/' ; \
283
+ done | \
272
284
LC_ALL=C sort | \
273
- sed " s/\(.*\)\.\(.*\)/\1 <\1.\2.md>/" | \
274
285
$(PYTHON ) devtools/blockreplace.py doc/index.rst manpages --language=rst --indent " " \
275
286
)
276
287
0 commit comments