# Memoforest Tool Manual

## JSON format

- The top level is an object
- `type` is `"annotator-qa-export"`
- `version` is `3`
- The data goes in the `projects` array

## `project`

- Each `project` is an object
### `project` fields

- `title`: string
- `nodes`: array of `node`

## `node`

- Each `node` is an object
- It has `id`, `topic`, `parentId` and `sections`
- A top-level `node` has `parentId: null`
- A child `node` puts the `id` of its parent `node` in `parentId`
- The order of `node`s with the same parent is the order of the `nodes` array

### `node` fields

- `id`: string
- `topic`: string
- `parentId`: string or `null`
- `sections`: array of `section`

## `section`

- Each `section` is an object
- It has `id`, `title` and `content`

### `section` fields

- `id`: string
- `title`: string
- `content`: string

## Text syntax

- `content` is Markdown
- Inline math is `$...$`
- Display math is `\[ ... \]`
- `content` is a JSON string, so write notation that starts with a backslash as `\\`
- Examples: `\\alpha`, `\\frac{a}{b}`, `\\sqrt{x}`, `\\text{...}`, `\\to`, `\\[ ... \\]`, `\\( ... \\)`

## Minimal example

```json
{
  "type": "annotator-qa-export",
  "version": 3,
  "projects": [
    {
      "title": "Sample",
      "nodes": [
        {
          "id": "n-definition",
          "topic": "Definition",
          "parentId": null,
          "sections": [
            {
              "id": "s-definition-1",
              "title": "Overview",
              "content": "Write the text here."
            }
          ]
        }
      ]
    }
  ]
}
```

## Recommended structure

- Only a node and its children fit on one screen, so keep the depth to two levels: "root node → child node"
- When covering several viewpoints or topics, placing each as its own root node (`parentId: null`) makes them easier to read

## Example with child nodes

```json
{
  "type": "annotator-qa-export",
  "version": 3,
  "projects": [
    {
      "title": "Tree Sample",
      "nodes": [
        {
          "id": "n-topic-a",
          "topic": "Topic A",
          "parentId": null,
          "sections": [
            {
              "id": "n-topic-a-s1",
              "title": "",
              "content": "An overview of topic A."
            }
          ]
        },
        {
          "id": "n-topic-a-detail",
          "topic": "Details",
          "parentId": "n-topic-a",
          "sections": [
            {
              "id": "n-topic-a-detail-s1",
              "title": "",
              "content": "This node is a child of `n-topic-a`."
            }
          ]
        },
        {
          "id": "n-topic-b",
          "topic": "Topic B",
          "parentId": null,
          "sections": [
            {
              "id": "n-topic-b-s1",
              "title": "",
              "content": "An overview of topic B."
            }
          ]
        }
      ]
    }
  ]
}
```
