Skip to content

Epyon616/pastie_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pastie Parser

Pastie parser is exactly what is says it parses links for Pasties (http://pastie.org) and Gists (http://gists.github.com) and displays them properly on your web page.

Installation

Nice and simple, in your Gemfile add:

gem 'pastie_parser'

Run the bundle command and you're good to go.

If you're using this gem outside of a rails application or are simply refusing to use Bundler do the following:

gem install pastie_parser

Usage

Once Pastie Parser is installed you'll want to get using it, well this couldn't be simpler just do the following in your code:

<%= raw(PastieParser::Parse.pastie_parser(@article.body)) %>

Now if you have a Pastie or Gist you would like to be displayed in your text simply add the url (from the address bar) to either the Pastie or the Gist (depending on which you prefer to use) to your text and they will magically appear on the page.

What should the URLS look like?

For pastie: http://pastie.org/3288805 For Gist: https://gist.github.com/706753

If when using this gem you find any problems please raise it as an issue on here so I can fix it.

Thanks.

About

A Simple parser for putting Pasties or Gists on the page

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages