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:
- 1368 Bytes
1 | require 'chunks/wiki' |
2 | |
3 | # Includes the contents of another page for rendering. |
4 | # The include command looks like this: "[[!include PageName]]". |
5 | # It is a WikiReference since it refers to another page (PageName) |
6 | # and the wiki content using this command must be notified |
7 | # of changes to that page. |
8 | # If the included page could not be found, a warning is displayed. |
9 | |
10 | class Include < WikiChunk::WikiReference |
11 | |
12 | INCLUDE_PATTERN = /\[\[!include\s+(.*?)\]\]\s*/i |
13 | def self.pattern() INCLUDE_PATTERN end |
14 | |
15 | def initialize(match_data, content) |
16 | super |
17 | @page_name = match_data[1].strip |
18 | @unmask_text = get_unmask_text_avoiding_recursion_loops |
19 | end |
20 | |
21 | private |
22 | |
23 | def get_unmask_text_avoiding_recursion_loops |
24 | if refpage |
25 | # TODO This way of instantiating a renderer is ugly. |
26 | renderer = PageRenderer.new(refpage.current_revision) |
27 | if renderer.wiki_includes.include?(@content.page_name) |
28 | # this will break the recursion |
29 | @content.delete_chunk(self) |
30 | return "<em>Recursive include detected; #{@page_name} --> #{@content.page_name} " + |
31 | "--> #{@page_name}</em>\n" |
32 | else |
33 | included_content = renderer.display_content |
34 | @content.merge_chunks(included_content) |
35 | return included_content.pre_rendered |
36 | end |
37 | else |
38 | return "<em>Could not include #{@page_name}</em>\n" |
39 | end |
40 | end |
41 | |
42 | end |