- 
                Notifications
    You must be signed in to change notification settings 
- Fork 188
Run Ballerina By Examples using the Go tool
After writing a Ballerina By Example, you can also run it to test and verify if the output is accurate. Follow the instructions below to do this.
- 
Create a directory with the BBE directories, which you want to test and the index.jsonfile (e.g.,/examples).
- 
In the CLI, navigate to the masterbranch of the ballerina-release GitHub repo (i.e.,<BALLERINA_RELEASE_REPO_HOME>).
- 
Execute the command below to build the BBEs. Info: You need to change the properties of the above command accordingly. Also, the <GEN_PLAYGROUND_LINKS>property can be set tofalsewhile testing BBEs locally since withtrueit takes a longer time to run the tool. In the final run, you can set this totrue.go run ballerinaByExample/tools/generate.go “<SOURCE-OF-THE-BBES>” “<RELEASE-VERSION>” “<OUTPUT-FOLDER>” “<WITH-OR-WITHOUT-FRONT-MATTER>” “<IF-LATEST-VERSION>” “<GEN_PLAYGROUND_LINKS>” For example, go run ballerinaByExample/tools/generate.go "/Documents/examples" "1.2" "by-example" "true" "true" "true" 
- 
Copy the generated <BALLERINA_RELEASE_REPO_HOME>/by-exampledirectory.
- 
Replace the <BALLERINA_DEV_WEBSITE_REPO_HOME>/<VERSION>/learn/by-exampledirectory with the directory you copied.
- 
In the CLI, navigate to the masterbranch of the ballerina-dev-website GitHub repo (i.e.,<BALLERINA_DEV_WEBSITE_REPO_HOME>).
- 
Execute the bundle exec jekyll servecommand to build the website locally.Note: Alternatively, execute the command below if you do not have Jekyll configured locally. docker run -p 4000:4000 --volume="/home/shaf/Documents/source/public/ballerina-dev-website:/srv/jekyll" jekyll/builder:3.8 jekyll serve
- 
Navigate to the Ballerina By Examples in the dev website built locally and test the BBE updates you did.