The Raspberry Pi Documentation website is built from Asciidoc source using:
- Asciidoctor
- Jekyll
- jekyll-asciidoc
- Python
The website automatically deploys to www.raspberrypi.com/documentation using GitHub Actions when new commits appear in the master branch.
To contribute or update documentation:
-
Create a fork of this repository on your GitHub account.
-
Make changes in your fork. Start from the default
developbranch. -
Read our style guide to ensure that your changes are consistent with the rest of our documentation. Since Raspberry Pi is a British company, be sure to include all of your extra
us and transfigure thosezs (pronounced 'zeds') intoss! -
Open a pull request against this repository.
-
The maintainers will assess and copy-edit the PR. This can take anywhere from a few minutes to a few days, depending on the size of your PR, the time of year, and the availability of the maintainers.
-
After making any requested improvements to your PR, the maintainers will accept the PR and merge your changes into
develop. -
When the maintainers next release the documentation by merging
developintomaster, your changes will go public on the production documentation site.
Alternatively, open an issue to discuss proposed changes.
To build the Raspberry Pi documentation locally, you'll need Ruby, Python, and the Ninja build system.
Use apt to install the dependencies:
$ sudo apt install -y ruby ruby-dev python3 python3-pip make ninja-buildThen, append the following lines to your ~/.bashrc file (or equivalent shell configuration):
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
export PATH="$PATH:$GEM_HOME/bin"Close and re-launch your terminal window to use the new dependencies and configuration.
If you don't already have it, we recommend installing the Homebrew package manager:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"Next, use Homebrew to install Ruby:
$ brew install rubyAfter installing Ruby, follow the instructions provided by Homebrew to make your new Ruby version easily accessible from the command line.
Then, use Homebrew to install the most recent version of Python:
$ brew install pythonThen, install the Ninja build system:
$ brew install ninjaUse the gem package manager to install the Ruby bundler, which this repository uses to manage Ruby dependencies:
$ gem install bundlerAnd then install the required Ruby gems:
$ bundle installConfigure a Python virtual environment for this project:
$ python -m venv .envActivate the virtual environment:
$ source .env/bin/activateTip
When you're using a virtual environment, you should see a (.env) prefix at the start of your terminal prompt. At any time, run the deactivate command to exit the virtual environment.
In the virtual environment, install the required Python modules:
$ pip3 install -r requirements.txtImportant
If you configured a Python virtual environment as recommended in the previous step, always run source .env/bin/activate before building. You must activate the virtual environment to access to all of the Python dependencies installed in that virtual environment.
To build the documentation and start a local server to preview the built site, run the following command:
$ make serve_htmlYou can access the virtual server at http://127.0.0.1:4000/documentation/.
Tip
To delete and rebuild the documentation site, run make clean, then re-run the build command. You'll need to do this every time you add or remove an Asciidoc, image, or video file.
The Raspberry Pi documentation site includes a section of generated Asciidoc that we build from the Doxygen Pico SDK documentation.
We use the tooling in this repository and doxygentoasciidoc to generate that documentation section. By default, local documentation builds don't include this section because it takes a bit longer to build (tens of seconds) than the rest of the site.
Building the Pico C SDK Doxygen documentation requires the following additional package dependencies:
$ sudo apt install -y cmake gcc-arm-none-eabi doxygen graphvizThen, initialise the Git submodules used in the Pico C SDK section build:
$ git submodule update --initRun the following command to build the Pico C SDK section Asciidoc files from the Doxygen source:
$ make build_doxygen_adocThe next time you build the documentation site, you'll see the Pico C SDK section in your local preview.
Tip
To delete and rebuild the generated files, run make clean_doxygen_xml, then re-run the build command.