forked from Snowflake-Labs/sfquickstarts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,188 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,69 +20,53 @@ You can submit your own SFGuide to be published on Snowflake's website by submit | |
* Remembers where the student left off when returning to a sfguide | ||
* Mobile friendly user experience | ||
|
||
## How to get started | ||
## Getting Started | ||
|
||
1. nodejs & npm ([Install NodeJS & npm](https://nodejs.org/en/download/)) | ||
2. install gulp-cli: | ||
````bash | ||
npm install --global gulp-cli | ||
```` | ||
3. install Golang ([Install Go](https://golang.org/doc/install)) | ||
4. add `/usr/local/go/bin` to the `PATH` environment variable. You can do this by adding the following line to your profile (`.bashrc` or `.zshrc`): | ||
### Prerequisites | ||
|
||
1. [Install Node](https://nodejs.org/en/download/); Homebrew installed? `brew install node` | ||
- Install gulp-cli `npm i -g gulp-cli` | ||
2. [Install Go](https://golang.org/doc/install); Homebrew installed? `brew install golang` | ||
- Install claat `go get github.com/googlecodelabs/tools/claat` | ||
|
||
## Run locally | ||
|
||
1. Fork this repository to your personal github account (top right of webpage, `fork` button) | ||
2. Clone your new fork `git clone [email protected]:<YOUR-USERNAME>/sfguides.git sfguides` | ||
3. Navigate to the site directory `cd sfguides/site` | ||
4. Install node dependencies `npm install` | ||
5. Run the site `npm run serve` | ||
|
||
Congratulations! You now have the Snowflake Guides landing page running. | ||
|
||
##### Common environment errors: | ||
1. You get a `claat not found` error | ||
- Make sure Go is properly in your `PATH`. Add the following lines to your profile (`~/.profile`): | ||
````bash | ||
#adding Golang to path | ||
export PATH=$PATH:/usr/local/go/bin | ||
export PATH=$PATH:$HOME/go/bin | ||
```` | ||
***Note: Changes made to a profile file may not apply until the next time you log into your computer. To apply the changes immediately, just run the shell commands directly or execute them from the profile using a command such as `source $HOME/.zshrc`.*** | ||
|
||
5. install claat: | ||
````bash | ||
go get github.com/googlecodelabs/tools/claat | ||
```` | ||
6. navigate to the site directory: | ||
````bash | ||
cd site/ | ||
```` | ||
7. install dependencies: | ||
````bash | ||
npm install | ||
```` | ||
8. run the site locally | ||
````bash | ||
gulp serve | ||
```` | ||
***Note:** After adding Go to your `PATH`, be sure to apply your new profile: `source ~/.profile`* | ||
|
||
Congratulations! You now have the Snowflake Guides landing page running. | ||
2. You get a `EACCES` error when installing gulp-cli | ||
- This means that your npm location needs to be updated. Follow the steps here: [Resolve EACCESS permissions](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally#manually-change-npms-default-directory) | ||
|
||
#### Write Your First SFGuide: | ||
|
||
1. Terminate the running server with `ctrl C` and and navigate to the `sfguides` source directory `cd sfguides/src` | ||
- In this directory, you will see all existing guides and their markdown files. | ||
2. Generate a new guide from the guide template `npm run template <GUIDE_NAME>` | ||
- Don't use spaces in the name of your guide, instead use underscores. | ||
3. Navigate to the newly generated guide (`cd sfguides/src/<GUIDE_NAME>`) and edit your guide in a tool like vscode. | ||
4. Run the website again `npm run serve` | ||
5. As you edit and save changes, your changes will automatically load in the browser. | ||
|
||
#### Now lets add our first SFGuide: | ||
|
||
1. Terminate the running gulp server with `ctrl C` and navigate to the sfguide directory | ||
````bash | ||
cd site/sfguides | ||
```` | ||
The sfguides directory is where to store all SFGuide content, written in markdown. | ||
|
||
2. Use the claat tool to convert the markdown file to HTML | ||
````bash | ||
claat export sample.md | ||
```` | ||
|
||
You should see `ok sample` as the response. This means claat has successfully converted your .md file to HTML and created a new directory named `sample`. | ||
|
||
3. Now lets run our server again, this time specifying our sfguides directory of content | ||
````bash | ||
gulp serve --codelabs-dir=sfguides | ||
```` | ||
You can now navigate to the landing page in your browser to see your new sfguide! | ||
|
||
You can use the [sample SFGuide](site/sfguides/sample.md) as a template, just change the name of the file and the id listed in the header. | ||
You can always read the [sample SFGuide](site/sfguides/sample.md) online. | ||
|
||
### Tips | ||
|
||
- Review the [sample.md](site/sfguides/sample.md) file to learn more about to to structure your SFGuide for the claat tool. | ||
- You can also see more formating information in the [claat documentation](claat/README.md), and use the command `claat -h` | ||
- You can see the supported SFGuide categories [here](site/app/styles/_overrides.scss). If you want to suggest a new category please create a github issue! | ||
- Checkout [how to use VS Code to write markdown files](https://code.visualstudio.com/docs/languages/markdown) | ||
- If you want to learn more about SFGuides, check out this [excellent tutorial](https://medium.com/@zarinlo/publish-technical-tutorials-in-google-codelab-format-b07ef76972cd) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
site/sfguides/src/getting_started_with_user_defined_functions/_shared_assets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_shared_assets |
Binary file added
BIN
+43 KB
...uides/src/getting_started_with_user_defined_functions/assets/Snowflake_DROP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.9 KB
...ng_started_with_user_defined_functions/assets/Snowflake_SwitchRole_DemoUser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.1 KB
...getting_started_with_user_defined_functions/assets/Snowflake_select_udf_max.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+70.4 KB
...rc/getting_started_with_user_defined_functions/assets/Snowflake_select_udtf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+60.8 KB
...c/getting_started_with_user_defined_functions/assets/Snowflake_udf_CreateDB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+64.4 KB
...tting_started_with_user_defined_functions/assets/Snowflake_udf_CreateSchema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+74 KB
...etting_started_with_user_defined_functions/assets/Snowflake_udf_CreateTable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.4 KB
...src/getting_started_with_user_defined_functions/assets/Snowflake_udf_DropDB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36.5 KB
.../getting_started_with_user_defined_functions/assets/Snowflake_udf_DropTable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+52.4 KB
...es/src/getting_started_with_user_defined_functions/assets/Snowflake_udf_max.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.6 KB
...started_with_user_defined_functions/assets/Snowflake_udf_schema_public_drop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+81.6 KB
...uides/src/getting_started_with_user_defined_functions/assets/Snowflake_udtf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.