Writing documentation

A great way to contribute without writing code is to help writing documentation. Please reach out before contributing as the software is still in an alpha state and portions may not be worth documenting as it changes too frequently.

Philosophy

The documentation is split into three sections:

  1. Quickstart: a crash course where a user should be able to go from nothing to doing the most basic, common tasks. It is not comprehensive, but a highly focused tutorial style “taster” of what’s available. It should be kept very short, aiming to acquaint new users within an hour.

  2. Guides: a guidebook style, topic-driven series of articles discussing things of interest, or tutorials that cover common workflows. This should contain lots of images.

  3. Reference: a comprehensive index of the entire interface and all available features.

Documentation should not be a guide to IFC. Users should not have to know what IFC is.

Official documentation should be polished and maintained. Less documentation of a higher quality that is kept updated with every release is preferred to more documentation with stubs, incomplete or inaccurate information.

Syntax

All documentation is written in ReStructured Text and is available in the Bonsai docs directory. You can press the edit button on the top right on any documentation page to quickly edit their content.

Images

The following colours and annotation styles should be used for annotating images. All stroke widths are 3px with a corner radius of 3px. Horizontal underlines are 5px with a corner radius of 2px. The dark green is 39b54a and the light green is d9e021.

../../_images/documentation-style.png

Special keywords such as Technical Terminology that the user should be aware of should be bolded, titlecased, and used consistently. You may use italics to emphasize words or phrases. Inline code must be quoted and longer code snippets may use code blocks.

cd /path/to/bonsai
ls

Be sure to specify the language to enable syntax highlighting.

print("Hello, world!")

A button may be used to point users to a critical sample file or download.

You can use bulleted lists:

  • Like.

  • This.

Or ordered lists:

  1. Like.

  2. This.

Note

Instead of writing “Note that XYZ …” you should use notes sparingly to highlight “gotchas”.

Tip

Tips may be used to add a useful but optional suggestion.

Warning

Warnings may be used to highlight common mistakes.

See also

See also blocks should be used to reference further reading links.

Tables can be very annoying to format. You can use a CSV table instead.

Foo

Bar

Baz

ABC

01

02

DEF

03

04

Building documentation

If you want to build the documentation locally, the documentation system uses Sphinx. First, install the theme and theme dependencies:

pip install furo
pip install sphinx-autoapi
pip install sphinx-copybutton

Now you can generate the documentation:

cd /path/to/ifcopenshell/src/bonsai/docs/
make html
cd _build/html
python -m http.server

You will now have a local webserver running hosting the documentation.