Skip to content

Commit 2698fff

Browse files
authored
Update README.md (#293)
1 parent e3f6652 commit 2698fff

File tree

1 file changed

+48
-15
lines changed

1 file changed

+48
-15
lines changed

mkdocs/README.md

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,72 @@
11
# Documentation for the XCM SDK
22

3-
## Publishing New Versions
3+
This directory contains the XCM SDK documentation found at [https://moonbeam-foundation.github.io/xcm-sdk/latest/](https://moonbeam-foundation.github.io/xcm-sdk/latest/). It is generated using [MkDocs](https://www.mkdocs.org/) and [Material for MkDocs](https://squidfunk.github.io/mkdocs-material).
44

5-
To add the very first version, you’ll need to push the latest changes to the `main` branch and then in your terminal run:
5+
These docs are versioned and rely on [mike](https://github.com/jimporter/mike) to deploy new versions and manage existing ones. **Any updates to the documentation site require you to use mike to deploy the changes**, pushing changes to the `main` branch will **not** automatically publish the changes to the live site. You need to follow the [deployment process](#deployment-process).
6+
7+
## Get Started
8+
9+
Clone the `xcm-sdk` repository:
10+
11+
```bash
12+
git clone https://github.com/moonbeam-foundation/xcm-sdk.git
13+
```
14+
15+
Install the dependencies by navigating to the `mkdocs` directory and running:
616

717
```bash
8-
mike deploy --push INSERT_NEW_VERSION latest
18+
pip install -r requirements.txt
919
```
1020

11-
Where the version should be formatted like `v0`, as we only need to worry about maintaining documentation for major version changes.
21+
This will install some essential dependencies, including MkDocs, Material for MkDocs, and mike.
22+
23+
## Deployment Process
24+
25+
The process for deploying new changes to the documentation site is as follows:
26+
27+
1. Make changes and merge them into the `main` branch
28+
2. Run a `mike deploy` command to either [publish a new version](#publishing-new-versions) (which should only be done for major releases) or [publish changes to the current version](#publishing-changes-to-the-current-version)
29+
3. Upon running the `deploy` command, mike will create a new Git commit on the `gh-pages` branch. When deploying changes to the current version, the previous docs for that version are erased and overwritten, but docs for other versions remain untouched
30+
4. The new Git commit is picked up and published to the live docs site
31+
32+
Please note that modifying a previous version is possible, but should not be done unless necessary. It will require you to roll back changes to that version. For example, if the current version is v2 and you make a change and want to apply it to v0, the rest of the pages must be on v0, otherwise, the v2 changes will be applied to v0.
1233

13-
For additional versions, you'll need to run:
34+
### Publishing New Versions
35+
36+
To add a new version for a major release, you'll need to run the following deployment command from the `mkdocs` directory:
37+
38+
```bash
39+
mike deploy --push INSERT_NEW_VERSION
40+
```
41+
42+
Where the version should be formatted like `v0`. We only need to worry about maintaining documentation for major version changes, so you shouldn't ever need to use `v0.1` or `v0.0.1` or anything along those lines.
43+
44+
**Note**: You can find the current version by looking at which version is the latest in the [`versions.json` file](https://github.com/moonbeam-foundation/xcm-sdk/blob/gh-pages/versions.json) on the `gh-pages` branch.
45+
46+
Then, you'll need to update the latest alias to the new version:
1447

1548
```bash
1649
mike deploy --push --update-aliases INSERT_NEW_VERSION latest
1750
```
1851

19-
## Publishing Changes to a Specific Version
52+
Now when you go to the docs site, you'll be automatically taken to the new version.
53+
54+
### Publishing Changes to the Current Version
2055

21-
To make minor updates to the current version or an older version, you’ll need to make the changes to the `main` branch and then in your terminal run:
56+
To make minor updates to the current version, you’ll need to run the following deployment command:
2257

2358
```bash
24-
mike deploy --push INSERT_VERSION
59+
mike deploy --push INSERT_CURRENT_VERSION
2560
```
2661

27-
If using the latest version, you can cross-reference the live website, or the `gh-pages` branch to get the version that needs to be provided to the above command.
62+
**Note**: You can find the current version by looking at which version is the latest in the [`versions.json` file](https://github.com/moonbeam-foundation/xcm-sdk/blob/gh-pages/versions.json) on the `gh-pages` branch.
2863

29-
Please note that modifying a previous version is possible, but should not be done unless necessary. It will require you to roll back changes to that version. For example, if the current version is v2 and you make a change and want to apply it to v0, the rest of the pages must be on v0, otherwise, the v2 changes will be applied to v0.
64+
## Contributing
3065

31-
## Setting a Default Version
66+
To contribute to the documentation, you'll need to make changes to the `mkdocs/docs` directory. Please follow the guidelines outlined in the [PaperMoon style guide](https://github.com/papermoonio/documentation-style-guide/blob/main/style-guide.md).
3267

33-
After setting the `latest` alias as the default version, and when publishing a new version, always update the alias to point to the latest version by running:
68+
Once you've [cloned the repository and installed the dependencies](#get-started), you can make changes as needed, and view them locally on port 8000, by running:
3469

3570
```bash
36-
mike set-default --push latest
71+
mkdocs serve
3772
```
38-
39-
When publishing a new version, this will create a redirect in the root of the documentation to the version associated with the alias. So, `https://moonbeam-foundation.github.io/xcm-sdk/` will redirect to `https://moonbeam-foundation.github.io/xcm-sdk/latest/`.

0 commit comments

Comments
 (0)