Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

All the new docs #41

Merged
merged 16 commits into from
Nov 29, 2016
Merged

All the new docs #41

merged 16 commits into from
Nov 29, 2016

Conversation

cshold
Copy link
Contributor

@cshold cshold commented Nov 2, 2016

What up new docs! See doc content in this Google Doc since this PR would be too difficult to review.

image

Taking reference from js-buy-sdk docs (live version), I've setup a clean Jekyll version of Slate's documentation.

If we merge this PR, docs will go live even if the repo is private.

To do:

  • Review documentation
  • Document JS that's included
  • Link to S3 version of theme zip and vendor/theme js files — @stevebosworth can you help me on this
  • Finalize system requirements
  • Create an Examples page
    • Document how/why to use the JS helpers
    • Document CSS modules like grid, a11y helpers, etc
  • Code of conduct doc
  • Contributing doc

Not included, but cool potential future editions:

  • Version our docs so you can always view old ones
  • Auto generate JS documentation (for slate tools, or slate theme JS)?

@Shopify/themes-fed

@cshold cshold self-assigned this Nov 2, 2016
@cshold cshold force-pushed the new-docs branch 2 times, most recently from d0268a7 to d10060e Compare November 2, 2016 15:36
*If you are having troubles setting up jekyll, see https://jekyllrb.com/docs/installation/*

### Serve the documentation
- `jekyll serve -s docs`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you throw bundle exec in front of that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note under with that, since it's not required for everyone (just those not working on the default system ruby)

@stevebosworth
Copy link
Contributor

just did a content review and it's looking great 🎉

Added some comments to the google docs

@t-kelly
Copy link
Contributor

t-kelly commented Nov 3, 2016

Instead of cluttering master with docs files, you could throw them into a branch called gh-pages

@cshold
Copy link
Contributor Author

cshold commented Nov 3, 2016

The idea with the docs folder is to be updatable with the code it documents at the same time. gh-pages used to be the only way to get a GitHub site up until they added this:
image

"Hey, you updated that section/stuff but the PR doesn't have any updated docs. What gives?" I found managing the two separate branches on Timber releases was pretty rough.

layout: default
---

# Getting started
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to JS Buy SDK (& our github readme file), can we make this title "Slate" instead of getting started?


# Getting started

Slate is a barebones starting point for developing Shopify themes in an efficient and performant way. It allows you to sync local files with your live shop, deploy to multiple environment at the same time, and organize stylesheets and scripts the way you want.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should ideally be consistent with the opening paragraph of our github README. Not sure which one is better but, lets keep this consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Slate is a barebones starting point and command line tool for developing Shopify themes. It is designed to assist your development workflow and speed up the process of developing, testing, and deploying themes to Shopify stores.

It allows you to sync local files with your live shop, deploy to multiple environment at the same time, and organize stylesheets and scripts in a flexible way.


Slate is a barebones starting point for developing Shopify themes in an efficient and performant way. It allows you to sync local files with your live shop, deploy to multiple environment at the same time, and organize stylesheets and scripts the way you want.

## Setup your local environment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting Started


## Setup your local environment

* Install Slate with `npm install @shopify/slate`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this section should likely be split out into:

Using NPM

Downloading from S3

Copy link
Contributor Author

@cshold cshold Nov 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrote this before we decided on having the src files on S3 as well. Will update. @stevebosworth, what's the install path from S3? Download a zip, uncompress, navigate to it in terminal, then npm install?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the install path is entirely through slate-cli now. You can download a .zip of the file through S3 that is just a built version of dist and does not contain any of the tools or a src folder.

slate-cli downloads a zipped version of our src folder and then builds the package.json for your new theme and runs npm install. Post release we discussed adding more customization options for builds from slate-cli

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The headings michael mentioned would be:

Using Slate-cli

and

Downloading from s3

* Rename `config-sample.yml` to `config.yml` and add your [private app credentials](https://help.shopify.com/api/guides/api-credentials#generate-private-app-credentials)
* From within your new project folder in your command line, use the tasks below to build, sync, and watch your local files

> [Node](https://nodejs.org/en/) v6.2.1+ is required to fully benefit from Slate. If you want the template files without the build tools, get the latest zip here (TO DO: link).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6.2.1 is pretty specific.

IIRC, @macdonaldr93 had commented on our google doc that supporting older versions would be pretty simple w/Babel.

Does v4+ make sense?


> [Node](https://nodejs.org/en/) v6.2.1+ is required to fully benefit from Slate. If you want the template files without the build tools, get the latest zip here (TO DO: link).

## Slate commands
Copy link
Contributor

@mcpatten mcpatten Nov 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, the content in this section presents better as a table, and should be consistent with the content on our github README.

---
layout: default
---
# Tasks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consistency. I'm not sure why we're re-writing all these explanations, given that we already wrote them a few months back and had them 👀 at by the documentation team.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: should this section be called "commands" since the focus here is on the Slate interface, and not the gulp implementation?

---
# Theme files

Slate is two separate parts. First, it's a barebones theme to develop your own styles and layouts on. Second, it's a toolkit of useful tasks to sync with your local files to your live store. [Learn more about the tasks here](/slate/tasks).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like larger context to Slate, which should probably live in the "getting started" section - as the bit about tasks is not relevant to this section of content.


All configuration files, layouts, and liquid templates required if you are submitting your theme to the Theme Store are included. See the [full guidelines for submission here](https://help.shopify.com/themes/development/theme-store-requirements?ref=slate-docs).

Standard liquid tags and logic that are likely to be used on a given template have been included with little to no markup, classes, or other code that you will need to strip out.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth spending some extra time on this particular point and calling it out with a level 3 heading.

(ie. context around the "barebones" nature of our templates -- WARNING: THIS PAGE LOOKS BROKEN, BUT IT'S NOT.)

@cshold cshold force-pushed the new-docs branch 7 times, most recently from 6da9b55 to d83a61b Compare November 8, 2016 16:00

## Getting started

> [Node](https://nodejs.org/en/) v5.3+ is required to fully benefit from Slate. If you want the template files without the build tools, [get the latest zip here](http://sdks.shopifycdn.com/slate/latest/theme.zip).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/nodejs/LTS#lts-schedule

AFAIK version 5 has no support schedule. Given version's 4 & 6 are currently in LTS, we should be targetting one of them for support (ideally 4 is supported, but 6+ is recommended).


> [Node](https://nodejs.org/en/) v5.3+ is required to fully benefit from Slate. If you want the template files without the build tools, [get the latest zip here](http://sdks.shopifycdn.com/slate/latest/theme.zip).

1. Install Slate with `npm install @shopify/slate --global`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm install -g @shopify/slate is more common (and terse) syntax.

Copy link
Contributor

@mcpatten mcpatten Nov 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it would also be good to mention the eaccesnote from here: https://github.com/Shopify/slate-cli#1-get-the-latest-version

Also just noticing that this set of instructions is very similar to, but divergent from the getting started instructions on the slate-cli readme.

Any reason for the discrepancy, or can we make these consistent?

* `slate start` — Runs build, deploy, then watch to get you developing on your shop quickly
* `slate zip` — Builds and compresses your `dist` to a zip for easy manual upload

> Learn more about [all commands and descriptions](/slate/commands/) or how to [deploy to multiple environments](/slate/commands/#syncing-commands).
Copy link
Contributor

@mcpatten mcpatten Nov 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be (/slate/commands/#sync-commands).

slate deploy [--options]
```

##### Options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this title is in the wrong place (should be below the next couple of paragraphs if I'm reading this correctly?)

layout: default
---

# What's included
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this should be a simple page with the first paragraph and 2 links.

Templates and configuration should be a separate section, along with commands. Both should be linked to from here -- or perhaps each is a sub page of "What's included" and appear as a level 2 item in the nav.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ LMK if that doesn't make sense, I can explain it better if it's not clear what I mean...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought of having all this (see image) on the same page is that it forces us to keep Slate minimal. If we see this page get longer, we know we're straying from our goals.
image

Thoughts @chrisberthe @stevebosworth @t-kelly @macdonaldr93

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I like it better as just the one pager. If we're going to add any complexity to slate, we'd be doing it through plugins and at that point we could have a new top level header "Plugins"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem here (sorry if it wasn't clear above) is that "What's included" is Scaffold & CLI - but your "whats included" section gets right into the scaffold in the same section, right after calling out the following (leading to some weirdness in the docs heirarchy):

Slate is two separate parts. First, it’s a barebones theme [theme scaffold] to develop your own styles and layouts on. Second, it’s a toolkit of useful commands to sync with your local files to your live store. Learn more about the commands here.

I'd suggest Templates & configuration / sections / sass / js & i11n are all part of a Theme Scaffold section, that lives at the same level as commands

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'd also suggest commands comes first in the list - as it's more terse and quicker to read through than the scaffold information).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, and agree with that explanation. Working on the update now

- featured-product
```

## Sass scaffolding and helpers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, should we be printing out the CSS directory structure here as well?

- Responsive helpers to show/hide content and align text based on breakpoint names. [Example]({{ '/css-examples/#visibility-per-breakpoint' | prepend: site.baseurl }})
- Prefixes. [Example]({{ '/css-examples/#' | prepend: site.baseurl }})
- Visually hide or show content for screen reader accessibility. [Example]({{ '/css-examples/#visually-hide' | prepend: site.baseurl }})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth having a subsection on extending slate SCSS / Adding your own SCSS.

I mostly mention this because (although it might seem straightforward to us) Filippo mentioned having issues getting foundation scss to run in Slate during his testing.


Performs a full deploy of your theme (see [slate deploy](#deploy)) and starts the watchers (see [slate watch](#watch)).

#### options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a level 5 heading


## Slate Commands
A full list of possible Slate commands can be found [here](https://github.com/Shopify/slate-cli#overview).
It allows you to sync local files with your live shop, deploy to multiple environment at the same time, and organize stylesheets and scripts in a flexible way.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...multiple environments...


Slate is a barebones starting point and command line tool for developing Shopify themes. It is designed to assist your development workflow and speed up the process of developing, testing, and deploying themes to Shopify stores.

It allows you to sync local files with your live shop, deploy to multiple environment at the same time, and organize stylesheets and scripts in a flexible way.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...multiple environments...

### Global
* `slate theme [name]` - Generate a theme with build tools
* `slate -h` - Options available in your current directory (differs if not in a theme)
* `slate -v` - See your current version of Slate and any dependencies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"See your current Slate version"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good with "See your currently installed version of Slate and dependencies" ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect.

* `slate deploy` — Builds your `dist` folder and replaces the theme set in config.yml
* `slate watch` — Listens for changes to your local source files and deploys them to your shop
* `slate start` — Runs build, deploy, then watch to get you developing on your shop quickly
* `slate zip` — Builds and compresses your `dist` to a zip for easy manual upload
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...to a zip file...


# What's included

Slate is two separate parts. First, it's a barebones theme to develop your own styles and layouts on. Second, it's a toolkit of useful commands to sync with your local files to your live store. [Learn more about the commands here](/slate/commands).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...sync your local files to...

sections/
- collection-list
- featured-collection
- featured-product
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍. Were these selected based on how common these templates typically are? These have been in the top 5 added sections types since we released the theme editor so this is great.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly. They're basic enough to show off what sections can do, and likely going to be added to all themes (at least the ones we release). Biggest thing here is getting the JS working for both product.liquid and featured-product.liquid

$breakpoint-has-widths: ($small, $medium-up);
```

Each column — or `.grid__item` — should be a direct child of a `.grid` container. Create the child element sizes with the format `breakpoint-name--one-tenth`. See the example below or look through `styles/global/grid.scss` for available sizes.
Copy link
Contributor

@bertiful bertiful Nov 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we specify to not mix grid/layout styling with content styling on the same element?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea good call. Will add a quick note about that at the end of this sentence


## Responsive tables

For proper accessibility, tabular data should be build as table. Tables are notoriously difficult to build responsively, and while there are a lot of ways to do it, Slate includes a basic approach of adding the column labels as data attributes. Test the demo below in mobile mode to see it in action.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...should be built as a table..."


### Visually hide

Sometimes it is necessary to visually hide content while keeping it accessible in the DOM. This is useful for hiding descriptive text for icons or form labels that you do not want shown. Screen readers, for example, do not read placeholder text on inputs as their label so need the `label` element.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...their label so the label element is required."

@@ -0,0 +1 @@
console.log('slate.js');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this?


## Getting started

> [Node](https://nodejs.org/en/) 4+ is supported, while 6+ is recommended to fully benefit from Slate. If you want the template files without the build tools, [get the latest zip here](http://sdks.shopifycdn.com/slate/latest/theme.zip).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cshold cshold force-pushed the new-docs branch 2 times, most recently from d85e738 to 2a04ccd Compare November 10, 2016 20:48
@mcpatten
Copy link
Contributor

mcpatten commented Nov 11, 2016

LGTM 🚀

@bertiful
Copy link
Contributor

🚢 :shipit:

## Slate commands

### Global
* `slate theme [name]` - Generate a theme with build tools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mentioning build tools seems confusing. "Generate a new blank theme" is a little more straight

slate theme [name]
```

Generate a theme with build tools. The name argument is required and you will be prompted to enter it if it's not provided.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mentioning build tools is a little confusing. "Generate a new blank theme. The name argument is required for the new theme directory."

@cshold cshold merged commit d595009 into master Nov 29, 2016
@cshold cshold deleted the new-docs branch November 29, 2016 18:03
@lock
Copy link

lock bot commented Oct 26, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants