---
# System prepended metadata

title: HWiki documentation

---

# HWiki documentation


## User stories

* Any user should be able to read and navigate through pages.
* An Editor should be able to add a new page.
* An Editor should be able to add elements from the page.
* An Editor should be able to remove elements from the page.
* An Editor should be able to modify the contents of an element.
* An Editor should be able to link from page to page by its title.
* An Editor should be able to reference agents by handle (with `@`).
* An Administrator should be able to grant Administrator rights to any user.
* An Administrator should be able to grant Editor rights to any user.

> An administrator has automatically all the capabilities of an Editor.

## Entry relationship diagram
```mermaid
graph TD
    subgraph Wiki zome
    subgraph pages
        Page1
        Page2
    end
    subgraph Section
        Section1
        Page1-.->Section1
        Section1-.->Page1
        Section2
        Page1-.->Section2
        Section2-.->Page1
    end
    subgraph anchors
        root_anchor-->anchor_pages
        anchor_pages-->Page1
        anchor_pages-->Page2        
    end
end
```

## GraphQl schema

```gql
type Section {
  id: ID!  // hash of section in holochain
  type: String!
  content: String! // Markdown content
  renderedContent: String! // HTML content
}

type Page {
  title: String!
  sections: [Section!]!
}

type Query {
  page(title: String!): Page!
  homePage: Page!
  allPages: [Page!]!
}

input SectionInput {
    type: String!
    content: String!
    renderedContent: String!
}

type Mutation {
  createPage(title: String!): Page!
  createPageWithSections(title: String!,sections: [SectionInput!]!): Page!
  addSectionToPage(title: String!, section: SectionInput!): Page!
  addOrderedSectionToPage(beforeSection:ID!, section: SectionInput!): Page!
  removeSection(id: ID!): Page!
  updateSection(id: ID!, section: SectionInput!): Section!
}

```
