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

Create nodes to make speech output data queryable #5

Open flogy opened 4 years ago

flogy commented 4 years ago

It would be great to be able to query the generated speech output data, meaning:

In addition to better aligning with the way Gatsby is built, we would also no longer need to have two files in the public folder, one being the mp3 file and one being the JSON file containing the speech marks.

I have created the create-nodes branch to play around with this.

Unfortunately, I ran into some obstacles, as creating nodes seems to be not so easy from inside a sub-plugin. I opened up those two issues containing the detailed information:

This issue is therefore on hold until those issues are cleared and we have a stable way to create nodes.

flogy commented 4 years ago

Maybe we can implement it as a transformer plugin that transforms Mdx nodes to Polly nodes as used in https://github.com/flogy/gatsby-transformer-polly? Like that we must not parse the props of the <SpeechOutput> comonents in MDX but only get the id and query the rest using static queries where you could add query params for voiceId etc.