Skip to content

Commit

Permalink
Create borders around markdown-tables
Browse files Browse the repository at this point in the history
Closes bootprint-openapi#52
- Marked is now configured so that tables are rendered with the classes
  "table table-bordered" to make them look more like the swagger-editor
  • Loading branch information
Nils Knappmeier committed Feb 10, 2016
1 parent ff51859 commit 0fb4577
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/table-in-description/swagger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: '2.0'
info:
title: Test
description: |
| A | B |
| --------- | ---------- |
| someKey | SomeValue |
version: "1.0.0"
# the domain of the service
host: api.uber.com
# array of all schemes that your API supports
schemes:
- https
# will be prefixed to all paths
basePath: /v1
produces:
- application/json
paths: []
23 changes: 23 additions & 0 deletions test/table-in-description/table-in-description-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*!
* bootprint-swagger <https://github.com/nknapp/bootprint-swagger>
*
* Copyright (c) 2015 Nils Knappmeier.
* Released under the MIT license.
*/

/* global describe */
/* global it */
/* global before */
var expect = require('chai').expect
var core = require('../core')

describe('The response-examples fixture', function () {
this.timeout(10000)
var context = {}
before(function () {
return core.run(require.resolve('./swagger.yaml'), __dirname, context)
})
it('should render tables inside markdown with borders', function () {
expect(context.$('table').first().attr('class')).to.equal('table table-bordered')
})
})

0 comments on commit 0fb4577

Please sign in to comment.