Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Commit

Permalink
Fix tables look
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojciech Możejko committed Oct 19, 2016
1 parent 362d831 commit ef33488
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/documentation/documentation.tag
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
{ documentation.title() }
</h2>

<raw html={ parse(documentation.content().value()) }>
</raw>
<raw html={ parse(documentation.content().value()) } />
</div>

<div class="nine wide column third-column"></div>
Expand All @@ -18,9 +17,10 @@
const remark = require('remark')
const html = require('remark-html')
const hljs = require('remark-highlight.js')
const transformer = require('../../src/ast-transformer.js')

this.parse = function(text) {
let result = remark().use([ html, hljs ]).process(text)
let result = remark().use([ html, hljs, transformer ]).process(text)
return result.contents
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raml1-doc",
"version": "2.0.0",
"version": "2.0.1",
"description": "Generate HTML documentation using RAML",
"main": "index.js",
"scripts": {
Expand Down
15 changes: 15 additions & 0 deletions src/ast-transformer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const visit = require('unist-util-visit')

var transformer = (ast, file) => {
visit(ast, 'table', function (node) {
node.data = {
hProperties: {
className: 'ui table'
}
}
})
}

module.exports = () => {
return transformer
}

0 comments on commit ef33488

Please sign in to comment.