Skip to content

Commit

Permalink
Merge branch 'master' into watchers
Browse files Browse the repository at this point in the history
  • Loading branch information
jdanielmyers committed Apr 5, 2021
2 parents 60f8cf5 + a90c8c6 commit f6d2686
Show file tree
Hide file tree
Showing 28 changed files with 1,188 additions and 59 deletions.
84 changes: 34 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion site/app/styles/_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
/* Snowflake specific category classes */

$color-resource-optimization: #134369;
$color-demos2: #21a2e0;
$color-getting-started: #5bc6d1;
$color-demos: #c7477a;
$color-architecture-patterns: #097e89;
$color-data-applications: #282A72;
$color-data-exchange: #282A72;
@include codelab-card(['getting-started'], $color-getting-started, '');
@include codelab-card(['resource-optimization'], $color-resource-optimization, '');
@include codelab-card(['architecture-patterns'], $color-architecture-patterns, '');
@include codelab-card(['demos'], $color-demos, '');
@include codelab-card(['data-engineering'], $snowflake-blue, 'data-engineering.svg');
@include codelab-card(['data-lake'], $star-blue, 'data-lake.svg');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Here is an example command to `select` everything on the `emp_basic` table.
![Snowflake_SELECT_image](assets/Snowflake_SELECT.png)

Sifting through everything on your table may not be the best use of your time. Getting specific
results is simple, with a few functions and some query syntax.
results are simple, with a few functions and some query syntax.

- [WHERE​](https://docs.snowflake.com/en/sql-reference/constructs/where.html#where) is an additional clause you can add to your select query.

Expand Down Expand Up @@ -307,4 +307,4 @@ Continue by [​developing an application](https://docs.snowflake.com/en/develop
- SnowSQL setup
- Uploading data using SnowSQL
- Querying data using SnowSQL
- Managing and deleting data using SnowSQL
- Managing and deleting data using SnowSQL
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f6d2686

Please sign in to comment.