/ README.md
README.md
1 # Codex documentation 2 3 Welcome to Codex documentation. 4 5 Codex is a decentralised data storage platform that provides exceptionally strong censorship resistance and durability guarantees. 6 7 8 ## Run and build 9 10 For documentation we use [VitePress](https://vitepress.dev/), which is [Vue](https://vuejs.org/)-powered static site generator built on top of [Vite](https://vitejs.dev/). 11 12 To run site locally, we should clone repository, install dependencies and run the following command 13 ```shell 14 npm run docs:dev 15 ``` 16 17 <details> 18 <summary>Detailed guide</summary> 19 20 1. [Install](https://nodejs.org/en/download/package-manager) node 20 or [above](https://nodejs.org/en/about/previous-releases) 21 22 Using [nvm](https://github.com/nvm-sh/nvm) 23 ```shell 24 # nvm 25 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash 26 27 # Node 22 28 nvm install 22 29 nvm use 22 30 31 # Check 32 node --version 33 v22.6.0 34 ``` 35 36 2. Clone repository 37 ```shell 38 git clone https://github.com/codex-storage/codex-docs 39 cd codex-docs 40 ``` 41 42 3. Install dependencies 43 ```shell 44 npm install 45 ``` 46 47 4. Start a local dev server with instant hot updates 48 ```shell 49 # Local 50 npm run docs:dev 51 52 # Expose 53 npm run docs:dev -- --host 54 ``` 55 56 5. [Build the site](https://vitepress.dev/guide/deploy) 57 ```shell 58 npm run docs:build 59 60 # .vitepress/dist 61 ``` 62 </details> 63 64 65 ## Contribute 66 67 Please check [VitePress documentation](https://vitepress.dev/) for more details about customizations. 68 69 Process 70 - Create a fork 71 - Create a custom branch in your fork 72 - Add your contribution 73 - Make a PR to the upstream repository 74 75 Project structure 76 - `learn` - All information to learn about Codex 77 - `developers` - Codex development process and guides 78 79 80 ## Internationalization 81 82 We are using built-in [i18n features for Internationalization support](https://vitepress.dev/guide/i18n). 83 84 In order to add a new language version of the docs it is required 85 1. Create a folder with a name of the two letter language code - `ko` for Korean, please check [List of ISO 639 language codes](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes). 86 87 2. Copy and translate required pages. It make sense to use English pages as a source as it is the primary language. Pages are located inside the repository sub-folders 88 - *codex* 89 - *developers* 90 - *learn* 91 - *networks* 92 93 After translation, we will have a new folder with all sub-folders 94 ``` 95 ko 96 ├── codex 97 ├── developers 98 ├── learn 99 └── networks 100 ``` 101 102 3. If you need to translate images, they are located inside a *public* folder. After translation, add a language suffix to the language specific file, for example *public/learn/architecture-`ko`.png*. 103 104 Then, update the docs to use a language specific image. 105 106 4. Add new language to the site config file - [*.vitepress/config.mts*](.vitepress/config.mts) 107 ```json 108 // Korean 109 ko: { 110 label: '한국어', 111 lang: 'ko-KP', 112 link: '/ko', 113 themeConfig: {} 114 } 115 ``` 116 - `label` - Native language name from [List of ISO 639 language codes](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) 117 - `lang` - [\<Language code\>](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)-[\<Country code\>](https://en.wikipedia.org/wiki/ISO_3166-1) 118 - `link` - link to the index document located in the language specific folder 119 - `themeConfig` - contains translation of the site elements like Nav/Side bar, etc. 120 121 After performed changes, we should have a documentation site in a newly added language.