Developer guides and resources for the Lightning Network Daemon
This repository contains functionality for programmatically pulling guides from the lnd repo, using a Python script and Jinja2 templates to output markdown files, which are the corresponding pages in the fully rendered Jekyll static site.
Pay special attention to these files:
templates/base.md
: The Jinja2 template fed into the Python script, holding the Jeykll header to be prepended to the guide content pulled from Github. Thetemplates
dir also holds the templates for special cases where for example a dev site-specific footer needs to be appendedupdate_and_render.sh
: Update local guides to the latest version availablerender.py
: The Python script that uses local guides and Jinja template to strip out redundant titles, add page headers/footers, and output Jekyll markdowndeploy.sh
: Build static site from Jekyll markdown and deploy to Google Cloud Platform
The rest of the files in this repo are the standard Jekyll site files.
Install Jekyll:
$ gem install jekyll bundler
Run the site and watch for changes:
$ bundle exec jekyll serve
# Install Jinja for python templating
pip install Jinja2
curl -o INSTALL.md -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/docs/INSTALL.md
curl -o python.md -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/docs/grpc/python.md
curl -o javascript.md -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/docs/grpc/javascript.md
Let's run the script to render the guides:
python render.py
Now that you're all set up, you can just run ./update_and_render.sh
to
automatically pull the latest markdown files and render the local Jekyll docs.
The Lightning API is deployed with Google Cloud Platform. Visit this blog post for more information.
- Install Google Cloud SDK and authenticate into it:
brew cask install google-cloud-sdk
gcloud auth login
- Build
jekyll build
- Push to Google Cloud Bucket
# -m use faster multithreaded uploads
# -d delete remote files that aren't in the source
# -r recurse into source subdirectories
gsutil -m rsync -d -r ./_site gs://dev.lightning.community
In the future, you can just run ./deploy.sh
to deploy automatically.