Skip to content

Commit

Permalink
doc: Update scripts
Browse files Browse the repository at this point in the history
- Update `make doc-all` script
- Update `fromschema.py` script to update `.md` files
  • Loading branch information
ShahanaFarooqui committed Jan 17, 2024
1 parent 8953d5a commit 736ac59
Show file tree
Hide file tree
Showing 2 changed files with 282 additions and 135 deletions.
87 changes: 45 additions & 42 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
doc-wrongdir:
$(MAKE) -C .. doc-all

MANPAGES := doc/lightning-cli.1 \
doc/lightningd.8 \
doc/lightningd-config.5 \
doc/lightningd-rpc.7 \
doc/lightning-addgossip.7 \
GENERATE_MARKDOWN := doc/lightning-addgossip.7 \
doc/lightning-addpsbtoutput.7 \
doc/lightning-autoclean-once.7 \
doc/lightning-autoclean-status.7 \
doc/lightning-batching.7 \
Expand All @@ -23,20 +20,20 @@ MANPAGES := doc/lightning-cli.1 \
doc/lightning-checkmessage.7 \
doc/lightning-checkrune.7 \
doc/lightning-close.7 \
doc/lightning-connect.7 \
doc/lightning-commando.7 \
doc/lightning-commando-blacklist.7 \
doc/lightning-commando.7 \
doc/lightning-commando-listrunes.7 \
doc/lightning-commando-rune.7 \
doc/lightning-createonion.7 \
doc/lightning-connect.7 \
doc/lightning-createinvoice.7 \
doc/lightning-createonion.7 \
doc/lightning-createrune.7 \
doc/lightning-datastore.7 \
doc/lightning-datastoreusage.7 \
doc/lightning-decodepay.7 \
doc/lightning-decode.7 \
doc/lightning-decodepay.7 \
doc/lightning-deldatastore.7 \
doc/lightning-delexpiredinvoice.7 \
doc/lightning-delexpiredinvoice.7 \
doc/lightning-delforward.7 \
doc/lightning-delinvoice.7 \
doc/lightning-delpay.7 \
Expand All @@ -46,32 +43,35 @@ MANPAGES := doc/lightning-cli.1 \
doc/lightning-emergencyrecover.7 \
doc/lightning-feerates.7 \
doc/lightning-fetchinvoice.7 \
doc/lightning-fundchannel_cancel.7 \
doc/lightning-fundchannel_complete.7 \
doc/lightning-fundchannel.7 \
doc/lightning-fundchannel_start.7 \
doc/lightning-fundchannel_complete.7 \
doc/lightning-fundchannel_cancel.7 \
doc/lightning-funderupdate.7 \
doc/lightning-addpsbtoutput.7 \
doc/lightning-fundpsbt.7 \
doc/lightning-getinfo.7 \
doc/lightning-getlog.7 \
doc/lightning-getroute.7 \
doc/lightning-hsmtool.8 \
doc/lightning-help.7 \
doc/lightning-invoice.7 \
doc/lightning-invoicerequest.7 \
doc/lightning-keysend.7 \
doc/lightning-listchannels.7 \
doc/lightning-listclosedchannels.7 \
doc/lightning-listconfigs.7 \
doc/lightning-listdatastore.7 \
doc/lightning-listforwards.7 \
doc/lightning-listfunds.7 \
doc/lightning-listhtlcs.7 \
doc/lightning-listinvoices.7 \
doc/lightning-listinvoicerequests.7 \
doc/lightning-listinvoices.7 \
doc/lightning-listnodes.7 \
doc/lightning-listoffers.7 \
doc/lightning-listpays.7 \
doc/lightning-listpeers.7 \
doc/lightning-listpeerchannels.7 \
doc/lightning-showrunes.7 \
doc/lightning-listpeers.7 \
doc/lightning-listsendpays.7 \
doc/lightning-listtransactions.7 \
doc/lightning-makesecret.7 \
doc/lightning-multifundchannel.7 \
doc/lightning-multiwithdraw.7 \
Expand All @@ -83,61 +83,67 @@ MANPAGES := doc/lightning-cli.1 \
doc/lightning-openchannel_init.7 \
doc/lightning-openchannel_signed.7 \
doc/lightning-openchannel_update.7 \
doc/lightning-pay.7 \
doc/lightning-parsefeerate.7 \
doc/lightning-pay.7 \
doc/lightning-ping.7 \
doc/lightning-plugin.7 \
doc/lightning-preapproveinvoice.7 \
doc/lightning-preapprovekeysend.7 \
doc/lightning-recover.7 \
doc/lightning-recoverchannel.7 \
doc/lightning-recover.7 \
doc/lightning-renepay.7 \
doc/lightning-renepaystatus.7 \
doc/lightning-reserveinputs.7 \
doc/lightning-sendcustommsg.7 \
doc/lightning-sendinvoice.7 \
doc/lightning-sendonion.7 \
doc/lightning-sendonionmessage.7 \
doc/lightning-sendpay.7 \
doc/lightning-sendpsbt.7 \
doc/lightning-setchannel.7 \
doc/lightning-setconfig.7 \
doc/lightning-setpsbtversion.7 \
doc/lightning-sendcustommsg.7 \
doc/lightning-showrunes.7 \
doc/lightning-signinvoice.7 \
doc/lightning-signmessage.7 \
doc/lightning-signpsbt.7 \
doc/lightning-splice_init.7 \
doc/lightning-splice_update.7 \
doc/lightning-splice_signed.7 \
doc/lightning-staticbackup.7 \
doc/lightning-txprepare.7 \
doc/lightning-splice_update.7 \
doc/lightning-staticbackup.7 \
doc/lightning-stop.7 \
doc/lightning-txdiscard.7 \
doc/lightning-txprepare.7 \
doc/lightning-txsend.7 \
doc/lightning-unreserveinputs.7 \
doc/lightning-upgradewallet.7 \
doc/lightning-utxopsbt.7 \
doc/lightning-wait.7 \
doc/lightning-waitinvoice.7 \
doc/lightning-waitanyinvoice.7 \
doc/lightning-waitblockheight.7 \
doc/lightning-waitinvoice.7 \
doc/lightning-wait.7 \
doc/lightning-waitsendpay.7 \
doc/lightning-withdraw.7 \
doc/lightning-ping.7 \
doc/lightning-stop.7 \
doc/lightning-signpsbt.7 \
doc/lightning-sendpsbt.7 \
doc/lightning-getinfo.7 \
doc/lightning-listtransactions.7 \
doc/lightning-listnodes.7 \
doc/lightning-listconfigs.7 \
doc/lightning-help.7 \
doc/lightning-getlog.7 \
doc/lightning-withdraw.7

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

ifeq ($(HAVE_SQLITE3),1)
GENERATE_MARKDOWN += doc/lightning-listsqlschemas.7
MANPAGES += doc/lightning-listsqlschemas.7 \
doc/lightning-sql.7
endif

MARKDOWN_WITH_SCHEMA := $(GENERATE_MARKDOWN:=.md)

doc-all: $(MANPAGES) doc/index.rst

SCHEMAS := $(wildcard doc/schemas/*.json)
SCHEMAS := $(wildcard doc/schemas/lightning-*.json)
check-fmt-schemas: $(SCHEMAS:%=check-fmt-schema/%)
fmt-schemas: $(SCHEMAS:%=fmt-schema/%)

Expand All @@ -149,15 +155,12 @@ fmt-schema/%: %

check-doc: check-config-docs check-manpages check-fmt-schemas

# Some manpages use a schema, so need that added.
MARKDOWN_WITH_SCHEMA := $(shell grep -l GENERATE-FROM-SCHEMA $(MANPAGES:=.md))

# These are hard to use in $(call) functions.
LBRACKET=(
RBRACKET=)

$(MARKDOWN_WITH_SCHEMA): doc/lightning-%.7.md: doc/schemas/%.schema.json tools/fromschema.py
@if $(call SHA256STAMP_CHANGED); then $(call VERBOSE, "fromschema $@", tools/fromschema.py --markdownfile=$@ doc/schemas/$*.schema.json > $@.tmp && grep -v SHA256STAMP: $@.tmp > $@ && rm -f $@.tmp && $(call SHA256STAMP,[comment]: # $(LBRACKET),$(RBRACKET))); else touch $@; fi
$(MARKDOWN_WITH_SCHEMA): doc/lightning-%.7.md: doc/schemas/lightning-%.json tools/fromschema.py
@if $(call SHA256STAMP_CHANGED); then $(call VERBOSE, "fromschema $@", tools/fromschema.py --markdownfile=$@ doc/schemas/lightning-$*.json > $@.tmp && grep -v SHA256STAMP: $@.tmp > $@ && rm -f $@.tmp && $(call SHA256STAMP,[comment]: # $(LBRACKET),$(RBRACKET))); else touch $@; fi

# 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
Expand Down
Loading

0 comments on commit 736ac59

Please sign in to comment.