rtomayko / rocco

Rocco is Docco in Ruby
MIT License
404 stars 80 forks source link

Refactor: Extract code segmenting to it's own class #105

Open maxlinc opened 10 years ago

maxlinc commented 10 years ago

This is a possible answer for https://github.com/rtomayko/rocco/issues/104. Even if it's not the best solution, it should give you an idea of what I had in mind for #104.

This mostly moves the Rocco#parse method (and some related code) to a new class: Rocco::CodeSegmenter. This class does not do anything related to Markdown rendering, syntax highlighting, or writing HTML. So it would be easier to re-use this for other purposes, like the cases I described in #104.