Code rippa

20
0r how I built my first ruby gem

description

Experiences in building my first gem - CodeRippa ! CodeRippa is a rubygem that takes a source code folder and converts it into a beautifully themed, syntax highlighted, bookmarked PDF.

Transcript of Code rippa

Page 1: Code rippa

0r how I built my first ruby gem

Page 2: Code rippa

How do you read <source code>

Offline? * * you do read source code, right ?

Page 3: Code rippa

Pop Quiz: How does Rails find_by_*

work? I didn't bother to find out! L

Page 4: Code rippa

Pop Quiz: How is it that

CoffeeScript is written in ... Coffeescript?

Short Answer: Boot strapping.

Page 5: Code rippa

{code} ↦ CodeRippa ↦ {PDF}  

" CodeRippa is my attempt to make source code reading a more pleasurable experience, and help programmers get better at their craft. " – Me.

What does it do?

Page 6: Code rippa

Features

Syntax Highlighting 1 $ code_rippa –nccoffeescripterlanghaskelljavajavascriptrubyprologpython$ code_rippa –n | wc –l 143

Page 7: Code rippa

Features

Themes! 2 $ code_rippa –nblackboardbrilliance_blackcobalthappy_happy_joy_joy_2ir_blackmade_of_codemonokairailscastssolarized_dark$ code_rippa –l | wc –l 84

Page 8: Code rippa

Features

Bookmarked PDF 3

Page 9: Code rippa

# syntax highlighting enginerequire ‘uv’# language detectionrequire ‘language_sniffer’

How it works

Page 10: Code rippa

# install texlive$ gem install code_rippa

Getting the goods.

Page 11: Code rippa

I I was only creating a  

Stuff I learnt along the way.

Page 12: Code rippa

$ code_rippa -h Usage: code_rippa [options] input_file_or_directory Parses input_file or directory and outputs a file named out.tex. Unless specified, 'Made of Code' is used as the default theme. To see all themes, type: code_rippa -l Examples: 1. code_rippa path_to_file.rb (uses default theme) 2. code_rippa -t rubyblue path_to_file.rb (with theme specified) 3. code_rippa -t rubyblue path_to_dir Then run `pdflatex -interaction=batchmode out.tex` to generate the PDF output. Options: -t, --theme THEME Selected theme -n, --list-syntax List all available syntax -l, --list-themes List all available themes -v, --version Display version number -h, --help Display this screen

Building a command line tool in Ruby.

Page 13: Code rippa

Best looking website I've made.

Page 14: Code rippa

Basic Insurance.

http://travis-ci.org/

Page 15: Code rippa

Minitest!

Page 16: Code rippa

Addiction.

Page 17: Code rippa

DEMO

Page 18: Code rippa

In the |-line

Drag source folder !here.!

Page 19: Code rippa

Anyone know how to build a LaTeX server?  

In the |-line

Page 20: Code rippa

/benjamintanweihao/code_rippa ben @ witsvale.com