Giter VIP home page Giter VIP logo

potatochop's Introduction

Potatochop

A simple server for HAML & SASS mock ups

Build Status Gem Version

VersaHQ blog post on Potatochop

Installation

Install Potatochop as a gem in the usual way:

$ gem install potatochop

Usage

To use Potatochop, you also need a folder where you keep your mock ups. Ideally this folder would be under version control, but it is not required.

Once the Potatochop gem is installed, cd into your comps directory and run potatochop.

$ cd ~/mock_ups # or wherever you keep your mock_ups
$ potatochop

or pass in the path to your mock ups folder with the --mockups flag

$ potatochop --mockups ~/mock_ups

This will start up the Potatochop server on port 4567. By default, Potatochop will serve files in the same hierarchy as the mock ups folder.

For example, if you start Potatochop in a folder with a file called new_homepage.html.haml you can see it in your browser at http://localhost:4567/new_homepage.html

The Mock Ups folder

For lack of a better name, the folder where you store your haml, sass, js, etc. files is called the mock ups folder.

Out of the box, Potatochop processes and serves any haml or sass file in this folder. Vanilla HTML & JavaScript files are served directly. For example, your mock ups folder could be organized like this:

~/mock_ups
	about.html
	faq.html.haml
	index.html.haml
	css/
		about.css
		faq.css.scss
		index.css.scss
	js/
		interactions.js

ProTip: There is an example mock ups folder in the spec/fake_mockups folder (it's used by our automated tests).

When you want to include stylesheets in your haml/html pages, refer to them only by their .css extension. Using the above folder layout:

 # index.html.haml
 %link{ rel: 'stylesheet', href: 'css/index.css' }

Serving files from a GitHub repo

Let's say you have a repository on GitHub where you keep your mockups (i.e https://github.com/mertonium/potatochop_comps).

You can serve this repo by passing potatochop the --interface flag along with the repo path:

# Serve files from a public repository on GitHub
$ potatochop --interface github --repo mertonium/potatochop_comps

If your mock ups folder is in a private repo, you must also pass potatochop the --token flag, along with a personal access token:

# Serve files from a private repository on GitHub
$ potatochop --interface github --repo mertonium/potatochop_comps_private --token=GITHUB_ACCESS_TOKEN

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

potatochop's People

Contributors

mertonium avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

potatochop's Issues

Sass mixins aren't loading.

If I am in a folder called /home/foo and I want to start up Potatochop so it will serve the mockups in /home/bar/mockups I would use the command potatochop --mockups /home/bar/mockups.

The problem is that I get an error from Sass that my mixins can't be loaded. The message also tells me that Sass is looking in /home/foo (the place where I ran the potatochop executable, not where I'm serving the mocks).

If I cd into /home/bar/mockups and just run potatochop it works fine.

Command line arguments

I should be able to pass arguments via the command line to give Potatochop more information about how I want to serve my mockups and from where.

I see something like:

# Start the server, serve the files in the current folder
$ potatochop

# Pass in a specific mockups folder
$ potatochop --mockups path/to/local/mockups

# Serve files from a public repository on GitHub
$ potatochop --interface github --repo mertonium/potatochop_comps

# Serve files from a private repository on GitHub
$ potatochop --interface github --repo mertonium/potatochop_comps_private --token=GITHUB_ACCESS_TOKEN

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.