diff --git a/docco.js b/docco.js index 68c94f17..daa16c49 100644 --- a/docco.js +++ b/docco.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.9.1 +// Generated by CoffeeScript 1.9.3 (function() { var Docco, _, buildMatchers, commander, configure, defaults, document, format, fs, getLanguage, highlightjs, languages, marked, parse, path, run, version, write, slice = [].slice; @@ -58,18 +58,20 @@ }; parse = function(source, code, config) { - var codeText, docsText, hasCode, i, isText, j, k, lang, len, len1, line, lines, match, maybeCode, save, sections; + var codeText, docsText, hasCode, i, isText, j, k, klass, lang, len, len1, line, lines, match, maybeCode, save, sections; if (config == null) { config = {}; } lines = code.split('\n'); sections = []; lang = getLanguage(source, config); + klass = lang.name; hasCode = docsText = codeText = ''; save = function() { sections.push({ docsText: docsText, - codeText: codeText + codeText: codeText, + klass: klass }); return hasCode = docsText = codeText = ''; }; diff --git a/docco.litcoffee b/docco.litcoffee index d15f3fa7..5bf4b4c2 100644 --- a/docco.litcoffee +++ b/docco.litcoffee @@ -116,10 +116,11 @@ individual **section** for it. Each section is an object with `docsText` and lines = code.split '\n' sections = [] lang = getLanguage source, config + klass = lang.name hasCode = docsText = codeText = '' save = -> - sections.push {docsText, codeText} + sections.push {docsText, codeText, klass} hasCode = docsText = codeText = '' Our quick-and-dirty implementation of the literate programming style. Simply diff --git a/resources/plain-markdown/docco.jst b/resources/plain-markdown/docco.jst index b13d1120..6341c008 100644 --- a/resources/plain-markdown/docco.jst +++ b/resources/plain-markdown/docco.jst @@ -6,7 +6,7 @@ <% if (!(/^\s*$/).test(section.codeText)) { %> -``` +``` {.<%= section.klass %>} <%= section.codeText %> ```