Git Product home page Git Product logo

brightway-documentation's Introduction

Brightway Documentation (Sphinx/readthedocs.org)

Brightway License

contributions welcome Read the Docs

The primary documentation for the Brightway life-cycle assessment software package. Sphinx and readthedocs.org are used to build/host the documentation.

static documentation interactive documentation development playground
docs.brightway.dev learn.brightway.dev hub.brightway.dev

Repository Structure

Brightway modules are split up into different repositories (brightway-2-analyzer, brightway2-calc, etc.). These repositories are included as git submodules in this repository in order to e.g. enable Sphinx to build a combined changelog page.

Sphinx/readthedocs.org Structure

All content pages of the documentation are Markdown formatted for reasons of simplicity. The API documentation is build from source automatically by the readthedocs.org Sphinx extension AutoAPI.

Quickstart

Setup Repository

  1. Clone this repository:
git clone https://github.com/brightway-lca/brightway-documentation.git
  1. Initialize (=download) the submodules (brightway-2-analyzer, brightway2-calc, etc.):
git submodule update --init --recursive --remote --force
option description
init initializes (=downloads) submodules if not currently present
recursive goes through all submodules specified in the .gitmodules file
remote points to the latest commit on the branches specified in the .gitmodules file
force ensures that accidental edits in the submodules are always overwritten

Note that if the --remote flag is not set, the submodules will point to the latest commit on the default branches (main), not to the latest commit on the branches specified in the .gitmodules file. On the main branch of the brightway-documentation repo, all submodule branches specified in the .gitmodules should be main. This is to ensure the documentation is always up-to-date with the latest changes in the submodules.

To manually update the submodules, use the same command again. There is no need to push changes to the submodules to the remote, since they are updated by GitHub Actions.

Setup Python Environment

Set up a Python virtual environment that includes all packages required to build the documentation. A Conda environment file is provided for convenient setup. The file is located at ./environment.yml. Install the environment sphinx by running from the repository root directory:

conda env create -f 'environment.yml'

and activate the environment:

conda activate sphinx

You are now ready to build the documentation...

Building the Documentation

  1. You can build the documentation by triggering every build manually: To trigger the build, run sphinx-build from the repository root directory:
sphinx-build source _build/html -b singlehtml -a
option value description
sourcedir source N/A
outdir _build/html N/A
-b singlehtml create only a single html page
-a N/A always write all output files
-j auto speed up build by using multiple processes

You can now preview the documentation, built as a single html page at:

_build/html/homepage.html
  1. You can also build the documentation by automatically triggering a build after every change to the source files, providing a "live" preview of changes. To trigger the automated builds, run sphinx-autobuild from the repository root directory:
sphinx-autobuild source _build/html -a -j auto --open-browser
positional argument or option value description
sourcedir source N/A
outdir _build/html N/A
-a N/A always write all output files
-j auto speed up build by using multiple processes
--open-browser N/A automatically open browser

You can now preview the documentation at (the browser window will open automatically โœจ): http://127.0.0.1:8000/

Checking for Dead External Links

The documentation contains links to external websites. To check if these links are still valid, run the following command from the repository root directory:

sphinx-build -b linkcheck -D linkcheck_workers=20 source _build/linkcheck
positional argument or option value description
-b linkcheck linkcheck builder
-D `linkcheck_workers=20`` number of links to check in paralell
sourcedir source N/A
outdir _build/linkcheck _build/linkcheck/output.txt contains a list of all broken or redirected links

Internal links, if formatted according to the myst-parser cross-referencing specifications, are checked automatically during the regular build process.

Contributing

Please follow the extensive guide we have provided on the documentation website.

๐Ÿ“š References

Compare the sphinx:

  1. documentation
  2. getting started (from readthedocs)
  3. issues on GitHub

Compare the readthedocs.org:

  1. documentation
  2. tutorial
  3. issues on GitHub

brightway-documentation's People

Contributors

michaelweinold avatar tngtudor avatar dependabot[bot] avatar gitter-badger avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.