From 047e890876339e5869c7512adbce7b149cb32ce5 Mon Sep 17 00:00:00 2001 From: Shu Muto Date: Tue, 16 Feb 2021 16:47:05 +0900 Subject: [PATCH] Code block highlighting on docs/developer (#5806) * Update internationalization.md * Update internationalization.md * Update internationalization.md * Update getting-started.md * Update code-conventions.md --- docs/developer/code-conventions.md | 4 ++-- docs/developer/getting-started.md | 30 +++++++++++++------------- docs/developer/internationalization.md | 8 +++---- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/developer/code-conventions.md b/docs/developer/code-conventions.md index 2a1e9072d..e5e9e4f3a 100644 --- a/docs/developer/code-conventions.md +++ b/docs/developer/code-conventions.md @@ -21,13 +21,13 @@ An overview of the features provided by the dashboard can be found [here](https: The code style check suite includes format checks can be executed with: -``` +```shell npm run check ``` The code formatting can be executed with: -``` +```shell npm run fix ``` diff --git a/docs/developer/getting-started.md b/docs/developer/getting-started.md index d28e3681b..6a7323b6f 100644 --- a/docs/developer/getting-started.md +++ b/docs/developer/getting-started.md @@ -16,13 +16,13 @@ Make sure the following software is installed and added to the `$PATH` variable: Clone the repository into `$GOPATH/src/github.com/kubernetes/dashboard` and install the dependencies: -``` +```shell npm ci ``` If you are running commands with root privileges set `--unsafe-perm flag`: -``` +```shell npm ci --unsafe-perm ``` @@ -30,7 +30,7 @@ npm ci --unsafe-perm To make Dashboard work you need to have cluster running. If you would like to use local cluster we recommend [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/), [minikube](https://kubernetes.io/docs/getting-started-guides/minikube/) or [kubeadm-dind-cluster](https://github.com/Mirantis/kubeadm-dind-cluster). The most convenient way is to make it work is to create a proxy. Run the following command: -``` +```shell kubectl proxy ``` @@ -40,13 +40,13 @@ kubectl will handle authentication with Kubernetes and create an API proxy with Quick updated version: -``` +```shell npm start ``` Another way to connect to real cluster while developing dashboard is to specify options for `npm` like following: -``` +```shell npm run start:https --kubernetes-dashboard:kubeconfig= ``` @@ -70,7 +70,7 @@ To build dashboard for production, you still need to install `bc`. The Dashboard project can be built for production by using the following task: -``` +```shell npm run build ``` @@ -78,7 +78,7 @@ The code is compiled, compressed, i18n support is enabled and debug support remo To build and immediately serve Dashboard from the `dist` folder, use the following task: -``` +```shell npm run start:prod ``` @@ -88,13 +88,13 @@ Open a browser and access the UI under `localhost:9090`. The following processes To build the docker image on darwin OS you will need to set environment variable for go to build as linux: -``` +```shell export GOOS=linux ``` In order to package everything into a ready-to-run Docker image, use the following task: -``` +```shell npm run docker:build:head ``` @@ -104,29 +104,29 @@ You might notice that the Docker image is very small and requires only a few MB. Unit tests should be executed after every source code change. The following task makes this a breeze. The full test suite includes unit tests and integration tests. -``` +```shell npm run test ``` You can also run individual tests on their own (such as the backend or frontend tests) by doing the following: -``` +```shell npm run test:frontend ``` or -``` +```shell npm run test:backend ``` The code style check suite includes format checks can be executed with: -``` +```shell npm run check ``` The code formatting can be executed with: -``` +```shell npm run fix ``` @@ -140,7 +140,7 @@ Since the hooks for commit has been set with `husky` into `/.git Then you can commit your changes and push them to your fork: -``` +```shell git commit git push -f origin my-feature ``` diff --git a/docs/developer/internationalization.md b/docs/developer/internationalization.md index 327f77eb4..6421fd9b2 100644 --- a/docs/developer/internationalization.md +++ b/docs/developer/internationalization.md @@ -47,7 +47,7 @@ Since dashboard team can not review translation files in your language, so dashb 3. Run `npm run fix:i18n`. Then translation file for your language, e.g. `i18n/fr/messages.fr.xlf`, would be generated in your locale directory. 4. Open your translation file and translate texts in `` element into your language, and remove `state="new"` to mark it as translated. 5. To build dashboard for your language, add your locale into `locales` in `angular.json` like follow: - ``` + ```json "ja": { "translation": "i18n/ja/messages.ja.xlf", "baseHref": "" @@ -57,13 +57,13 @@ Since dashboard team can not review translation files in your language, so dashb After preparation of new translation file, configure `i18n/locale_conf.json` file to support translated dashboard as follows: -``` +```json {"translations": [ "en", "fr", "ko", "zh" ]} ``` To add Japanese translation file, add `"ja"` into `"translations"` array in alphabetical order. -``` +```json {"translations": [ "en", "fr", "ja", "ko", "zh" ]} ``` @@ -71,7 +71,7 @@ Then you can build your localized dashboard with `npm run build`. Before submit Pull Request, add `i18n/[locale]/OWNERS` file for your translation team like below: -``` +```yaml approvers: - [your github account] - [and more approvers' github account] -- GitLab