How to Contribute
1. Clone the Cookbook
Fork the Starcoin Cookbook repo to make a copy of this cookbook in your account. Then clone that repo to your development environment and navigate to the local repo.
git clone firstname.lastname@example.org:your-username/starcoin-cookbook.git
2. Installing Packages
Node.js and yarn are required to build this cookbook, read the yarn installation page for details.
Execute the following command in the project root to install the packages and dependencies.
3. Running the Development Server
$ yarn start
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
English locale is used by default. Start your localized site in dev mode, using the locale of your choice:
$ yarn start --locale zh
Available locales defined in
This command generates static content into the
/build directory and can be served using any static contents hosting service.
$ yarn build
The default BaseUrl is
/starcoin-cookbook, if you want to change it, you can specify it via environment variable before build.
$ export BASE_URL='/'
(2) Run the following command, which will start a web service locally.
Then run serve to serving build directory at
$ yarn serve
If you specify the BASE_URL environment variable as
/, the address will be:
File Structure Guidelines
- A numerical prefix is required in the directory name and file, e.g.,
01-build.md, which indicates the order of the document in the sidebar.
kebab-casenaming convention is used in directory and file names.
README.mdin each directory is the front page of the directory.
_category_.yamlis the configuration file for a directory, in which the
labelproperty is the title of this directory showing in the sidebar.
- The default documents are in English, translations can be found in
i18n/<language-code>/docusaurus-plugin-content-docs/current. Translations should use the same file name as the English docs.
Document Style Guidelines
The Chinese version is following additional document conventions, read the Chinese document style for details.
How to translate a section (directory)?
Adding Chinese translation for example. Run the following command after adding a new section (directory):
$ yarn write-translations --locale zh
Changes are made to
i18n/zh/docusaurus-plugin-content-docs/current.json, and new directory name is added. Editing the file to add translation.
zhto the corresponding language code for other languages.