From 258cae83dc1a03b6b878a7b4236c499288cd2624 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Mon, 8 Jul 2013 21:58:14 -0400 Subject: chore(ngdocs): replace showdown.js with marked.js --- docs/src/gen-docs.js | 3 +-- docs/src/ngdoc.js | 10 ++++++---- docs/src/templates/index.html | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'docs/src') diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 2e711ab3..10b01385 100755 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -83,8 +83,7 @@ function writeTheRest(writesFuture) { writesFuture.push(writer.copyDir('components/components-font-awesome/font', 'components/font-awesome/font')); writesFuture.push(writer.copyDir('components/bootstrap', 'components/bootstrap')); - writesFuture.push(writer.copy('node_modules/showdown/src/showdown.js', 'components/showdown.js')); - writesFuture.push(writer.copy('node_modules/showdown/compressed/showdown.js', 'components/showdown.min.js')); + writesFuture.push(writer.copy('node_modules/marked/lib/marked.js', 'components/marked.js')); writesFuture.push(writer.copy('components/lunr.js/lunr.js', 'components/lunr.js')); writesFuture.push(writer.copy('components/lunr.js/lunr.min.js', 'components/lunr.min.js')); writesFuture.push(writer.copy('components/jquery/jquery.js', 'components/jquery.js')); diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 4ad478f4..394510c5 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -1,8 +1,6 @@ /** * All parsing/transformation code goes here. All code here should be sync to ease testing. */ - -var Showdown = require('showdown'); var DOM = require('./dom.js').DOM; var htmlEscape = require('./dom.js').htmlEscape; var Example = require('./example.js').Example; @@ -10,10 +8,14 @@ var NEW_LINE = /\n\r?/; var globalID = 0; var fs = require('fs'); var fspath = require('path'); -var markdown = new Showdown.converter({ extensions : ['table'] }); var shell = require('shelljs'); var gruntUtil = require('../../lib/grunt/utils.js'); var errorsJson; +var marked = require('marked'); +marked.setOptions({ + gfm: true, + tables: true +}); var lookupMinerrMsg = function (doc) { var code, namespace; @@ -289,7 +291,7 @@ Doc.prototype = { pageClassName = pageClassName || prepareClassName(this.name || 'docs') + suffix; text = '
' + - markdown.makeHtml(text) + + marked(text) + '
'; text = text.replace(/(?:

)?(REPLACEME\d+)(?:<\/p>)?/g, function(_, id) { return placeholderMap[id]; diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index 65e26c99..82a5c87e 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -47,7 +47,7 @@ addTag('script', {src: 'components/angular-bootstrap-prettify.js' }, sync); addTag('script', {src: 'components/google-code-prettify.js' }, sync); addTag('script', {src: 'components/' + (debug ? 'lunr.js' : 'lunr.min.js') }, sync); - addTag('script', {src: 'components/' + (debug ? 'showdown.js' : 'showdown.min.js') }, sync); + addTag('script', {src: 'components/marked.js' }, sync); addTag('script', {src: 'docs-data.js'}, sync); addTag('script', {src: 'js/docs.js'}, sync); -- cgit v1.2.3