Changeset 373
- Timestamp:
- 06/01/08 23:30:31 (3 months ago)
- Files:
-
- trunk/src/ingy/Vroom/Changes (modified) (1 diff)
- trunk/src/ingy/Vroom/Makefile.PL (modified) (1 diff)
- trunk/src/ingy/Vroom/README (modified) (5 diffs)
- trunk/src/ingy/Vroom/lib/Vroom/Vroom.pm (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/ingy/Vroom/Changes
r367 r373 1 --- 2 version: 0.13 3 date: Sun Jun 1 23:27:02 PDT 2008 4 changes: 5 - Support a .vroom/vimrc 6 - Don't overwrite a .vimrc not created by vroom 7 - Updated the docs 1 8 --- 2 9 version: 0.12 trunk/src/ingy/Vroom/Makefile.PL
r367 r373 7 7 requires 'YAML::XS'; 8 8 requires 'Class::Field'; 9 requires 'File::HomeDir'; 9 10 10 11 install_script 'vroom'; trunk/src/ingy/Vroom/README
r367 r373 3 3 4 4 SYNOPSIS 5 > mkdir MySlides # Make a Directory for Your Slides 6 > cd MySlides # Go In There 5 7 > vim slides.vroom # Write Some Slides 6 8 > vroom --vroom # Show Your Slides … … 20 22 exactly that. 21 23 22 Vroom creates a file called "./.vimrc" with many helpful key mappings 23 for navigating a slideshow. See "KEY MAPPINGS" below. Please note that 24 you will need the following line in your "$HOME/.vimrc" file in order to 25 pickup the local ".vimrc" file. 24 Vroom creates a file called "./.vimrc" with helpful key mappings for 25 navigating a slideshow. See "KEY MAPPINGS" below. 26 27 Please note that you will need the following line in your "$HOME/.vimrc" 28 file in order to pick up the local ".vimrc" file. 29 30 set exrc 26 31 27 32 Vroom takes advantage of Vim's syntax highlighting. It also lets you run … … 69 74 THE END 70 75 76 A line that starts with '==' is a header line. It will be centered. 77 78 Lines that begin with a '+' cause vroom to split the slide there, 79 causing an animation effect. 80 81 CONFIGURATION OPTIONS 82 Each slide can have one or more configuration options. Options are a 83 comma separated list that follow the '----' header for a slide. Like 84 this: 85 86 ---- center 87 ---- html 88 ---- perl,i20 89 ---- config 90 ---- skip 91 92 skip 93 Ignore the following slide completely. 94 95 center 96 Center the contents of the slide. 97 98 i## 'i' followed by a number means to indent the contents by the number 99 of characters. 100 101 perl,ruby,python,js,yaml,make,html 102 Specifies that the slide is one of those syntaxen, and that the 103 appropriate file extension will be used, thus causing vim to syntax 104 highlight the slide. 105 106 config 107 The slide is really a yaml configuration. It will not be displayed 108 in the presentation, but will tell vroom what to do from that point 109 forward. You can use more than one config slide in your 110 "slides.vroom" file. 111 112 You can specify the following confguration options in a config slide: 113 114 title <text> 115 The title of your presentation. 116 117 height <number> 118 The number of lines in the terminal you plan to use when presenting 119 the show. Used for centering the content. 120 121 width <number> 122 The number of columns in the terminal you plan to use when 123 presenting the show. Used for centering the content. 124 125 list_indent <number> 126 Auto detect slides that have lists in them, and indent them by the 127 specified number of columns. 128 71 129 KEY MAPPINGS 130 These are the standard key mappings specified in the local ".vimrc". 131 72 132 <SPACE> 73 133 Advance one slide. … … 79 139 80 140 <Q> Quit Vroom. 141 142 CUSTOM CONFIGURATION 143 You can create a file called ".vroom/vimrc" in your home directory. If 144 vroom sees this file, it will append it onto every local ".vimrc" file 145 it creates. 146 147 Use this file to specify your own custom vim settings for all your vroom 148 presentations. 81 149 82 150 NOTE … … 90 158 91 159 AUTHOR 92 Ingy d öt Net <ingy@cpan.org>160 Ingy döt Net <ingy@cpan.org> 93 161 94 162 COPYRIGHT 95 Copyright (c) 2008. Ingy d öt Net.163 Copyright (c) 2008. Ingy döt Net. 96 164 97 165 This program is free software; you can redistribute it and/or modify it trunk/src/ingy/Vroom/lib/Vroom/Vroom.pm
r368 r373 7 7 # use diagnostics; 8 8 9 our $VERSION = '0.1 2';9 our $VERSION = '0.13'; 10 10 11 11 use IO::All; … … 13 13 use Class::Field 'field', 'const'; 14 14 use Getopt::Long; 15 use File::HomeDir; 16 use Cwd; 15 17 use Carp; 16 18 … … 25 27 height => 24, 26 28 width => 80, 27 list_indent => 10, 28 skip => 0, 29 }; 29 list_indent => 10, skip => 0, }; 30 30 31 31 sub new { … … 38 38 $self->getOptions; 39 39 40 $self->cleanUp;40 unlink(glob "0*"); 41 41 return if $self->clean; 42 42 … … 48 48 sub getOptions { 49 49 my $self = shift; 50 51 die <<'...' if cwd eq File::HomeDir->my_home; 52 53 Don't run vroom in your home directory. 54 55 Create a new directory for your slides and run vroom from there. 56 ... 57 50 58 GetOptions( 51 59 "clean" => \$self->{clean}, … … 56 64 do { delete $self->{$_} unless defined $self->{$_} } 57 65 for qw(clean input vroom); 58 }59 60 sub cleanUp {61 unlink(glob "0*");62 unlink(".vimrc");63 66 } 64 67 … … 147 150 for my $option (split /\s*,\s*/, $string) { 148 151 $config->{$1} = 1 149 if $option =~ /^(config|skip|center|perl|yaml|make)$/; 152 if $option =~ /^( 153 config|skip|center| 154 perl|ruby|python|js| 155 yaml|make|html 156 )$/x; 150 157 $config->{indent} = $1 151 158 if $option =~ /i(\d+)/; … … 189 196 my $ext = 190 197 $config->{perl} ? ".pl" : 198 $config->{js} ? ".js" : 191 199 $config->{python} ? ".py" : 192 200 $config->{ruby} ? ".rb" : 201 $config->{html} ? ".html" : 193 202 $config->{shell} ? ".sh" : 194 203 $config->{yaml} ? ".yaml" : … … 223 232 sub writeVimrc { 224 233 my $self = shift; 234 235 my $home_vroom = File::HomeDir->my_home . "/.vroom/vimrc"; 236 my $home_vimrc = -e $home_vroom ? io($home_vroom)->all : ''; 237 238 die <<'...' 239 The .vimrc in your current directory does not look like vroom created it. 240 241 If you are sure it can be overwritten, please delete it yourself this one 242 time, and rerun vroom. You should not get this message again. 243 244 ... 245 if -e '.vimrc' and io('.vimrc')->getline !~ /Vroom-\d\.\d\d/; 246 225 247 my $title = "%f " . $self->config->{title}; 226 248 $title =~ s/\s/_/g; 227 249 io(".vimrc")->print(<<"..."); 250 " This .vimrc file was created by Vroom-$VERSION 228 251 map <SPACE> :n<CR>:<CR>gg 229 252 map <BACKSPACE> :N<CR>:<CR>gg … … 234 257 set laststatus=2 235 258 set statusline=$title 259 260 " Overrides from $home_vroom 261 $home_vimrc 236 262 ... 237 263 } … … 241 267 } 242 268 269 =encoding utf8 270 243 271 =head1 NAME 244 272 … … 247 275 =head1 SYNOPSIS 248 276 277 > mkdir MySlides # Make a Directory for Your Slides 278 > cd MySlides # Go In There 249 279 > vim slides.vroom # Write Some Slides 250 280 > vroom --vroom # Show Your Slides … … 326 356 THE END 327 357 358 A line that starts with '==' is a header line. It will be centered. 359 360 Lines that begin with a '+' cause vroom to split the slide there, 361 causing an animation effect. 362 363 =head1 CONFIGURATION OPTIONS 364 365 Each slide can have one or more configuration options. Options are 366 a comma separated list that follow the '----' header for a slide. 367 Like this: 368 369 ---- center 370 ---- html 371 ---- perl,i20 372 ---- config 373 ---- skip 374 375 =over 376 377 =item skip 378 379 Ignore the following slide completely. 380 381 =item center 382 383 Center the contents of the slide. 384 385 =item i## 386 387 'i' followed by a number means to indent the contents by the number of 388 characters. 389 390 =item perl,ruby,python,js,yaml,make,html 391 392 Specifies that the slide is one of those syntaxen, and that the 393 appropriate file extension will be used, thus causing vim to syntax 394 highlight the slide. 395 396 =item config 397 398 The slide is really a yaml configuration. It will not be displayed 399 in the presentation, but will tell vroom what to do from that point 400 forward. You can use more than one config slide in your 401 C<slides.vroom> file. 402 403 =back 404 405 You can specify the following confguration options in a config slide: 406 407 =over 408 409 =item title <text> 410 411 The title of your presentation. 412 413 =item height <number> 414 415 The number of lines in the terminal you plan to use when presenting the 416 show. Used for centering the content. 417 418 =item width <number> 419 420 The number of columns in the terminal you plan to use when presenting 421 the show. Used for centering the content. 422 423 =item list_indent <number> 424 425 Auto detect slides that have lists in them, and indent them by the 426 specified number of columns. 427 428 =back 429 328 430 =head1 KEY MAPPINGS 329 431 432 These are the standard key mappings specified in the local C<.vimrc>. 433 330 434 =over 331 435 … … 347 451 348 452 =back 453 454 =head1 CUSTOM CONFIGURATION 455 456 You can create a file called C<.vroom/vimrc> in your home directory. If 457 vroom sees this file, it will append it onto every local C<.vimrc> file 458 it creates. 459 460 Use this file to specify your own custom vim settings for all your vroom 461 presentations. 349 462 350 463 =head1 NOTE
