Module Hobix::BixWik
In: lib/hobix/bixwik.rb

Methods

Classes and Modules

Class Hobix::BixWik::Entry
Class Hobix::BixWik::IndexEntry
Class Hobix::BixWik::WikiRedCloth

Constants

QUICK_MENU = YAML::load <<-END --- %YAML:1.0 !omap - HomePage: [Home Page, H, Start Over] - list/index: [All Pages, A, Alphabetically sorted list of pages] - recent/index: [Recently Revised, U, Pages sorted by when they were last changed] - authors/index: [Authors, ~, Who wrote what] - FeedList: [Feed List, ~, Subscribe to changes by RSS] END

Public Class methods

[Source]

     # File lib/hobix/bixwik.rb, line 106
106:     def self.wiki_word( id )
107:         Hobix::BixWik::QUICK_MENU[ id ].to_a.first || id.gsub( /^\w|_\w|[A-Z]/ ) { |up| " #{up[-1, 1].upcase}" }.strip
108:     end

Public Instance methods

[Source]

    # File lib/hobix/bixwik.rb, line 89
89:     def abs_link( word )
90:         output_entry_map[word] && output_entry_map[word][:page].link
91:     end

[Source]

    # File lib/hobix/bixwik.rb, line 41
41:     def default_entry_class; "Hobix::BixWik::Entry"; end

[Source]

    # File lib/hobix/bixwik.rb, line 42
42:     def default_index_class; "Hobix::BixWik::IndexEntry"; end

Handler for templates with `index’ prefix. These pages simply mirror the `HomePage’ entry.

[Source]

    # File lib/hobix/bixwik.rb, line 46
46:     def skel_index( path_storage, section_path )
47:         homePage = path_storage.match( /^HomePage$/ ).first
48:         page = Page.new( 'index' )
49:         unless homePage
50:             homePage = Hobix::Storage::IndexEntry.new( path_storage.default_entry( authors.keys.first ) )
51:         end
52:         page.timestamp = homePage.created
53:         page.updated = homePage.created
54:         yield :page => page, :entry => homePage
55:     end

Handler for templates with `list/index’ prefix. These templates will receive a list of all pages in the Wiki.

[Source]

    # File lib/hobix/bixwik.rb, line 81
81:     def skel_list_index( path_storage, section_path )
82:         all_pages = storage.all
83:         page = Page.new( 'list/index' )
84:         page.timestamp = all_pages.first.created
85:         page.updated = storage.last_updated( all_pages )
86:         yield :page => page, :entries => all_pages, :no_load => true
87:     end

Handler for templates with `recent/index’ prefix. These templates will receive entries loaded by +Hobix::BaseStorage#lastn+. Only one index page is requested by this handler.

[Source]

    # File lib/hobix/bixwik.rb, line 71
71:     def skel_recent_index( path_storage, section_path )
72:         index_entries = storage.lastn( @lastn || 120 )
73:         page = Page.new( 'recent/index' )
74:         page.timestamp = index_entries.first.created
75:         page.updated = storage.last_updated( index_entries )
76:         yield :page => page, :entries => index_entries
77:     end

Handler for templates with `list/index’ prefix. These templates will receive IndexEntry objects for every entry in the system. Only one index page is requested by this handler.

[Source]

    # File lib/hobix/bixwik.rb, line 60
60:     def skel_recent_index( path_storage, section_path )
61:         index_entries = storage.find( :all => true )
62:         page = Page.new( 'list/index' )
63:         page.timestamp = index_entries.first.created
64:         page.updated = storage.last_updated( index_entries )
65:         yield :page => page, :entries => index_entries
66:     end

[Source]

     # File lib/hobix/bixwik.rb, line 97
 97:     def wiki_link( word )
 98:         abs_link = output_entry_map[word]
 99:         if abs_link
100:             "<a class=\"existingWikiWord\" href=\"#{ expand_path( abs_link[:page].link ) }\">#{ Hobix::BixWik::wiki_word word }</a>"
101:         else
102:             "<span class=\"newWikiWord\">#{ Hobix::BixWik::wiki_word word }<a href=\"#{ expand_path( "control/edit/#{ word }" ) }\">?</a></span>"
103:         end
104:     end

[Source]

    # File lib/hobix/bixwik.rb, line 93
93:     def wiki_page( src )
94:         src.gsub( /\b([A-Z][a-z]+[A-Z][\w\/]+)\b/ ) { wiki_link( $1 ) }
95:     end

[Validate]