Permalink
Browse files

Merge pull request #126 from justindujardin/highlight-docs

highlighting doc updates
  • Loading branch information...
justindujardin committed Oct 31, 2012
2 parents e3c71ae + 35b04b8 commit 0644918595463cfcaa7d188370f0292f40802319
Showing with 57 additions and 49 deletions.
  1. +9 −7 index.html
  2. +38 −35 lib/docco.js
  3. +10 −7 src/docco.coffee
View
@@ -2,7 +2,8 @@
documentation generator. It produces HTML
that displays your comments alongside your code. Comments are passed through
<a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a>, and code is
-passed through <a href="http://pygments.org/">Pygments</a> syntax highlighting.
+passed through <a href="http://pygments.org/">Pygments</a> syntax highlighting, if it
+is present on the system.
This page is the result of running Docco against its own source file.</p>
<p>If you install Docco, you can run it from the command-line:</p>
@@ -101,13 +102,14 @@ <h3>Main Documentation Generation Functions</h3>
<span class="nx">save</span> <span class="nx">docsText</span><span class="p">,</span> <span class="nx">codeText</span>
<span class="nx">sections</span></pre></div></div> </li> <li id="section-5"> <div class="annotation"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div>
-<p>Highlights a single chunk of CoffeeScript code, using <strong>Pygments</strong> over stdio,
-and runs the text of its corresponding comment through <strong>Markdown</strong>, using
-<a href="http://attacklab.net/showdown/">Showdown.js</a>.</p>
+<p>Highlights parsed sections of code, using <strong>Pygments</strong> over stdio,
+and runs the text of their corresponding comments through <strong>Markdown</strong>, using
+<a href="http://attacklab.net/showdown/">Showdown.js</a>. If Pygments is not present
+on the system, output the code in plain text.</p>
-<p>We process the entire file in single calls to Pygments and Showdown by inserting
-little marker comments between each section and then splitting the result string
-wherever our markers occur.</p>
+<p>We process all sections with single calls to Pygments and Showdown, by
+inserting marker comments between them, and then splitting the result
+string wherever the marker occurs.</p>
</div> <div class="content"><div class="highlight"><pre><span class="nv">highlight = </span><span class="nf">(source, sections, callback) -&gt;</span>
<span class="nv">language = </span><span class="nx">getLanguage</span> <span class="nx">source</span>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -2,7 +2,8 @@
# documentation generator. It produces HTML
# that displays your comments alongside your code. Comments are passed through
# [Markdown](http://daringfireball.net/projects/markdown/syntax), and code is
-# passed through [Pygments](http://pygments.org/) syntax highlighting.
+# passed through [Pygments](http://pygments.org/) syntax highlighting, if it
+# is present on the system.
# This page is the result of running Docco against its own source file.
#
# If you install Docco, you can run it from the command-line:
@@ -96,13 +97,15 @@ parse = (source, code) ->
save docsText, codeText
sections
-# Highlights a single chunk of CoffeeScript code, using **Pygments** over stdio,
-# and runs the text of its corresponding comment through **Markdown**, using
-# [Showdown.js](http://attacklab.net/showdown/).
+# Highlights parsed sections of code, using **Pygments** over stdio,
+# and runs the text of their corresponding comments through **Markdown**, using
+# [Showdown.js](http://attacklab.net/showdown/). If Pygments is not present
+# on the system, output the code in plain text.
#
-# We process the entire file in single calls to Pygments and Showdown by inserting
-# little marker comments between each section and then splitting the result string
-# wherever our markers occur.
+#
+# We process all sections with single calls to Pygments and Showdown, by
+# inserting marker comments between them, and then splitting the result
+# string wherever the marker occurs.
highlight = (source, sections, callback) ->
language = getLanguage source
pygments = spawn 'pygmentize', [

0 comments on commit 0644918

Please sign in to comment.