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.
You're going to need:
- Linux or OS X — Windows may work, but is unsupported.
- Ruby, version 2.2.5 or newer
- Bundler — If Ruby is already installed, but the
bundle
command doesn't work, just rungem install bundler
in a terminal.
git clone https://github.com/lightninglabs/lightning-dev-site
Install Jekyll:
$ gem install jekyll bundler
Run the site and watch for changes:
$ bundle exec jekyll serve
- If running remotely add:
--host=0.0.0.0
# 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 DOCKER-README.md -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/docker/README.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
bundle exec 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.