GithubHelp home page GithubHelp logo

marciopocebon / superredcloth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skwp/superredcloth

0.0 0.0 0.0 587 KB

Clone of _why's superredcloth gem, which he stopped hosting

Home Page: http://redhanded.hobix.com/inspect/superredclothAsAChild.html

License: Other

Ruby 1.25% C 98.75%

superredcloth's Introduction

= RedCloth - Textile and Markdown Hybrid for Ruby

Homepage::  http://whytheluckystiff.net/ruby/redcloth/
Author::    why the lucky stiff (http://whytheluckystiff.net/)
Copyright:: (cc) 2004 why the lucky stiff (and his puppet organizations.)
License::   BSD

(see http://hobix.com/textile/ for a Textile Reference.)

Based on (and also inspired by) both:

PyTextile: http://diveintomark.org/projects/textile/textile.py.txt
Textism for PHP: http://www.textism.com/tools/textile/

= RedCloth

RedCloth is a Ruby library for converting Textile and/or Markdown
into HTML.  You can use either format, intermingled or separately.
You can also extend RedCloth to honor your own custom text stylings.

RedCloth users are encouraged to use Textile if they are generating
HTML and to use Markdown if others will be viewing the plain text.

== What is Textile?

Textile is a simple formatting style for text
documents, loosely based on some HTML conventions.

== Sample Textile Text

 h2. This is a title

 h3. This is a subhead

 This is a bit of paragraph.

 bq. This is a blockquote.

= Writing Textile

A Textile document consists of paragraphs.  Paragraphs
can be specially formatted by adding a small instruction
to the beginning of the paragraph.

 h[n].   Header of size [n].
 bq.     Blockquote.
 #       Numeric list.
 *       Bulleted list.

== Quick Phrase Modifiers

Quick phrase modifiers are also included, to allow formatting
of small portions of text within a paragraph.

 \_emphasis\_
 \_\_italicized\_\_
 \*strong\*
 \*\*bold\*\*
 ??citation??
 -deleted text-
 +inserted text+
 ^superscript^
 ~subscript~
 @code@
 %(classname)span%

 ==notextile== (leave text alone)

== Links

To make a hypertext link, put the link text in "quotation 
marks" followed immediately by a colon and the URL of the link.

Optional: text in (parentheses) following the link text, 
but before the closing quotation mark, will become a Title 
attribute for the link, visible as a tool tip when a cursor is above it.

Example:

 "This is a link (This is a title) ":http://www.textism.com

Will become:

 <a href="http://www.textism.com" title="This is a title">This is a link</a>

== Images

To insert an image, put the URL for the image inside exclamation marks.

Optional: text that immediately follows the URL in (parentheses) will 
be used as the Alt text for the image. Images on the web should always 
have descriptive Alt text for the benefit of readers using non-graphical 
browsers.

Optional: place a colon followed by a URL immediately after the 
closing ! to make the image into a link.

Example:

 !http://www.textism.com/common/textist.gif(Textist)!

Will become:

 <img src="http://www.textism.com/common/textist.gif" alt="Textist" />

With a link:

 !/common/textist.gif(Textist)!:http://textism.com

Will become:

 <a href="http://textism.com"><img src="/common/textist.gif" alt="Textist" /></a>

== Defining Acronyms

HTML allows authors to define acronyms via the tag. The definition appears as a 
tool tip when a cursor hovers over the acronym. A crucial aid to clear writing, 
this should be used at least once for each acronym in documents where they appear.

To quickly define an acronym in Textile, place the full text in (parentheses) 
immediately following the acronym.

Example:

 ACLU(American Civil Liberties Union)

Will become:

 <acronym title="American Civil Liberties Union">ACLU</acronym>

== Adding Tables

In Textile, simple tables can be added by seperating each column by
a pipe.

    |a|simple|table|row|
    |And|Another|table|row|

Attributes are defined by style definitions in parentheses.

    table(border:1px solid black).
    (background:#ddd;color:red). |{}| | | |

== Using RedCloth

RedCloth is simply an extension of the String class, which can handle
Textile formatting.  Use it like a String and output HTML with its
RedCloth#to_html method.

 doc = RedCloth.new "

 h2. Test document

 Just a simple test."

 puts doc.to_html

By default, RedCloth uses both Textile and Markdown formatting, with
Textile formatting taking precedence.  If you want to turn off Markdown
formatting, to boost speed and limit the processor:

 class RedCloth::Textile.new( str )

superredcloth's People

Contributors

skwp avatar

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.