Finally fix the problem where ```shell was not highlighted correctly

This commit is contained in:
Pete Gonzalez 2024-03-01 00:58:10 -08:00
parent 77ddc264b5
commit 16beb15473
9 changed files with 32 additions and 25 deletions

View file

@ -6,14 +6,14 @@ This is the [Docusaurus](https://docusaurus.io/) project for the Sparo website.
1. Install the monorepo dependencies using [RushJS](https://rushjs.io/):
```bash
```shell
rush install
rush build
```
2. Launch the local development server:
```bash
```shell
cd apps/website
rushx start
```
@ -33,14 +33,14 @@ Notes:
1. If you will manually copy the files to a server, you can build the **apps/sparo/build** folder like this:
```bash
```shell
cd apps/website
rushx build
```
2. To automatically deploy to GitHub Pages (as an administrator):
```bash
```shell
# If you are using HTTPS authentication for GitHub:
cd apps/website
GIT_USER=<Your GitHub username> rushx deploy

View file

@ -48,7 +48,7 @@ Try out Sparo in 5 easy steps:
2. Clone your [RushJS](https://rushjs.io/) monorepo:
```bash
```shell
sparo clone https://github.com/my-company/my-monorepo.git
```
@ -76,7 +76,7 @@ Try out Sparo in 5 easy steps:
4. Check out your Sparo profile:
```bash
```shell
sparo checkout --profile my-team
```
@ -84,7 +84,7 @@ Try out Sparo in 5 easy steps:
Examples:
```bash
```shell
sparo pull
sparo commit -m "Example command"

View file

@ -19,7 +19,7 @@ Many Git optimizations are relatively new and not available in older versions of
Clone your [RushJS](https://rushjs.io/) monorepo:
```bash
```shell
sparo clone https://github.com/my-company/my-monorepo.git
```
@ -64,7 +64,7 @@ The `--to` [project selector](https://rushjs.io/pages/developer/selecting_subset
The `--profile` parameter can be included with `sparo checkout` (and in the future also `sparo clone` and `sparo pull`). This parameter specifies the name of the JSON file to be selected. You can also combine multiple profiles (`sparo checkout --profile p1 --profile p2`), in which case the union of their selections will be used. (Combining profiles is an advanced scenario, but useful for example if your pull request will impact sets of projects belonging to multiple teams.)
**Sparse checkout based on common/sparo-profiles/my-team.json**
```bash
```shell
sparo checkout --profile my-team
```
@ -75,7 +75,7 @@ sparo checkout --profile my-team
- To checkout just the skeleton (returning to the initial state from Step 1 where no profile is chosen yet), specify `--no-profile` instead of `--profile NAME`.
- To add more profiles, combining with your existing selection, use `--add-profile NAME` instead of `--profile NAME`. For example, these two commands produce the same result as `sparo checkout --profile p1 --profile p2`:
```bash
```shell
sparo checkout --profile p1
sparo checkout --add-profile p2
```
@ -86,7 +86,7 @@ For everyday work, consider choosing [mirrored subcommands](../commands/overview
Examples:
```bash
```shell
sparo pull
sparo commit -m "Example command"

View file

@ -67,7 +67,7 @@ You an add JSON comments to your profile config files. In a large shared codeba
The simple way to combine profiles is to specify `--profile` multiple times. For example:
```bash
```sh
# Check out the union of profiles team-a.json, team-b.json, team-c.json
# NOTE: This will replace whatever profile selection was already checked out.
sparo checkout --profile team-a --profile team-b --profile team-c
@ -75,7 +75,7 @@ sparo checkout --profile team-a --profile team-b --profile team-c
You can also use `--add-profile` to incrementally combine them. For example:
```bash
```shell
# These three commands are equivalent to the above command.
sparo checkout --profile team-a
sparo checkout --add-profile team-b
@ -84,7 +84,7 @@ sparo checkout --add-profile team-c
How to checkout no profile at all? That is, how to return to the initial state of a clean `sparo clone` that only includes the [skeleton](../reference/skeleton_folders.md) folders? If `--profile` is entirely omitted, then `sparo checkout` will preserve the existing profile selection. Instead, the `--no-profile` parameter is needed:
```bash
```shell
# NOT IMPLEMENTED YET - check out just the skeleton folders
# without applying any profiles
sparo checkout --no-profile
@ -95,7 +95,7 @@ sparo checkout --no-profile
Users can discover available profiles in the current branch by invoking the [sparo list-profiles](../commands/sparo_list-profiles) command. The `--project` parameter enables you to query relevant profiles for a given project. For example:
```bash
```shell
# Suppose you need to make a fix for the "example-app" project.
# Which sparse checkout profiles include the "example-app" project?

View file

@ -48,7 +48,7 @@ And of course, if an explicit target folder is specified using `git clone https:
Shell interpreters commonly transform expressions involving special characters such as `$`, `%`, `(`, etc. For example:
```bash
```shell
# Problem: Bash would replace "$project" with the value of
# the environment variable whose name is "project".
git clone https://github.com/example/project.git $project
@ -56,7 +56,7 @@ git clone https://github.com/example/project.git $project
This requires escaping:
```bash
```shell
# This backslash escape ensures that a literal dollar sign
# is included in the created folder name:
git clone https://github.com/example/project.git \$project

View file

@ -6,32 +6,32 @@ Building the projects in this monorepo:
1. Install the [RushJS](https://rushjs.io/) tool:
```bash
```shell
npm install -g @microsoft/rush
```
2. Clone the repo:
```bash
```shell
git clone https://github.com/tiktok/sparo.git
```
3. Install the dependencies
```bash
```shell
cd sparo
rush install
```
4. Build all projects
```bash
```shell
rush build
```
How to invoke your locally build `sparo` command:
```bash
```shell
cd apps/sparo
node lib/start.js
```

View file

@ -119,7 +119,10 @@ const config = {
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula
darkTheme: prismThemes.dracula,
// Docusaurus's small set of Markdown syntax highlighting languages:
// https://docusaurus.io/docs/markdown-features/code-blocks#supported-languages
additionalLanguages: ['bash', 'batch', 'javascript', 'json', 'powershell', 'typescript']
}
})
};

View file

@ -35,7 +35,8 @@
"@docusaurus/types": "3.1.1",
"@types/react": "~18.2.59",
"@types/react-dom": "~18.2.19",
"typescript": "~5.3.3"
"typescript": "~5.3.3",
"prismjs": "~1.29.0"
},
"browserslist": {
"production": [

View file

@ -142,6 +142,9 @@ importers:
'@types/react-dom':
specifier: ~18.2.19
version: 18.2.19
prismjs:
specifier: ~1.29.0
version: 1.29.0
typescript:
specifier: ~5.3.3
version: 5.3.3
@ -10020,7 +10023,6 @@ packages:
/prismjs@1.29.0:
resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==}
engines: {node: '>=6'}
dev: false
/process-nextick-args@2.0.1:
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
@ -12275,6 +12277,7 @@ time:
/inversify@6.0.2: '2023-10-20T23:35:39.918Z'
/lunr@2.3.9: '2020-08-19T20:30:07.948Z'
/prism-react-renderer@2.3.1: '2023-12-18T14:23:38.265Z'
/prismjs@1.29.0: '2022-08-23T10:42:14.395Z'
/react-dom@18.2.0: '2022-06-14T19:46:48.370Z'
/react@18.2.0: '2022-06-14T19:46:38.369Z'
/reflect-metadata@0.2.1: '2023-12-14T18:54:20.669Z'