You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On this directory, we have the pre-release documentation written using markdown. This file has the `.md` extension and as we mentioned before, these are pre-release files if you don't add a documentation version yet.
4
+
5
+
## Markdown options
6
+
7
+
These files have the following structure at the beginning of the file:
8
+
9
+
```
10
+
---
11
+
id: idOftheFile
12
+
title: Title of your file
13
+
sidebar_label: Title of the sidebar
14
+
---
15
+
16
+
My new content here..
17
+
```
18
+
19
+
The previous example has a couple of the most important part to identify the content that you wish to add to your documentation. Here is a more detailed explanation on the [Markdown feature](https://docusaurus.io/docs/en/doc-markdown) that you can use.
20
+
21
+
## Test documentation page
22
+
23
+
We have a local server that we use to test your current docs content. Here are the steps on how to set the [local server](https://github.com/clay/claycli/tree/master/website#run-the-local-server). Normally you will have access on your browser with a url like this:
24
+
25
+
`http://localhost:3000/claycli/docs/idOfTheDocs`
26
+
27
+
But if you already have a [version](https://github.com/clay/claycli/tree/master/website#versioning-the-code) on your docs you will need to add `next` on your url
You will need to to have `Node >= 8.x` and `Yarn >= 1.5`.
1
+
You will need to have `Node >= 8.x` and `Yarn >= 1.5`.
2
2
3
3
# Run the local server
4
4
@@ -7,7 +7,9 @@ You will need to to have `Node >= 8.x` and `Yarn >= 1.5`.
7
7
```sh
8
8
$ yarn
9
9
```
10
+
10
11
or
12
+
11
13
```sh
12
14
$ npm install
13
15
```
@@ -17,7 +19,9 @@ $ npm install
17
19
```sh
18
20
$ yarn start
19
21
```
22
+
20
23
or
24
+
21
25
```sh
22
26
$ npm run start
23
27
```
@@ -27,41 +31,89 @@ $ npm run start
27
31
Your project file structure should look something like this
28
32
29
33
```
30
-
my-docusaurus/
31
-
docs/
32
-
cli.md
34
+
root-directory
35
+
├── docs
36
+
├── docs.md
33
37
website/
34
-
blog/
35
-
core/
36
-
node_modules/
37
-
pages/
38
-
static/
39
-
css/
40
-
img/
41
-
versioned_docs/
42
-
versioned_sidebars/
43
-
README.md
44
-
package.json
45
-
sidebar.json
46
-
siteConfig.js
47
-
versions.json
38
+
├── README.md
39
+
├── core
40
+
└── Footer.js
41
+
├── i18n
42
+
└── en.json
43
+
├── package.json
44
+
├── pages
45
+
└── en
46
+
└── index.js
47
+
├── sidebars.json
48
+
├── siteConfig.js
49
+
└── static
50
+
├── css
51
+
└── custom.css
52
+
└── img
53
+
├── favicon
54
+
└── logo.svg
55
+
└── versioned_docs
56
+
└── version 0.0.0
57
+
├── docs.md
58
+
└── versioned_sidebars
59
+
├── version-0.0.0-sidebars.json
48
60
```
49
61
50
-
# Publish the website
51
-
The Claycli website will live on GitHub page. You just need to run the following commands:
62
+
# Versioning the Code
63
+
64
+
The first step to begin the process of versioning your documentation is to generate the `versions` script on your website directory with the following command.
65
+
66
+
```sh
67
+
yarn examples versions
52
68
```
53
-
$ yarn build
69
+
70
+
or
71
+
72
+
```sh
73
+
npm run examples versions
74
+
```
75
+
76
+
Then, you proceed to create a version of the docs that you need. In this case, it needs to match the version of your current `package.json`. To do this we will use the following command followed by the version number that you want.
77
+
78
+
```sh
79
+
$ yarn version X.X.X
54
80
```
81
+
55
82
or
83
+
84
+
```sh
85
+
$ npm version X.X.X
56
86
```
57
-
$ npm run build
87
+
88
+
This will create all the files needed to handle the version that you just built, but this will be necessary only in 2 cases:
89
+
90
+
1. If the documentation doesn't have a version set
91
+
2. If there is a major update on the number of the version
92
+
93
+
For other cases, we have an active call [update version](https://github.com/clay/claycli/blob/master/.github/main.workflow) that will handle the change of the version automatically.
94
+
95
+
# Publish the website
96
+
97
+
This process is automatically done by an action call [Build and push docs](https://github.com/clay/claycli/blob/master/.github/main.workflow) but you can deploy your documentation manually. You just need to run the following commands:
98
+
99
+
```sh
100
+
$ yarn build
58
101
```
59
102
60
-
Then you just need to deploy the static files generated. These files will be pushed to the `gh-page` branch.
103
+
or
104
+
105
+
```sh
106
+
$ npm run build
61
107
```
108
+
109
+
Then, deploy the static files generated. These files will be pushed to the `gh-page` branch.
0 commit comments