Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including textile-js with all npm packages installed. Try it out:

var textileJs = require("textile-js")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

textile-js v2.0.4

A full-featured JavaScript Textile parser

h1. textile.js

Attempt at an implementation of fully featured Textile parser in JavaScript that runs reasonably fast and mostly avoids outputting broken HTML.

Give it a go in "a live textile web editor":

h2. Install

bc. $ npm install textile-js

h2. Options

The basic interface mimics "marked":, the popular markdown parser. So if you use that in your project then you can support Textile as well with minimal effort.

Currently, the only supported option is @breaks@ which can be used to enable/disable the default behavior of line-breaking single newlines within blocks.

h2. Usage

bc. console.log( textile( "I am using textile." ) );

You can also get to the syntax tree, which uses "JsonML":

bc. var jsonml = textile.parse( text ); console.log( jsonml );

h2. CLI

bc. $ textile -o hello.html hello world ^D $ cat hello.html

hello world

h2. License

Copyright (c) 2012, Borgar Þorsteinsson (MIT License).


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free