Hypergist
- Hypergist is a way to save and share code snippets. It has some components of Github Gists, some components of Codepen, and some additional features.
- Markdown is the base format. All gists are written in markdown. Hypergist can be used as a simple repository for your markdown.
- Each Hypergist can be given a "dominant language" label, to allow you to see at a glance what kind of content it's designed to hold. Currently the labels are: markdown, html, css, and javascript. These labels are primarily for informational purposes, with one exception.
CSS Hypergists & Bundles
- If your Hypergist is set as a "CSS Snack", we'll do some useful things behind the scenes.
- We'll extract any CSS code contained within it and create a css file that you can load from our CDN or use yourself.
- If it's part of a bundle, we will also create a css file for that bundle which includes the CSS for each snippet - this prevents you from having to load many standalone css files.
- To include css in the file, add a css code snippet in the markdown file that's of type CSS. You can do this with three backticks followed by "css"
```css
.my-class {
background: white
}
```
What's Built So Far
The platform is currently display-only i.e. not open for members of the public to submit gists. Members of the Tonic team can contribute with the following steps.
- Create a user record in the database. You'll now be able to browse to
/username
which will show a list of your collections and gists. - Sign in to the admin panel,
- Create a collection and assign it to your user record.
- Go to gists, click "New Gist" and create a gist. This will create the markdown file in this repository.
- Open the relevant markdown file in the repository on the VM.
- Make your changes and hit save.
- In order to re-generate the css file, you need to trigger a save on the object (not just by saving the file). Open a rails console and type
Gist.find(10).save
(replace 10 with the correct id).