Fix broken markdown

This commit is contained in:
Brian Beck 2017-03-18 12:51:47 -07:00
parent d60a7eee0c
commit 593ac5a01f
4 changed files with 11928 additions and 11928 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,4 @@
{ {
"data": {
"__schema": { "__schema": {
"queryType": { "queryType": {
"name": "Query" "name": "Query"
@ -11226,5 +11225,4 @@
} }
] ]
} }
}
} }

View file

@ -3,7 +3,7 @@ import schema from '../src/schema'
if (process.argv[2] === '--json') { if (process.argv[2] === '--json') {
graphql(schema, introspectionQuery).then(result => { graphql(schema, introspectionQuery).then(result => {
console.log(JSON.stringify(result, null, 2)) console.log(JSON.stringify(result.data, null, 2))
}).catch(err => { }).catch(err => {
console.error(err) console.error(err)
}) })

View file

@ -1,5 +1,5 @@
import marked from 'marked' import marked from 'marked'
const schema = require('../schema.json').data.__schema const schema = require('../schema.json').__schema
// Ideally, we could just spit out the existing description Markdown everywhere // Ideally, we could just spit out the existing description Markdown everywhere
// and leave it to be rendered by whatever processes the output. But some // and leave it to be rendered by whatever processes the output. But some
@ -55,10 +55,12 @@ function renderObject (type, { skipTitle = false } = {}) {
console.log('</thead><tbody>') console.log('</thead><tbody>')
type.fields.forEach(field => { type.fields.forEach(field => {
console.log(' <tr>') console.log(' <tr>')
console.log(` <td colspan="2" valign="top"><strong>${field.name}</strong> ${field.isDeprecated ? '⚠️' : ''}</td>`) console.log(` <td colspan="2" valign="top"><strong>${field.name}</strong>${field.isDeprecated ? ' ⚠️' : ''}</td>`)
console.log(` <td valign="top">${markdown(renderType(field.type))}</td>`) console.log(` <td valign="top">${markdown(renderType(field.type))}</td>`)
console.log(` <td>`) console.log(` <td>`)
console.log(` ${markdown(field.description)}`) if (field.description) {
console.log(markdown(field.description))
}
if (field.isDeprecated) { if (field.isDeprecated) {
console.log(' <br/><br/><p>⚠️ <strong>DEPRECATED</strong></p>') console.log(' <br/><br/><p>⚠️ <strong>DEPRECATED</strong></p>')
console.log(` <blockquote>${markdown(field.deprecationReason)}</blockquote>`) console.log(` <blockquote>${markdown(field.deprecationReason)}</blockquote>`)
@ -135,7 +137,9 @@ enums.forEach(type => {
console.log(' <tr>') console.log(' <tr>')
console.log(` <td valign="top"><strong>${value.name}</strong>${value.isDeprecated ? ' ⚠️' : ''}</td>`) console.log(` <td valign="top"><strong>${value.name}</strong>${value.isDeprecated ? ' ⚠️' : ''}</td>`)
console.log(' <td>') console.log(' <td>')
console.log(` ${markdown(value.description)}`) if (value.description) {
console.log(markdown(value.description))
}
if (value.isDeprecated) { if (value.isDeprecated) {
console.log(' <br/><br/><p>⚠️ <strong>DEPRECATED</strong></p>') console.log(' <br/><br/><p>⚠️ <strong>DEPRECATED</strong></p>')
console.log(` <blockquote>${markdown(value.deprecationReason)}</blockquote>`) console.log(` <blockquote>${markdown(value.deprecationReason)}</blockquote>`)