Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

updated Docco for the new Node 0.1.90

  • Loading branch information...
commit 5f7f25a447b72214c001652886cfba97dce71032 1 parent bf39b7b
Jeremy Ashkenas jashkenas authored

Showing 2 changed files with 9 additions and 6 deletions. Show diff stats Hide diff stats

  1. +2 0  Cakefile
  2. +7 6 docco.coffee
2  Cakefile
... ... @@ -1,3 +1,5 @@
  1 +exec: require('child_process').exec
  2 +
1 3 option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
2 4
3 5 task 'install', 'install the `docco` command into /usr/local (or --prefix)', (options) ->
13 docco.coffee
@@ -79,11 +79,11 @@ parse: (source, code) ->
79 79 # wherever our markers occur.
80 80 highlight: (source, sections, callback) ->
81 81 language: get_language source
82   - pygments: process.createChildProcess 'pygmentize', ['-l', language.name, '-f', 'html']
  82 + pygments: spawn 'pygmentize', ['-l', language.name, '-f', 'html']
83 83 output: ''
84   - pygments.addListener 'error', (error) ->
85   - process.stdio.writeError error if error
86   - pygments.addListener 'output', (result) ->
  84 + pygments.stderr.addListener 'data', (error) ->
  85 + puts error if error
  86 + pygments.stdout.addListener 'data', (result) ->
87 87 output += result if result
88 88 pygments.addListener 'exit', ->
89 89 output: output.replace(highlight_start, '').replace(highlight_end, '')
@@ -92,8 +92,8 @@ highlight: (source, sections, callback) ->
92 92 section.code_html: highlight_start + fragments[i] + highlight_end
93 93 section.docs_html: showdown.makeHtml section.docs_text
94 94 callback()
95   - pygments.write((section.code_text for section in sections).join(language.divider_text))
96   - pygments.close()
  95 + pygments.stdin.write((section.code_text for section in sections).join(language.divider_text))
  96 + pygments.stdin.end()
97 97
98 98 # Once all of the code is finished highlighting, we can generate the HTML file
99 99 # and write out the documentation. Pass the completed sections into the template
@@ -114,6 +114,7 @@ generate_html: (source, sections) ->
114 114 fs: require 'fs'
115 115 path: require 'path'
116 116 showdown: require('./vendor/showdown').Showdown
  117 +{spawn: spawn, exec: exec}: require('child_process')
117 118
118 119 # A list of the languages that Docco supports, mapping the file extension to
119 120 # the name of the Pygments lexer and the symbol that indicates a comment. To

0 comments on commit 5f7f25a

Please sign in to comment.
Something went wrong with that request. Please try again.