Closed scallion5765 closed 3 weeks ago
I couldn't find a way to attach a file, so I'll just paste my first file (the GraphQL schema) here and leave it to you to generate the Markdown file and the HTML file (which are too long to paste here).
type Query {
mammals: [Mammal]
}
"""
*italic*
* list item 1
* list item 2
* list item 3
"""
type Dog {
legs: Int
}
"""
abcde
"""
type Seal {
fins: Int
}
union Mammal = Dog | Seal
It should include it verbatim, that part seems OK: in general the strategy is to leave the schema Markdown alone and let the Markdown renderer (whatever that ends up being) handle it.
But, Markdown renderers differ in when they actually start parsing Markdown within HTML (like the table and list items). GitHub Flavored Markdown wants blank lines in between any HTML tags and Markdown that should be rendered inside them. So my guess is we need to insert some newlines in there when outputting these descriptions.
my guess is we need to insert some newlines in there when outputting these descriptions.
That should work. It's similar to the workaround that I found, which is to put <!-- -->
and a newline at the top of the description of a type (for example, Dog
or Seal
in the previous comment) and a newline followed by <!-- -->
at the end of the description.
@scallion5765 I'll take a look when I get a chance later this week, add a test case or two and see if the newline solution works.
If a GraphQL schema defines a union,
graphql-markdown
renders a HTML table with a row for every type that belongs to the union. In each row, it puts the Markdown description for the type. However, it seem to include this description verbatim (without first rendering it into HTML), which causes problems.To illustrate, I am attaching 3 files:
graphql-markdown
6.0.0;The full command which produced files 2 and 3 is:
Here is a snippet from that last file:
There are 2 problems there:
</td>
tag.@nextdude, you implemented support for unions. Maybe you could take a look?