flogy / gatsby-mdx-tts

🗣 Adds speech output to your Gatsby site using Amazon Polly.
https://gatsby-mdx-tts.netlify.com
MIT License
10 stars 2 forks source link

Is the sub-plugin approach the right way to do it? #3

Closed flogy closed 4 years ago

flogy commented 4 years ago

Currently, this plugin is meant to be used as a sub-plugin for gatsby-plugin-mdx.

The idea behind this decision was:

What I think speaks against this approach:

Question to the experts: Are we on the right path with this approach? Or which approach would you suggest using? Maybe even a completely different one?

Thanks in advance.

flogy commented 4 years ago

I have now tried to get it running with the other approach using the onCreateNode method. I then discovered that the nodes created by gatsby-plugin-mdx do not contain the mdxAST. Therefore, I have created a PR to add that property to the nodes so we would be able to proceed with that approach if desired.

Link to the PR: https://github.com/gatsbyjs/gatsby/pull/21723

flogy commented 4 years ago

Unfortunately, the PR was rejected as the reason behind was not clear enough / the mdxAST can be accessed in other ways (e.g. how it is currently done in this plugin as well: by creating a sub-plugin for gatsby-plugin-mdx).

This means, we should probably stick to that approach and try getting it to work somehow. I will therefore close this issue.