# JSON Boilerplate Text Schema
## Wants:
* Content:
* Headers
* Subheaders
* Options for subheader content text
* Ability to include/exclude content
* Ability to customise all headers and content
* Allow radiobuttons with multiple choice options
* Ability to auto-fill fields (e.g. lab name, person's name) from pre-set info
* Link via roles to people
* Highlight broken links?
* Highlighting of areas of text that must/should be customised
* Ability to save/load and version-track evolution of manual
* Displaying version information and update time on manual display
* Stand-alone product (downloadable in various formats, saved to e.g. GitHub)
* Reusing product as a new template
## Schema
**Required** properties in **bold**, optional properties in normal face. All objects are allowed arbitrary additional fields.
* root:
* **metadata**: {*: *} Key-value pairs giving metadata information.
* **contents**: _contentObject[]_ The content of the lab manual.
A contentObject is an object representing a heading, optionally including a description, text options, and other content objects.
* contentObject:
* **title**: _templateString|string_ The title of the _contentObject_.
* description: _templateString|string_ The description of the _contentObject_.
* options: _(templateString|string)[]_ A list of text options that can be selected to fill in a field.
* options-selected: Index of the preselected option. Should be set to -1 if none of the options are selected.
* contents: _contentObject[]_ A list of content objects belonging to this contentObject.
* resources: _string[]_ A list of links to external resources.
A templateString is an object with a string and additional metadata. It supports \# placeholders that contain options.
* templateString:
* **text**: _templateString|string_ Text of the option, with zero or more special placeholders of backslash followed by a number. These placeholders are to be replaced by other _templateStrings_, with the options for replacement listed in templateOptions.
* hint: _string_ A description of the text content displayed as a hint to the user.
* difficulty: _number_ The difficulty level of the text content.
* templateOptions: _(templateString|string)[][]_ A list of lists of one or more _strings_ or _templateString_ objects to replace the placeholders in the text. The first list is the options for the placeholder \1 in the text, the second list is the options for the placeholder \2 in the text, etc. The number of lists must match the highest-numbered \# placeholder. _templateOptions_ cannot be used with zero special placeholders in the text. The main difference between templateString.templateOptions and contentObject.options is that templateOptions modifies the text property of the templateString, while options do not.
* selected: _boolean_ If this is one of a series of templateOptions or options, this should be true if this is the option selected.
??? multiple selected values for templateString ??? "We process our data with R, Matlab, or Python" changing AND & OR
## Example
```json
{
metadata: {},
contents: {
[
{
title: "Preparing a study",
description: "When we are preparing a study there are various things we want to be aware of.",
contents: [
{
title: "Initiating a study",
description: "The first step in preparing a study is initialising it, where we get all the organisational stuff done.",
contents: [
{
title: "Consultation",
description: "Consultation between the team members.",
options: [
{
text: "The study design is always discussed among lab members and local colleagues.",
difficulty: 1
},
{
text: "The design is discussed with other experts on the field using expert consensus method, adversarial collaboration, presubmission inquiry, or registered report.",
difficulty: 2
}
]
},
{
title: "Preregistration",
description: "We all love preregistration",
options: [
"We don't do that sort of thing here.",
{
text: "We publically preregister every project before following \1 standards. At minimum we preregister using \2.",
difficulty: 1,
templateOptions: [
[
{
text: "OSF - \1",
hint: "The Open Science Framework offers a variety of preregistration options.",
difficulty: 1,
templateOptions: [
[
{
text: "Open-Ended Registration",
hint: "Use this one if you are registering a completed project with data or materials.",
difficulty: 0
},
{
text: "OSF Prereg",
hint: "This is our standard, comprehensive, and general purpose preregistration form."
}
]
]
},
{
text: "AsPredicted.org",
hint: "AsPredicted offers eight simple questions to support quick preregistration.",
difficulty: 0
}
],
[
"the lab website"
]
]
},
{
text: "We publically preregister every confirmatory as well as exploratory project before any data collection following standards, like OSF preregistration challenge.",
difficulty: 2
}
]
}
]
}
]
}
]
}
}
```