Fixed rendering, added a Mixed option (Textile + Markdown), default is Textile-only
This commit is contained in:
parent
1c40b5e570
commit
b3aefba07a
|
@ -1,9 +1,8 @@
|
|||
* 0.10.0:
|
||||
Ported to ActionPack
|
||||
RedCloth 3.0.3
|
||||
BlueCloth is phased out
|
||||
Default markup remains Textile-only, but Markdown wikis now understand Textile
|
||||
syntax on the same page
|
||||
BlueCloth is phased out, Markdown is rendered by RedCloth
|
||||
Mix markup option understands both Textile and Markdown on the same page
|
||||
Instiki can serve static content (such as HTML or plain-text files) from ./public
|
||||
directory
|
||||
Much friendlier admin interface
|
||||
|
|
|
@ -27,11 +27,17 @@ module Engines
|
|||
|
||||
class Textile < AbstractEngine
|
||||
def mask
|
||||
RedCloth.new(@content, @content.options[:engine_opts]).to_html([:textile])
|
||||
RedCloth.new(@content, @content.options[:engine_opts]).to_html(:textile)
|
||||
end
|
||||
end
|
||||
|
||||
class Markdown < AbstractEngine
|
||||
def mask
|
||||
RedCloth.new(@content, @content.options[:engine_opts]).to_html(:markdown)
|
||||
end
|
||||
end
|
||||
|
||||
class Mixed < AbstractEngine
|
||||
def mask
|
||||
RedCloth.new(@content, @content.options[:engine_opts]).to_html
|
||||
end
|
||||
|
@ -43,6 +49,6 @@ module Engines
|
|||
end
|
||||
end
|
||||
|
||||
MAP = { :textile => Textile, :markdown => Markdown, :rdoc => RDoc }
|
||||
MAP = { :textile => Textile, :markdown => Markdown, :mixed => Mixed, :rdoc => RDoc, }
|
||||
MAP.default = Textile
|
||||
end
|
||||
|
|
|
@ -21,16 +21,16 @@
|
|||
<div class="inputBox, disableAutoComplete">
|
||||
Markup:
|
||||
<select name="markup">
|
||||
<%= html_options({"Textile" => :textile, "Markdown" => :markdown, "RDoc" => :rdoc },
|
||||
@web.markup) %>
|
||||
<%= html_options({'Textile' => :textile, 'Markdown' => :markdown, 'Mixed' => :mixed,
|
||||
'RDoc' => :rdoc }, @web.markup) %>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Color:
|
||||
<select name="color">
|
||||
<%= html_options({ "Green" => "008B26", "Purple" => "504685", "Red" => "DA0006",
|
||||
"Orange" => "FA6F00", "Grey" => "8BA2B0" }, @web.color) %>
|
||||
<%= html_options({ 'Green' => '008B26', 'Purple' => '504685', 'Red' => 'DA0006',
|
||||
'Orange' => 'FA6F00', 'Grey' => '8BA2B0' }, @web.color) %>
|
||||
</select>
|
||||
<br/>
|
||||
<p>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<div id="TextileHelp" style="float: right; width: 250px; margin-top: 5px">
|
||||
<h3>Markdown formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">advanced</a>)</h3>
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<h3>Markdown formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">advanced</a>)</h3>
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr><td>_your text_</td><td class="arrow">→</td><td><em>your text</em></td></tr>
|
||||
<tr><td>**your text**</td><td class="arrow">→</td><td><strong>your text</strong></td></tr>
|
||||
<tr><td>`my code`</td><td class="arrow">→</td><td><code>my code</code></td></tr>
|
||||
|
@ -10,7 +9,4 @@
|
|||
<tr><td>***</td><td class="arrow">→</td><td>Horizontal ruler</td></tr>
|
||||
<tr><td><http://url><br /><email@add.com></td><td class="arrow">→</td><td>Auto-linked</td></tr>
|
||||
<tr><td>![Alt text](URL)</td><td class="arrow">→</td><td>Image</td></tr>
|
||||
</table>
|
||||
|
||||
<%= render 'wiki_words_help' %>
|
||||
</div>
|
||||
</table>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<div id="TextileHelp" style="float: right; width: 250px; margin-top: 5px">
|
||||
<h3>RDoc formatting tips (<a target="_new" href="http://rdoc.sourceforge.net/doc/files/markup/simple_markup_rb.html">advanced</a>)</h3>
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<h3>RDoc formatting tips (<a target="_new" href="http://rdoc.sourceforge.net/doc/files/markup/simple_markup_rb.html">advanced</a>)</h3>
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr><td>_your text_</td><td class="arrow">→</td><td><em>your text</em></td></tr>
|
||||
<tr><td>*your text*</td><td class="arrow">→</td><td><strong>your text</strong></td></tr>
|
||||
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">→</td><td>• Bulleted list<br />• Second item</td></tr>
|
||||
|
@ -10,7 +9,4 @@
|
|||
<tr><td>[[URL linkname]]</td><td class="arrow">→</td><td><a href="URL">linkname</a></td></tr>
|
||||
<tr><td>http://url<br />mailto:e@add.com</td><td class="arrow">→</td><td>Auto-linked</td></tr>
|
||||
<tr><td>imageURL</td><td class="arrow">→</td><td>Image</td></tr>
|
||||
</table>
|
||||
|
||||
<%= render 'wiki_words_help' %>
|
||||
</div>
|
||||
</table>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<div id="TextileHelp" style="float: right; width: 250px; margin-top: 5px">
|
||||
<h3>Textile formatting tips (<a href="#" onClick="quickRedReference(); return false;">advanced</a>)</h3>
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<h3>Textile formatting tips (<a href="#" onClick="quickRedReference(); return false;">advanced</a>)</h3>
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr><td>_your text_</td><td class="arrow">→</td><td><em>your text</em></td></tr>
|
||||
<tr><td>*your text*</td><td class="arrow">→</td><td><strong>your text</strong></td></tr>
|
||||
<tr><td>%{color:red}hello%</td><td class="arrow">→</td><td><span style="color: red;">hello</span></td></tr>
|
||||
|
@ -10,10 +9,7 @@
|
|||
<tr><td>|a|table|row|<br />|b|table|row|</td><td class="arrow">→</td><td>Table</td></tr>
|
||||
<tr><td>http://url<br />email@address.com</td><td class="arrow">→</td><td>Auto-linked</td></tr>
|
||||
<tr><td>!imageURL!</td><td class="arrow">→</td><td>Image</td></tr>
|
||||
</table>
|
||||
|
||||
<%= render 'wiki_words_help' %>
|
||||
</div>
|
||||
</table>
|
||||
|
||||
<script language="JavaScript">
|
||||
function quickRedReference() {
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
|
||||
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
|
||||
|
||||
<%= render("#{@web.markup}_help") if @web %>
|
||||
<div id="MarkupHelp" style="float: right; width: 250px; margin-top: 5px">
|
||||
<%= render("#{@web.markup}_help") %>
|
||||
<%= render 'wiki_words_help' %>
|
||||
</div>
|
||||
|
||||
|
||||
<%= form_tag({ :action => 'save', :web => @web.address, :id => @page.name},
|
||||
{'id' => 'editForm', 'method' => 'post', 'onSubmit' => 'cleanAuthorName();'})
|
||||
|
|
Loading…
Reference in a new issue