tisba / wikicloth Goto Github PK
View Code? Open in Web Editor NEWThis project forked from nricciar/wikicloth
Ruby implementation of the MediaWiki? markup language.
Home Page: http://code.google.com/p/wikicloth/
License: MIT License
This project forked from nricciar/wikicloth
Ruby implementation of the MediaWiki? markup language.
Home Page: http://code.google.com/p/wikicloth/
License: MIT License
Ruby implementation of the MediaWiki markup language. Supports --------------------------------------------------- * Variables, Templates {{ ... }} * Links o External Links [ ... ] o Internal Links, Images [[ ... ]] + (see also pipe trick) * Wikimedia Markup o == Headings == o Lists (*#;:) o bold ('''), italic ('') or both (''''') o Horizontal rule (----) o Tables o Table of Contents [__NOTOC__, __FORCETOC__, __TOC__] * <code>,<nowiki>,<pre> (disable wiki markup) o space at the beginning of a line (<pre>) * <ref> and <references/> support * html sanitization Install --------------------------------------------------- git clone git://github.com/nricciar/wikicloth.git cd wikicloth/ rake gem sudo gem install pkg/wikicloth-0.2.0.gem Usage --------------------------------------------------- @wiki = WikiCloth::Parser.new({ :data => "<nowiki>{{test}}</nowiki> ''Hello {{test}}!''\n", :params => { "test" => "World" } }) @wiki.to_html => "<p>{{test}} <i>Hello World!</i></p>" Advanced Usage --------------------------------------------------- Most features of WikiCloth can be overriden as needed... class WikiParser < WikiCloth::Parser url_for do |page| "javascript:alert('You clicked on: #{page}');" end link_attributes_for do |page| { :href => url_for(page) } end include_resource do |resource,options| case resource when "date" Time.now.to_s else params[resource] unless params[resource].nil? end end end @wiki = WikiParser.new({ :params => { "PAGENAME" => "Testing123" }, :data => "[[ Hello World ]] From {{ PAGENAME }} on {{ date }}\n" }) @wiki.to_html => <p> <a href="javascript:alert('You clicked on: Hello World');">Hello World</a> From Testing123 on Wed Jul 08 22:23:44 -0400 2009 </p>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.