Skip to content

Commit

Permalink
Update codelab for codelab creation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
TamimiGitHub committed Nov 13, 2024
1 parent fd944b8 commit 7828920
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 158 deletions.
25 changes: 3 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,9 @@ This repository is included as a submodule in the main [site repo](https://githu
1. Navigate to the newly cloned directory `cd solace-dev-codelabs`
1. Checkout a local branch for your new codelab `git checkout -b add-codelab-<name_of_codelab>`

### Option 1 - Script
1. [Setup your environment](https://codelabs.solace.dev/codelabs/codelab-4-codelab/index.html?#1)
1. [Read the solace guidelines](https://codelabs.solace.dev/codelabs/codelab-4-codelab/index.html?#2)
1. From the root directory, run `./init.sh <name-of-codelab>` script
1. Navigate to `/markdown/name-of-codelab`
1. Run the following from terminal `npm install; npm run watch`
1. Edit your `<name-of-codelab>.md` file in your text editor of choice
1. When ready, run `export.sh`
1. Navigate to the codelabs root directory (`cd ../../`), add and commit your changes in a PR. From the root directory,
```
cd ../../ #to navigate to the root of the codelabs dir
git add .
git commit -m "add new codelab: <name of codelab>"
git push origin add-codelab-<name_of_codelab>
```
Note: _origin_ in the command above the name of the remote repository. If your remote repository is of a different name then you will have to `git push <name_of_remote_repo> add-codelab-<name_of_codelab>`

### Option 2 - Manual

Follow the steps in this tutorial: https://codelabs.solace.dev/codelabs/codelab-4-codelab

Note: original markdown of this codelab is found under [codelabs/codelab-4-codelab](./codelabs/codelab-4-codelab)
### Create your own Codelab

Follow the steps found in the [Codelab to Create a Codelab](https://codelabs.solace.dev/codelabs/codelab-4-codelab/index.html?#1) codelab

## Learn About CodeLab
* CodeLabs are being created using Google Codelabs: https://github.com/googlecodelabs/tools
7 changes: 4 additions & 3 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ command_exists() {
# check if command exists and fail otherwise
command -v "$1" >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Note: $1 Does not exist. Please install it first!"
echo "Note: $1 Does not exist. Please install it if you would like to run the codelab locally"
fi
}

Expand Down Expand Up @@ -80,6 +80,7 @@ if [ -f "$backup_package_json" ]; then
fi

echo "Markdown file created! Find it at $PWD/markdown/$CODELAB_NAME"

command_exists claat
command_exists go
command_exists go

cd $PWD/markdown/$CODELAB_NAME
Loading

0 comments on commit 7828920

Please sign in to comment.