ryanberckmans / mud-client

http://noric.org/play
1 stars 2 forks source link

ansi color render migration from mud-client.js to render.coffee #10

Closed ryanberckmans closed 10 years ago

ryanberckmans commented 10 years ago

Implementation plan, because I'm tired and not going to code it tonight.

  1. Parser grammars support an initializer, a block of javascript at the top of the parser: see http://pegjs.majda.cz/documentation
  2. initializer has access to options object. ie output_parser.parse( text, { ansiColorRenderer: foo } )
  3. move the render code in mud-client.js to a new AnsiColorRenderer object in render.coffee.
  4. renderDOMLine( rawLine, ansiColorRenderer) - perhaps client should be responsible for maintaining their own AnsiColorRenderer, or maybe it should be a singleton baked into render.coffee
  5. plug render.coffee into client.js, and remove all render code from mud-client.js
  6. ??
  7. profit
ryanberckmans commented 10 years ago

Done