HTML landing page generator for LSST PDF documentation deployed from Git to LSST the Docs.
Lander works with Python 3.5 or above. You can install it from PyPI:
pip install lander
lander -h for command line help.
To create a landing page website, run
lander with the local PDF file's path:
lander --pdf <path>
The built PDF landing page site is available, by default, from the
View the site in a browser by running a Python web server:
cd _build && python -m http.server 8000 --bind 127.0.0.1
Get metadata from an lsstdoc document
--lsstdoc <tex path> argument, Lander will attempt to scrape metadata from the source of a
lsstdoc-class LaTeX file, including:
- document handle
See https://lsst-texmf.lsst.io for information about the
Get metadata from the Travis environment
If you're running on Travis CI, set the
--env=travis to get metadata from Travis's environment variables:
Lander tries to get as much metadata from the environment as possible (including from the Git repository and the LaTeX document itself), but sometimes this isn't possible.
In this case you can explicitly set metadata with these flags (see
lander -h for more information):
--docushare-url(prefer the multi-version form,
--authors should be a JSON-formatted array, even for a single author.
--authors "[\"First Author\", \"Second Author\"]"
Distributing extra files from the landing page
To include ancillary files with the main PDF document, provide their file paths with the
These extra files are listed in the Downloads section of the landing page.
The main PDF is always included first in this list.
Uploading to LSST the Docs
Lander works well with LSST the Docs. Lander can upload pages directly to LSST the Docs for you with these configurations:
--upload— provide this flag to indicate a build should be uploaded.
--ltd-product— Name of the product on LSST the Docs.
Note: these are advanced configurations and are typically added to a CI configuration automatically or by a Documentation Engineer. Reach out to #dm-docs on Slack for help.
You need both Python 3.5+ and node.js to develop Lander.
Initial set up
Clone and install dependencies (use a Python virtual environment of your choice):
git clone https://github.com/lsst-sqre/lander cd lander npm install -g gulp-cli npm install gulp assets pip install -e ".[dev]"
Run Python tests and linting
We use pytest for unit testing and style checks:
You can also run end-to-end trials of landing page builds:
These integration tests clone real LSST documents, compiles them with Docker, and builds landing pages to simulate continuous delivery workflows in production.
Look for sites in
Build a development site
The default gulp workflow creates website assets and generates a test website:
Only build assets
gulp assets --env=deploy
This is how assets are built on CI for releases of Lander.
Developing CSS/Sass with squared
To make it easier to write Sass in squared while developing landing pages in Lander, we recommend linking a clone of squared to Lander's
Assuming you're starting from the
lander/ root directory:
git clone https://github.com/lsst-sqre/squared ../squared npm link ../squared
- If you're working on a branch in squared, then update squared's version in
package.jsonto that branch. For example:
"squared": "lsst-sqre/squared#tickets/DM-10503". This allows Travis to install the development version of squared when testing Lander. Remember to make a release of squared before releasing a new version of Lander, see below.
scss/app.scssin the lander repo imports Sass partials from squared and other packages (including inuitcss).
- If squared was modified, create a squared release first.
package.jsonwith the released version of squared. Using tagged npm releases is preferred to GitHub branches to make builds of releases repeatable.
- Create a signed tag:
git tag -s 0.1.0 -m "v0.1.0". Use the PEP 440 schema.
- Push the tag:
git push --tags. This will automatically create a Lander release on PyPI.
- Merge the development branch as necessary.
This project is open sourced under the MIT license. See LICENSE for details.