Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 9f1ffbe

Browse files
authored
Add docusaurus
1 parent b2aa9f5 commit 9f1ffbe

File tree

23 files changed

+265
-114
lines changed

23 files changed

+265
-114
lines changed

.github/workflows/test-docs-build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test Docs Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
checks:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Test Build
21+
run: |
22+
corepack enable
23+
yarn install --no-immutable
24+
yarn build

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
11
book/
22
src/
3+
4+
# Dependencies
5+
node_modules
6+
7+
# Yarn
8+
yarn.lock
9+
.pnp.*
10+
.yarn/*
11+
!.yarn/patches
12+
!.yarn/plugins
13+
!.yarn/releases
14+
!.yarn/sdks
15+
!.yarn/versions
16+
17+
# Production
18+
/build
19+
20+
# Generated files
21+
.docusaurus
22+
.cache-loader
23+
package-lock.json
24+
25+
# Misc
26+
.DS_Store
27+
.env.local
28+
.env.development.local
29+
.env.test.local
30+
.env.production.local
31+
32+
npm-debug.log*
33+
yarn-debug.log*
34+
yarn-error.log*

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

CONTRIBUTE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
> **Note**
2+
> This guide is meant for local development and contributing to the repository only, for guidance on the TIPs process and how to propose Tangle improvements, please see the [README](README.md)
3+
4+
5+
# Documentation
6+
7+
The TIPs online documentation is built using [Docusaurus 2](https://docusaurus.io/). The deployment is done through a centralized build from [IOTA WIKI](https://github.com/iota-wiki/iota-wiki). To run a local instance, the [IOTA WIKI CLI](https://www.npmjs.com/package/@iota-wiki/cli) is used.
8+
9+
## Prerequisites
10+
11+
- [Node.js 16.10 or above](https://nodejs.org/en/download/).
12+
- [Modern Yarn](https://yarnpkg.com/getting-started/install) enabled by running `corepack enable`.
13+
14+
## Installation
15+
16+
```console
17+
yarn
18+
```
19+
20+
This command installs all necessary dependencies.
21+
22+
## Local Development
23+
24+
```console
25+
yarn start
26+
```
27+
28+
This command starts a local, wiki themed development server and opens up a browser window. Most changes are reflected live without having to restart the server.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Building the IOTA ecosystem is a community effort, therefore we welcome anyone t
88

99
Do you have an idea how to improve the IOTA technology stack?
1010
- Head over to the [discussions](https://github.com/iotaledger/tips/discussions) page to browse already submitted ideas or share yours!
11-
- Once your idea is discussed, you can submit a draft TIP ([template here](./tip-template.md)) as a PR to the repository.
11+
- Once your idea is discussed, you can submit a draft TIP ([template here](https://github.com/iotaledger/tips/blob/main/tip-template.md) as a PR to the repository.
1212
- You will receive feedback from the TIP Editors and review from core devs.
1313
- Once accepted, your TIP is merged as Draft.
1414
- It is your responsibility to drive its implementation and to present a clear plan on how the new feature will be adopted by the network.

docusaurus.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const { link } = require('fs');
2+
const path = require('path');
3+
4+
module.exports = {
5+
plugins: [
6+
[
7+
'@docusaurus/plugin-content-docs',
8+
{
9+
id: 'iota-tips',
10+
path: path.resolve(__dirname, './'),
11+
routeBasePath: 'tips',
12+
editUrl: 'https://github.com/iotaledger/tips/edit/main/',
13+
remarkPlugins: [require('remark-import-partial')],
14+
include: ['tips/**/*.md', 'README.md'],
15+
16+
// Create own sidebar to flatten hierarchy and use own labeling
17+
async sidebarItemsGenerator({
18+
defaultSidebarItemsGenerator,
19+
...args
20+
}) {
21+
const items = await defaultSidebarItemsGenerator(args);
22+
23+
const result = items[1].items.map((item) => {
24+
if (item.type === 'category') {
25+
if (item.link.type === 'doc') {
26+
// Get TIP number and append TIP name
27+
item.label = item.link.id.slice(-4) + '-' + item.label
28+
}
29+
}
30+
return item;
31+
});
32+
33+
return [items[0]].concat(result);
34+
},
35+
}
36+
],
37+
],
38+
staticDirectories: [],
39+
};

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "iota-tips",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"start": "iota-wiki start",
6+
"build": "iota-wiki build"
7+
},
8+
"license": "UNLICENSED",
9+
"engines": {
10+
"node": ">=16.10.0"
11+
},
12+
"devDependencies": {
13+
"@iota-wiki/cli": "latest"
14+
},
15+
"packageManager": "[email protected]"
16+
}

tips/TIP-0001/tip-0001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TIPs must adhere to the format and structure requirements that are outlined in t
5656

5757
### TIP Template
5858

59-
The template to follow for new TIPs is located in the [repository](../../tip-template.md).
59+
The template to follow for new TIPs is located in the [repository](https://github.com/iotaledger/tips/blob/main/tip-template.md).
6060

6161
### TIP Process
6262

tips/TIP-0004/tip-0004.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ In the following we define the Merkle tree hash (MTH) function that returns the
5959
- The output is a single 32-byte hash.
6060

6161
Given an ordered list of n input strings D<sub>n</sub> = {d<sub>1</sub>, d<sub>2</sub>, ..., d<sub>n</sub>}, the Merkle tree hash of D is defined as follows:
62-
- If D is an empty list, MTH(D) is the hash of an empty string:<br>
62+
- If D is an empty list, MTH(D) is the hash of an empty string:<br/>
6363
MTH({}) = BLAKE2().
64-
- If D has the length 1, the hash (also known as a leaf hash) is:<br>
64+
- If D has the length 1, the hash (also known as a leaf hash) is:<br/>
6565
MTH({d<sub>1</sub>}) = BLAKE2( 0x00 || d<sub>1</sub> ).
6666
- Otherwise, for D<sub>n</sub> with n > 1:
6767
- Let k be the largest power of two less than n, i.e. k < n ≤ 2k.
68-
- The Merkle tree hash can be defined recursively:<br>
68+
- The Merkle tree hash can be defined recursively:<br/>
6969
MTH(D<sub>n</sub>) = BLAKE2( 0x01 || MTH({d<sub>1</sub>, ..., d<sub>k</sub>}) || MTH({d<sub>k+1</sub>, ..., d<sub>n</sub>}) ).
7070

7171
Note that the hash calculations for leaves and nodes differ. This is required to provide second preimage resistance: Without such a prefix, for a given input D an attacker could replace two (or more) leaves with their corresponding aggregated node hash without changing the final value of MTH(D). This violates the fundamental assumption that, given MTH(D), it should be practically impossible to find a different input D' leading to the same value. Adding a simple prefix mitigates this issue, since now leaf and node hashes are computed differently and can no longer be interchanged.

tips/TIP-0006/tip-0006.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ The following table describes the serialization of a _Message_ following the not
111111
</tr>
112112
</table>
113113
</details>
114+
</td>
115+
</tr>
114116
<tr>
115117
<td>Nonce</td>
116118
<td>uint64</td>

0 commit comments

Comments
 (0)