Changeset 1b5eb968d2c4
- Timestamp:
- 10/29/09 15:27:35 (3 years ago)
- Branch:
- default
- Files:
-
- 7 edited
-
Apache/OTL.pm (modified) (9 diffs)
-
README (modified) (1 diff)
-
javascript/jquery.js (modified) (1 diff)
-
sample.otl (modified) (1 diff)
-
styles/theme1.css (modified) (1 diff)
-
styles/theme2.css (modified) (1 diff)
-
styles/theme3.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Apache/OTL.pm
r1 r3 2 2 # VimOutliner (OTL) XHTML pretty printer for mod_perl2/apache2. 3 3 # 4 # Copyright (c) 2006 , Mahlon E. Smith <mahlon@martini.nu>4 # Copyright (c) 2006-2009, Mahlon E. Smith <mahlon@martini.nu> 5 5 # All rights reserved. 6 6 # Redistribution and use in source and binary forms, with or without … … 41 41 sub handler 42 42 { 43 my $VERSION = '0. 5';43 my $VERSION = '0.6'; 44 44 my $ID = '$Id$'; 45 45 my $r = shift; … … 71 71 todo => qr/(\[_\]) /, 72 72 done => qr/(\[X\]) /, 73 comment => qr/^(?:\t+)?:(.+)/, 73 user => qr/^(?:\t+)?\<(.+)/, 74 user_wrap => qr/^(?:\t+)?\>(.+)/, 75 body_wrap => qr/^(?:\t+)?:(.+)/, 76 body => qr/^(?:\t+)?;(.+)/, 74 77 time => qr/(\d{2}:\d{2}:\d{2})/, 75 78 date => qr/(\d{2,4}-\d{2}-\d{2})/, … … 105 108 { 106 109 my $settings = shift @blocks; 107 if ($settings =~ $re{ comment}) {108 %opt = map { split /=/ } split /\s?:/, $ settings;110 if ($settings =~ $re{user}) { 111 %opt = map { split /=/ } split /\s?:/, $1; 109 112 } 110 113 … … 116 119 } 117 120 } 121 122 # Now that we have tried to detect settings, 123 # remove any level 0 blocks that are user data. 124 @blocks = grep { $_ !~ /^[\<\>]/ } @blocks; 118 125 119 126 # GET args override settings … … 134 141 generated by otl_handler $VERSION 135 142 Mahlon E. Smith <mahlon\@martini.nu> 136 http:// www.martini.nu/143 http://projects.martini.nu/apache-otl/ 137 144 138 145 Get VimOutliner at: http://www.vimoutliner.org/ … … 196 203 foreach my $block ( sort { sorter(\%opt, \%re) } @blocks ) { 197 204 # separate outline items 198 my @lines = grep { $_ !~ /$re{'hideline'}/ } split /\n/, $block; 205 my @lines; 206 foreach my $line ( split /\n/, $block ) { 207 push @lines, $line unless $line =~ $re{hideline} || 208 $line =~ $re{user} || $line =~ $re{user_wrap}; 209 } 210 199 211 my $data = []; 200 212 … … 202 214 my ( $subs, $comments, $subsubs ) = ( 0, 0, 0 ); 203 215 foreach ( @lines ) { 204 if (/$re{ comment}/) {216 if (/$re{body_wrap}/) { 205 217 $comments++; 206 218 } … … 246 258 247 259 my $li_class = '>'; 248 $li_class = ' class="todo">' if $line =~ s#$re{todo}##; 249 $li_class = ' class="done">' if $line =~ s#$re{done}##; 250 $li_class = ' class="comment">' if $line =~ s#$re{comment}#$1#; 260 $li_class = ' class="todo">' if $line =~ s#$re{todo}##; 261 $li_class = ' class="done">' if $line =~ s#$re{done}##; 262 $li_class = ' class="comment_pre">' if $line =~ s#$re{body}#$1#; 263 $li_class = ' class="comment">' if $line =~ s#$re{body_wrap}#$1#; 251 264 252 265 if ( $next_level == $level || $next_level == 0 ) { -
README
r1 r3 46 46 47 47 Settings for the otl_handler are stored on the first line of the otl 48 files themselves, prefixed by a colon. See the sample.otl for an 49 example settings line. All settings are entirely optional. 48 files themselves, prefixed by the 'user no wrap' character, '<'. See 49 the sample.otl for an example settings line. All settings are entirely 50 optional. 50 51 51 52 title -
javascript/jquery.js
r1 r3 7 7 * 8 8 * $Date: 2006-10-09 20:23:18 -0400 (Mon, 09 Oct 2006) $ 9 * $Rev : 413$9 * $Rev$ 10 10 */ 11 11 -
sample.otl
r1 r3 1 :title=Sample OTL list :counts=1 :timer=1 :style=styles/theme1.css :legend=1 :last_mod=11 <:title=Sample OTL list :counts=1 :timer=1 :style=styles/theme1.css :legend=1 :last_mod=1 2 2 3 3 : Theme examples: -
styles/theme1.css
r1 r3 36 36 margin-bottom: 5px; 37 37 font-family: sans; 38 } 39 40 .comment_pre 41 { 42 font-style: normal; 43 font-family: courier; 44 white-space: pre; 38 45 } 39 46 -
styles/theme2.css
r1 r3 132 132 } 133 133 134 .comment_pre 135 { 136 font-style: normal; 137 font-family: courier; 138 white-space: pre; 139 } 140 134 141 .comment:hover 135 142 { -
styles/theme3.css
r1 r3 89 89 } 90 90 91 #content .comment_pre 92 { 93 font-style: normal; 94 font-family: courier; 95 white-space: pre; 96 } 97 91 98 #content 92 99 {
Note: See TracChangeset
for help on using the changeset viewer.
