New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pasta

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pasta

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Pasta

À la carte markdown parsing.

There's no such thing as markdown, only markdowns. Multi-Markdown, Github Flavoured, Pandoc, or Stack Overflow style...each implementation makes subtle changes to Gruber's original in order to better address the needs of their users.

It might be nice to have one true standard but that just ain't gonna happen. And it shouldn't. One of the great strengths of writing in plain text is that it can easily be adapted to specific needs through different flavours or dialects.

Pasta allows you to choose the flavour of markdown that best meets your needs, or to whip a new one up as needed.

Ingredients

  • 1 pasta gem
  • A handful of text
  • A sprig of file references

Directions

Ensure your pasta gem is ready to go with

$ gem install pasta

Then use Pasta as a tasty addition to your ruby code:

Pasta.prepare('a handful of text').with(:markdown).make(:html)

Alternatively, you can use Pasta as a binary:

$ pasta a-tasty-file.txt --recipe gruber

Recipes

Choose a recipe from the menu or make your own - extensibility is Pasta's raison d'être.

  • Gruber The original but rarely the best.
  • Markdown The default according to the http://www.w3.org/community/markdown/ spec

Works in Progress

  • Github Github flavoured markdown.
  • Latin Markdown for scholars.
  • Reveal Generate slide decks from markdown.

Rolling your own

Creating your own recipe for a markdown flavour is simple. First up, write a test suite for your recipe and add it to the specs directory. Use the yaml format like the others.

Next, extend Pasta::Recipe::Base and use the DSL to declare your recipe's grammar. For example:

grammar(:html) { [:headings, :paragraphs] }
grammar(:pdf)  { [:meta, :headings, :paragraphs] }

Each grammar rule creates a to_x method and invokes the code in Pasta::Ingredients of the same name. You can either create your own ingredients or use existing ones. Extensibility is the name of the game here.

Grammars are order sensitive and use a depth-first strategy allowing you to nest rules.

Finally, add your recipe to the Pasta::Menu so in order to create a delicious new Pasta::Dish.

FAQs

Package last updated on 28 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc