From a9a259aa9d2a74a9d5d0c9ba3b0d70ef65225505 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Thu, 28 Jan 2016 15:03:16 +0200 Subject: [PATCH] Replace mtrc with mdast-react Still waiting for https://github.com/mapbox/remark-react/issues/14 to get highlighting back. Otherwise this should be a stabler alternative than mtrc as mdast-react is maintained actively. --- lib/render.jsx | 7 +++++-- package.json | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/render.jsx b/lib/render.jsx index 26dfaa4..db12260 100644 --- a/lib/render.jsx +++ b/lib/render.jsx @@ -3,7 +3,8 @@ import * as path from 'path'; import React from 'react'; import ReactDOM from 'react-dom/server'; -import MTRC from 'markdown-to-react-components'; +import remark from 'remark'; +import reactRenderer from 'remark-react'; export default function (rootPath, context, demoTemplate) { demoTemplate = demoTemplate || ''; @@ -17,7 +18,9 @@ export default function (rootPath, context, demoTemplate) { description: context.description, demonstration: demoTemplate, documentation: ReactDOM.renderToStaticMarkup( -
{MTRC(readme).tree}
+
+ {remark().use(reactRenderer).process(readme)} +
) }; } diff --git a/package.json b/package.json index 103ca03..58cbf8f 100644 --- a/package.json +++ b/package.json @@ -57,13 +57,14 @@ "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.23", "karma-webpack": "^1.7.0", - "markdown-to-react-components": "bebraw/markdown-to-react-components#highlight", "mocha": "^2.4.4", - "phantomjs-prebuilt": "^2.1.3", "phantomjs-polyfill": "0.0.1", + "phantomjs-prebuilt": "^2.1.3", "purecss": "^0.6.0", "react-addons-test-utils": "^0.14.6", "react-ghfork": "^0.3.2", + "remark": "^3.2.2", + "remark-react": "^1.1.0", "style-loader": "^0.13.0", "sync-exec": "^0.6.2", "system-bell-webpack-plugin": "^1.0.0",