styles/theme1.css
author Mahlon E. Smith <mahlon@martini.nu>
Thu, 29 Oct 2009 15:27:35 -0700
changeset 3 1b5eb968d2c4
parent 1 1ae1a79094fa
permissions -rw-r--r--
* Use a 'user block' character instead of a 'body block' for the settings line, as suggested by David J. Patrick <djp@linuxcaffe.ca>. * Ignore all user blocks (wrapped or otherwise.) * Display body (not wrapped) text as 'pre' in css. diff --git a/Apache/OTL.pm b/Apache/OTL.pm --- a/Apache/OTL.pm +++ b/Apache/OTL.pm @@ -1,7 +1,7 @@ # # VimOutliner (OTL) XHTML pretty printer for mod_perl2/apache2. # -# Copyright (c) 2006, Mahlon E. Smith <mahlon@martini.nu> +# Copyright (c) 2006-2009, Mahlon E. Smith <mahlon@martini.nu> # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -40,7 +40,7 @@ sub handler { - my $VERSION = '0.5'; + my $VERSION = '0.6'; my $ID = '$Id$'; my $r = shift; my $t0 = Time::HiRes::gettimeofday; @@ -70,7 +70,10 @@ percent => qr/(\[.\]) (\d+)%/, todo => qr/(\[_\]) /, done => qr/(\[X\]) /, - comment => qr/^(?:\t+)?:(.+)/, + user => qr/^(?:\t+)?\<(.+)/, + user_wrap => qr/^(?:\t+)?\>(.+)/, + body_wrap => qr/^(?:\t+)?:(.+)/, + body => qr/^(?:\t+)?;(.+)/, time => qr/(\d{2}:\d{2}:\d{2})/, date => qr/(\d{2,4}-\d{2}-\d{2})/, subitem => qr/^\t(?!\t)/, @@ -104,8 +107,8 @@ # get optional settings and otl title { my $settings = shift @blocks; - if ($settings =~ $re{comment}) { - %opt = map { split /=/ } split /\s?:/, $settings; + if ($settings =~ $re{user}) { + %opt = map { split /=/ } split /\s?:/, $1; } # if the first group wasn't a comment, @@ -116,6 +119,10 @@ } } + # Now that we have tried to detect settings, + # remove any level 0 blocks that are user data. + @blocks = grep { $_ !~ /^[\<\>]/ } @blocks; + # GET args override settings $opt{$_} = $get->{$_} foreach keys %$get; @@ -133,7 +140,7 @@ <!-- generated by otl_handler $VERSION Mahlon E. Smith <mahlon\@martini.nu> - http://www.martini.nu/ + http://projects.martini.nu/apache-otl/ Get VimOutliner at: http://www.vimoutliner.org/ --> @@ -195,13 +202,18 @@ foreach my $block ( sort { sorter(\%opt, \%re) } @blocks ) { # separate outline items - my @lines = grep { $_ !~ /$re{'hideline'}/ } split /\n/, $block; + my @lines; + foreach my $line ( split /\n/, $block ) { + push @lines, $line unless $line =~ $re{hideline} || + $line =~ $re{user} || $line =~ $re{user_wrap}; + } + my $data = []; # build structure and get item counts my ( $subs, $comments, $subsubs ) = ( 0, 0, 0 ); foreach ( @lines ) { - if (/$re{comment}/) { + if (/$re{body_wrap}/) { $comments++; } elsif (/$re{subitem}/) { @@ -245,9 +257,10 @@ } my $li_class = '>'; - $li_class = ' class="todo">' if $line =~ s#$re{todo}##; - $li_class = ' class="done">' if $line =~ s#$re{done}##; - $li_class = ' class="comment">' if $line =~ s#$re{comment}#$1#; + $li_class = ' class="todo">' if $line =~ s#$re{todo}##; + $li_class = ' class="done">' if $line =~ s#$re{done}##; + $li_class = ' class="comment_pre">' if $line =~ s#$re{body}#$1#; + $li_class = ' class="comment">' if $line =~ s#$re{body_wrap}#$1#; if ( $next_level == $level || $next_level == 0 ) { $r->print( "$in<li" . $li_class . "$line</li>\n" ); diff --git a/README b/README --- a/README +++ b/README @@ -45,8 +45,9 @@ --------------------------------------------------------------------- Settings for the otl_handler are stored on the first line of the otl -files themselves, prefixed by a colon. See the sample.otl for an -example settings line. All settings are entirely optional. +files themselves, prefixed by the 'user no wrap' character, '<'. See +the sample.otl for an example settings line. All settings are entirely +optional. title Type: string diff --git a/sample.otl b/sample.otl --- a/sample.otl +++ b/sample.otl @@ -1,4 +1,4 @@ -:title=Sample OTL list :counts=1 :timer=1 :style=styles/theme1.css :legend=1 :last_mod=1 +<:title=Sample OTL list :counts=1 :timer=1 :style=styles/theme1.css :legend=1 :last_mod=1 : Theme examples: : <a href="sample.otl">basic</a> <a href="sample.otl?counts=0&amp;style=styles/theme2.css&amp;legend=0&amp;js=/javascript/jquery.js,/javascript/theme2.js">advanced</a> <a href="sample.otl?counts=0&amp;style=styles/theme3.css&amp;legend=0&amp;timer=0&amp;js=/javascript/jquery.js,/javascript/theme3.js&amp;sort=1">advanced2</a> diff --git a/styles/theme1.css b/styles/theme1.css --- a/styles/theme1.css +++ b/styles/theme1.css @@ -37,6 +37,13 @@ font-family: sans; } +.comment_pre +{ + font-style: normal; + font-family: courier; + white-space: pre; +} + .counts { margin-left: 10px; diff --git a/styles/theme2.css b/styles/theme2.css --- a/styles/theme2.css +++ b/styles/theme2.css @@ -131,6 +131,13 @@ border-right: 1px solid #666; } +.comment_pre +{ + font-style: normal; + font-family: courier; + white-space: pre; +} + .comment:hover { border-top: 1px solid #aaa; diff --git a/styles/theme3.css b/styles/theme3.css --- a/styles/theme3.css +++ b/styles/theme3.css @@ -88,6 +88,13 @@ margin-bottom: 3px; } +#content .comment_pre +{ + font-style: normal; + font-family: courier; + white-space: pre; +} + #content { position: absolute;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     1
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     2
body
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     3
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     4
    width: 600px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     5
    font-size: 0.9em;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     6
    font-family: sans;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     7
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     8
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     9
ul
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    10
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    11
    list-style-type: none;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    12
    line-height: 1.5em;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    13
    padding-left: 20px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    14
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    15
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    16
.date
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    17
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    18
    font-size: 0.6em;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    19
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    20
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    21
.outline
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    22
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    23
    margin-bottom: 30px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    24
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    25
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    26
.percent
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    27
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    28
    color: blue;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    29
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    30
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    31
.comment, .counts
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    32
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    33
    font-size: 0.7em;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    34
    line-height: 1em;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    35
    padding-top: 2px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    36
    margin-bottom: 5px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    37
    font-family: sans;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    38
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    39
3
1b5eb968d2c4 * Use a 'user block' character instead of a 'body block' for the settings line,
Mahlon E. Smith <mahlon@martini.nu>
parents: 1
diff changeset
    40
.comment_pre
1b5eb968d2c4 * Use a 'user block' character instead of a 'body block' for the settings line,
Mahlon E. Smith <mahlon@martini.nu>
parents: 1
diff changeset
    41
{  
1b5eb968d2c4 * Use a 'user block' character instead of a 'body block' for the settings line,
Mahlon E. Smith <mahlon@martini.nu>
parents: 1
diff changeset
    42
    font-style: normal;
1b5eb968d2c4 * Use a 'user block' character instead of a 'body block' for the settings line,
Mahlon E. Smith <mahlon@martini.nu>
parents: 1
diff changeset
    43
    font-family: courier;
1b5eb968d2c4 * Use a 'user block' character instead of a 'body block' for the settings line,
Mahlon E. Smith <mahlon@martini.nu>
parents: 1
diff changeset
    44
    white-space: pre;
1b5eb968d2c4 * Use a 'user block' character instead of a 'body block' for the settings line,
Mahlon E. Smith <mahlon@martini.nu>
parents: 1
diff changeset
    45
}
1b5eb968d2c4 * Use a 'user block' character instead of a 'body block' for the settings line,
Mahlon E. Smith <mahlon@martini.nu>
parents: 1
diff changeset
    46
1
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    47
.counts
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    48
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    49
    margin-left: 10px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    50
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    51
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    52
.counts:before { content: "("; }
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    53
.counts:after  { content: ")"; }
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    54
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    55
.todo
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    56
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    57
    padding-left: 4px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    58
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    59
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    60
.done
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    61
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    62
    background-color: #f4f4f4;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    63
    color: #777;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    64
    padding-left: 4px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    65
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    66
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    67
.done:before
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    68
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    69
    font-size: 1.5em;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    70
    color: green;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    71
    content: "\2611  ";
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    72
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    73
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    74
.todo:before
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    75
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    76
    font-size: 1.5em;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    77
    color: #777;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    78
    content: "\2610  ";
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    79
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    80
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    81
.legend .todo, .legend .done { border: 0 }
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    82
.legend
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    83
{
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    84
    margin-bottom: 30px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    85
    margin-top: 20px;
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    86
}
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    87
1ae1a79094fa ModPerl2 update. This code was actually released (before it was in a
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    88