Not clear how to display markdown that is not coming from a file
See original GitHub issueI have a graphql API for a blog that contains fields that have formatting with markdown/mdx. I’d like to render that markdown using Gatsby. The docs of gatsby-transformer-markdown
only show how to do this when the markdown is coming from static files. However I’d like to know how to do this with plain strings in gatsby-node.js
and createPage
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:10 (9 by maintainers)
Top Results From Across the Web
View markdown files offline - github - Stack Overflow
I'm referring to showing the README.md file as it would come out in Github, and not as for editing purposes. Needs to work...
Read more >Basic Syntax - Markdown Guide
The Markdown elements outlined in the original design document. ... Not all elements can be used — you'll need to experiment to see...
Read more >15 Common Problems with rmarkdown (and some solutions)
15 Common Problems with rmarkdown (and some solutions) · 15.1 Avoiding problems · 15.2 The errors · 15.3 “Duplication”: Duplicated chunk names ·...
Read more >Readme markdown not rendering in Xcode - Apple Developer
In Xcode 11.1, I created a 'README.md' markdown file, but it always renders as its raw text (yet font size changes depending on...
Read more >Markdown editing with Visual Studio Code
Working with Markdown files in Visual Studio Code is simple, straightforward, ... A warning shown in the editor when linking to a file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jfrolich Yes, an alternative is to define custom resolvers for such fields (using createResolvers API) and parse markdown in those resolvers. In fact, our example for
gatsby-source-graphql
does something similar.See
post
field resolver for inspiration:https://github.com/gatsbyjs/gatsby/blob/f274630b7a2702b0687471fc8f6536a7bebb73c6/examples/using-gatsby-source-graphql/gatsby-node.js#L49-L55
Looks like this is resolved with help from @vladar and @LekoArts (thanks folks)
Let’s go ahead and close this. Thanks!