Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 2
- Log:
Initial import of Instiki 0.11.0 sources from a downloaded Tarball.
Instiki is a Ruby On Rails based Wiki clone.
- Author:
- adh
- Date:
- Sat Jul 22 14:54:51 +0100 2006
- Size:
- 1626 Bytes
1 | $: << File.dirname(__FILE__) + "../../lib" |
2 | |
3 | require_dependency 'chunks/chunk' |
4 | |
5 | # The markup engines are Chunks that call the one of RedCloth |
6 | # or RDoc to convert text. This markup occurs when the chunk is required |
7 | # to mask itself. |
8 | module Engines |
9 | class AbstractEngine < Chunk::Abstract |
10 | |
11 | # Create a new chunk for the whole content and replace it with its mask. |
12 | def self.apply_to(content) |
13 | new_chunk = self.new(content) |
14 | content.replace(new_chunk.mask) |
15 | end |
16 | |
17 | private |
18 | |
19 | # Never create engines by constructor - use apply_to instead |
20 | def initialize(content) |
21 | @content = content |
22 | end |
23 | |
24 | end |
25 | |
26 | class Textile < AbstractEngine |
27 | def mask |
28 | require_dependency 'redcloth' |
29 | redcloth = RedCloth.new(@content, [:hard_breaks] + @content.options[:engine_opts]) |
30 | redcloth.filter_html = false |
31 | redcloth.no_span_caps = false |
32 | redcloth.to_html(:textile) |
33 | end |
34 | end |
35 | |
36 | class Markdown < AbstractEngine |
37 | def mask |
38 | require_dependency 'bluecloth_tweaked' |
39 | BlueCloth.new(@content, @content.options[:engine_opts]).to_html |
40 | end |
41 | end |
42 | |
43 | class Mixed < AbstractEngine |
44 | def mask |
45 | require_dependency 'redcloth' |
46 | redcloth = RedCloth.new(@content, @content.options[:engine_opts]) |
47 | redcloth.filter_html = false |
48 | redcloth.no_span_caps = false |
49 | redcloth.to_html |
50 | end |
51 | end |
52 | |
53 | class RDoc < AbstractEngine |
54 | def mask |
55 | require_dependency 'rdocsupport' |
56 | RDocSupport::RDocFormatter.new(@content).to_html |
57 | end |
58 | end |
59 | |
60 | MAP = { :textile => Textile, :markdown => Markdown, :mixed => Mixed, :rdoc => RDoc } |
61 | MAP.default = Textile |
62 | end |