README
changeset 1 1ae1a79094fa
parent 0 868dae1581ff
child 3 1b5eb968d2c4
equal deleted inserted replaced
0:868dae1581ff 1:1ae1a79094fa
     1 ---------------------------------------------------------------------
     1 
     2                                                        WHAT IS THIS?
     2                                                        WHAT IS THIS?
     3 ---------------------------------------------------------------------
     3 ---------------------------------------------------------------------
     4 
     4 
     5 Vimoutliner already comes with some otl to HTML converters that work
     5 Vimoutliner already comes with some otl to HTML converters that work
     6 quite well.  I maintain a few different otl files, that are displayed
     6 quite well.  I maintain a few different otl files, that are displayed
    11 This mod_perl handler teaches apache how to pretty print otl natively.
    11 This mod_perl handler teaches apache how to pretty print otl natively.
    12 
    12 
    13 Now, I can just edit the otl files directly - skip the conversion step
    13 Now, I can just edit the otl files directly - skip the conversion step
    14 altogether, and let Apache make some delicious looking outlines.
    14 altogether, and let Apache make some delicious looking outlines.
    15 
    15 
    16 ---------------------------------------------------------------------
    16 
    17                                                         INSTALLATION
    17                                                         INSTALLATION
    18 ---------------------------------------------------------------------
    18 ---------------------------------------------------------------------
    19 
    19 
    20 First off all, make sure you have a mod_perl enabled Apache2.
    20 First of all, prerequisites!
    21 
    21 
    22 1) Add the following lines in your httpd.conf, or in a
    22     - apache2
    23    separate otl.conf in the apache Includes directory:
    23     - mod_perl2
       
    24     - libapreq2 (Apache2::Request)
       
    25 
       
    26 Add the following lines in your httpd.conf, or in a
       
    27 separate otl.conf in the apache Includes directory:
    24 
    28 
    25     -------------------------
    29     -------------------------
    26     PerlSwitches -I/path/to/perl/libraries
    30     PerlSwitches -I/path/to/perl/libraries
    27     PerlModule Apache::OTL
    31     PerlModule Apache::OTL
    28 
    32 
    30         SetHandler perl-script
    34         SetHandler perl-script
    31         PerlResponseHandler Apache::OTL
    35         PerlResponseHandler Apache::OTL
    32     </FilesMatch>
    36     </FilesMatch>
    33     -------------------------
    37     -------------------------
    34 
    38 
    35 2) Put the included css at /otl_style.css in your document root.
    39 Doublecheck that your apreq2 module is setup to load, as well.
       
    40 
       
    41 That's it.  Apache will now pretty-print all your otl files.
    36 
    42 
    37 
    43 
    38 That's it!  Apache will now pretty-print all your otl files.
       
    39 
       
    40 ---------------------------------------------------------------------
       
    41                                                             SETTINGS
    44                                                             SETTINGS
    42 ---------------------------------------------------------------------
    45 ---------------------------------------------------------------------
    43 
    46 
    44 Settings for the otl_handler are stored on the first line of the otl
    47 Settings for the otl_handler are stored on the first line of the otl
    45 files themselves, prefixed by a colon.  See the sample.otl for an
    48 files themselves, prefixed by a colon.  See the sample.otl for an
    53     If this is not set, the html title is derived from the filename.
    56     If this is not set, the html title is derived from the filename.
    54 
    57 
    55 
    58 
    56 style
    59 style
    57     Type: string
    60     Type: string
    58     Default: /otl_style.css
    61     Default: none
    59 
    62 
    60     A path to the css style.
    63     A path to css style(s).
       
    64     Comma separated values load different files in order.
       
    65     Media type defaults to 'screen', if the css name contains the
       
    66     string 'print' anywhere, the media type is changed to print.
    61 
    67 
       
    68     :style=/css/otl_style.css,/css/print_style.css
    62 
    69 
    63 js
    70 js
    64     Type: string
    71     Type: string
    65     Default: none
    72     Default: none
    66 
    73 
    67     Use javascript?  If set, loads an external javascript library,
    74     Use javascript?  If set, loads an external javascript library.
    68     and calls init_page() on body load.
    75     Comma separated values load diff files in order.
    69     See the example 'folding' javascript included.
       
    70 
    76 
    71 
    77 
    72 divs
    78 last_mod
    73     Type: boolean
    79     Type: boolean
    74     Default: 0
    80     Default: 0
    75 
    81 
    76     Wrap each outline group in a div class called "group"
    82     Show modification time of the otl file?
    77 
    83 
    78 
    84     
    79 dividers
       
    80     Type: boolean
       
    81     Default: 0
       
    82 
       
    83     Separate each outline group with a horizontal rule?
       
    84 
       
    85 
       
    86 legend
    85 legend
    87     Type: boolean
    86     Type: boolean
    88     Default: 0
    87     Default: 0
    89 
    88 
    90     Display small legend for todo and done items?
    89     Display small legend for todo and done items?
   125     Default: 0
   124     Default: 0
   126 
   125 
   127     Display how long the parser took to generate the html?
   126     Display how long the parser took to generate the html?
   128 
   127 
   129 
   128 
   130 ---------------------------------------------------------------------
   129 
   131                                                       INCLUDED FILES
   130                                                       INCLUDED FILES
   132 ---------------------------------------------------------------------
   131 ---------------------------------------------------------------------
   133 
   132 
   134 otl_handler.pl
   133 /Apache/OTL.pm
   135     The mod_perl code itself.
   134     The mod_perl content handler.
   136     Feel free to modify to taste.
       
   137 
   135 
   138 themes/*
   136 /javascript/*
   139     Example css.  Again, modify to taste!
   137     Example (but functional!) javascript.  Create line numbers,
       
   138     various eye candies, and clickable folds.
   140 
   139 
   141 otl.js
   140     This requires the 'jquery.js' library, also included.
   142     Example (but functional!) javascript.  If you use this
       
   143     file, your top level items will be 'clickable' - expanding
       
   144     the sub items underneath, but not initially showing them.
       
   145 
   141 
   146 sample.otl
   142 /sample.otl
   147     An example vimoutliner file, with optional settings.
   143     An example vimoutliner file, with optional settings.
   148 
   144 
       
   145 /styles/*
       
   146     "Theme" examples for customizing OTL display.
   149 
   147 
       
   148 
       
   149                                                     ACKNOWLEDGEMENTS
       
   150 ---------------------------------------------------------------------
       
   151 
       
   152 Thanks to Nathan Dabney <nathan.dabney@gmail.com> and
       
   153 Michael Granger <ged@faeriemud.org> for their help and advice!
       
   154