Skip to content

Commit

Permalink
Replace mtrc with mdast-react
Browse files Browse the repository at this point in the history
Still waiting for remarkjs/remark-react#14 to
get highlighting back. Otherwise this should be a stabler alternative
than mtrc as mdast-react is maintained actively.
  • Loading branch information
bebraw committed Jan 28, 2016
1 parent 4024abd commit a9a259a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/render.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '';
Expand All @@ -17,7 +18,9 @@ export default function (rootPath, context, demoTemplate) {
description: context.description,
demonstration: demoTemplate,
documentation: ReactDOM.renderToStaticMarkup(
<div key="documentation">{MTRC(readme).tree}</div>
<div key="documentation">
{remark().use(reactRenderer).process(readme)}
</div>
)
};
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a9a259a

Please sign in to comment.