Skip to content

Commit

Permalink
Update CONTRIBUTING.md and lefthook module (#1092)
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer authored Oct 3, 2023
1 parent 0aecd6f commit 1dc997a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 42 deletions.
17 changes: 13 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,24 @@ This website is based on Vuepress.

If you're adding a new page to the book, to make it appear, put it also to `.vuepress/configs/sidebar/{locale}.ts`.

## Display Nu Code Snippets With Syntax Highlighting

To display Nushell code snippets with syntax highlighting support you can wrap the Nu codes with \```nu \``` or \```nushell \```, for example:

```nu
# List the top five largest files
ls | where type == file | sort-by -r size | first 5
```

## Translation Guide

1. First of all, make sure you have installed `node.js`, `yarn`, and then clone the doc repo locally:
1. First of all, make sure you have installed `node.js`(v18.12.0 or above), and then clone the doc repo locally:
`git clone [email protected]:nushell/nushell.github.io.git nu-docs`;
2. Run `yarn install` in `nu-docs` dir after your cloning;
2. Run `npm install` in `nu-docs` dir after your cloning;
3. Add a book dir(if not exists) for the specified locale in the docs' root folder, say `zh-CN`, and then create a `book` child folder for all your translated documents, and a README.md for the home page of your locale;
4. Modify the vuepress config file `nu-docs/.vuepress/config.js`, add `zh-CN` related configs, here is a [commit](https://github.com/nushell/nushell.github.io/commit/46d1672) for reference;
4. Modify the vuepress config file `nu-docs/.vuepress/config.js`, add `zh-CN` related configs, here is an example [commit](https://github.com/nushell/nushell.github.io/commit/46d1672) for reference;
5. Add README.md in the `book` dir, and that will be the default introduction page of Nushell. Note: Please **DO NOT** translate the file name of the docs.
6. Run `yarn vuepress dev`, then open **http://localhost:8080/** in your browser, switch to the language you are going to translate into, and you will see the introduction page you have just created. You can translate the docs and save them to get a preview in the browser;
6. Run `npm run dev`, then open **http://localhost:8080/** in your browser, switch to the language you are going to translate into, and you will see the introduction page you have just created. You can translate the docs and save them to get a preview in the browser;
7. Update the `nu-docs/i18n-meta.json` file, fill the locale value of the doc you have just finished. It's recommended to use `commit_id@author` or simply a `commit_id` to indicate your translation end to the specified commit;
8. Commit your changes, It's recommended to squash all your commits in one commit with a commit message like this: `Translate your_doc_file.md to zh-CN from commit: f3dc86d3d`;
9. Send a Pull Request;
Expand Down
2 changes: 1 addition & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# tags: backend security
# run: bundle audit
#
min_version: 1.4.3
min_version: 1.5.0
no_tty: false
skip_output:
- meta # Skips lefthook version printing
Expand Down
72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@vuepress/plugin-medium-zoom": "2.0.0-beta.67",
"@vuepress/plugin-shiki": "^2.0.0-beta.67",
"@vuepress/theme-default": "2.0.0-beta.67",
"lefthook": "^1.4.10",
"lefthook": "^1.5.0",
"patch-package": "^8.0.0",
"prettier": "^3.0.3",
"shiki": "^0.14.4",
Expand Down

0 comments on commit 1dc997a

Please sign in to comment.