Graceful fallback to plaintext code when Pygments is missing #123

merged 4 commits into from Oct 30, 2012


None yet
2 participants

justindujardin commented Oct 30, 2012

The Problem
As a Docco user, I want to be able to produce non-highlighted documentation when Pygments is not available, rather than failing to produce any output whatsoever, and exiting the process with a failure code.

The Solution
When the Pygments output is not present, output escaped codeText for each section.

There are no direct unit tests for this functionality, but it is directly tested by my continuous integration build, on my fork of Docco, which does not have pygments available during the build tests.

This pull request has the side-effect of enabling, but does not include support for, continuous integration testing of Docco via travis-ci.


jashkenas commented Oct 30, 2012

Nice, but I don't think we need an error. If it's a feature that it can produce plaintext docs, let's just allow it to produce 'em ... and if you install pygments, they'll get highlights.


justindujardin commented Oct 30, 2012

Good call, done and done.

I had to no-op the error handlers, rather than remove them, so that node doesn't throw an error when pygments is missing.


justindujardin commented Oct 30, 2012

Note that Travis-CI reports this as breaking the build, because I don't have a checked in .travis.yml for this branch.

The master branch includes these changes and is currently :

Build Status

jashkenas merged commit 9fe9d5f into jashkenas:master Oct 30, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment