This repo contains the source code used to generate the API docs websites for LND, Loop, Pool, Faraday, and Taproot Assets Protocol: https://lightning.engineering/api-docs/
The websites are automatically generated from the protobuf definition files
(*.proto
) and Swagger/OpenAPI files (*.swagger.json
) found in the Github
repositories of each application. These files are sourced from the following
repos:
There is a multi-stage pipeline to consume the protobuf & Swagger files and convert them into an HTML static website. The process is as follows:
+ ./generate.sh
|
| - downloads the master branch of each repo
| - uses protoc to convert *.proto to generated.json
| - compiles `cmd/mdgen/main.go` into ./mdgen console app
|
+ ./mdgen
|
| - outputs markdown files into site/docs/
|
+ yarn build
|
| - builds the Docusaurus site
| - converts the markdown pages into HTML
|
+ Output Static Website
This process is run every day at midnight UTC by a cron job. After the build, the static sites are deployed.
Follow these steps to run the pipeline locally. You can modify the source
code for the mdgen
tool and the markdown templates (in templates/
), to
alter the generated static pages.
System Requirements
$ git clone https://github.com/lightninglabs/lightning-api-ng.git
$ cd lightning-api-ng
$ cd site/
$ yarn
$ ./generate.sh
$ ./watch.sh
$ cd site/
$ yarn start
$ ./generate.sh
$ cd site/
$ yarn build