bods-dev-handbook

BODS Style Guide

This style guide is not yet implemented across the BODS schema and documentation (as of October 2023 BODS 0.3). It can be used to guide editing and content writing.

Common Conventions

Readability

We try to write clear, concise documentation, using plain English where possible.

These tools can help with this:

Spelling

Use English spelling:

Word choice

Grammar

Acronyms

Don’t assume everyone is aware of common acronyms. The first time an acronym is used in a property description (schema) or on a page (docs) the full term should be used, followed the by the acronym in parentheses (e.g. “whether the person described by this statement has the status of politically exposed person (PEP).”)

Make all letters in acronyms uppercase (PEP not Pep).

These acronyms are commonly used in the documentation:

Normative Statements

Normative statements MUST:

Non-normative statements:

Schema style guide

Duplication

Avoid multiple representations of the same fact where possible. A user should have a single way of answering a given question. Having multiple representations of the same fact also introduces the possibility of inconsistent values.

Names and titles

‘Names’ refer to JSON keys, codelists and codelist entries used in the schema.

Names:

‘Titles’ are the way that a name is referred to in the documentation. (e.g ‘Use the Statement Fragment Pointer to describe…’)

Titles:

Field and code descriptions

The first sentence of a description should:

Subsequent sentences may provide information or guidance to assist publishers to use the field effectively or users to interpret the field effectively. Guidance sentences should be grounded in clear user needs and implementation experience of common pitfalls or errors.

Descriptions with a link to a codelist should be phrased as - ‘<description>, using the <name> codelist.’

Descriptions should also:

Descriptions should not:

Assuming the rest of the guidance is followed, it is recommended to start the description with:

Documentation style guide

Headings and subheadings

Use sentence case for headings and subheadings.

In RST:

Bulleted lists

When using bulleted lists you should:

Referring to JSON objects

When referring to objects in the data model, capitalise them. For example, when writing about interests:

Restructured text files

restructuredText (.rst) files are used to document BODS.

Embeddeding schema objects

We use various plugins to embed schema and codelist elements in dynamic ways.

JSONValue (in the docs conf.py) to pull out the value of one key in the JSON, e.g.:

.. json-value:: ../_build_schema/components.json
   :pointer: /definitions/Address/description

Screenshot: Address description from the schema rendered as a paragraph

JSONSchema (a Sphinx extension) to make a table of multiple key-value pairs from the JSON, e.g.:

.. jsonschema:: ../_build_schema/components.json
   :pointer: /definitions/Address
   :externallinks: {"type":{"url":"#addresstype","text":"Codelists"}}

Screenshot: Address attributes and properties from the schema rendered as a table

CSVTable (a builtin Sphinx directive) to make a table from codelist csv files, e.g.:

.. csv-table::
   :header-rows: 1
   :class: codelist-table
   :file: ../_build_schema/codelists/addressType.csv

Screenshot: addressTypes codelist rendered as a table

Reference Page

The reference page should be ordered:

These sections should be ordered alphabetically.

Use titles not names for the subheadings of the objects and codelists sections.

The Reference page in the schema makes extensive use of the jsonschema Sphinx directive which ODSC maintains.

These directives are used frequently:

Anchor links .. _link-anchor allow a section to be linked elsewhere in the docs <link-anchor>. Link anchors must be maintained to prevent broken links. Broken anchor links may generate this warning when building the docs WARNING: 'any' reference target not found: link-anchor

Diagrams

See diagram creation for advice on how to create diagrams.

The BOVS template should be used as the reference point for icons.

Technical diagrams often require representations of statements. For this:

Font choice:

Text alignment: