Skip to content

Commit d3068bb

Browse files
authored
Update the docs and website README (#154)
1 parent cce15dc commit d3068bb

File tree

2 files changed

+107
-24
lines changed

2 files changed

+107
-24
lines changed

docs/README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Clay Documentation
2+
3+
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
28+
29+
`http://localhost:3000/claycli/docs/next/idOfTheDocs`
30+
31+
[Here](https://docusaurus.io/docs/en/versioning) are more insights about what to do when you already have documentation with version.

website/README.md

+76-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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`.
22

33
# Run the local server
44

@@ -7,7 +7,9 @@ You will need to to have `Node >= 8.x` and `Yarn >= 1.5`.
77
```sh
88
$ yarn
99
```
10+
1011
or
12+
1113
```sh
1214
$ npm install
1315
```
@@ -17,7 +19,9 @@ $ npm install
1719
```sh
1820
$ yarn start
1921
```
22+
2023
or
24+
2125
```sh
2226
$ npm run start
2327
```
@@ -27,41 +31,89 @@ $ npm run start
2731
Your project file structure should look something like this
2832

2933
```
30-
my-docusaurus/
31-
docs/
32-
cli.md
34+
root-directory
35+
├── docs
36+
├── docs.md
3337
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
4860
```
4961

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
5268
```
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
5480
```
81+
5582
or
83+
84+
```sh
85+
$ npm version X.X.X
5686
```
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
58101
```
59102

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
61107
```
108+
109+
Then, deploy the static files generated. These files will be pushed to the `gh-page` branch.
110+
111+
```sh
62112
$ yarn deploy
63113
```
114+
64115
or
65-
```
116+
117+
```sh
66118
$ npm run deploy
67119
```

0 commit comments

Comments
 (0)