jeffrafter / gatsby-remark-tufte

Converts sidenotes and margin notes as well as figures to output for use with tufte-css using markdown.
MIT License
5 stars 3 forks source link

Error in usage along with gatsby-plugin-mdx #3

Open amas0 opened 3 years ago

amas0 commented 3 years ago

Hey,

First off, wanted to say cool project integrating this with the Gatsby ecosystem -- results look quite slick on your own site.

I've been working on a site that builds off of writing content in mdx files and processes them with gatsby-plugin-mdx. The plugin provides a gatsbyRemarkPlugins option to serve as a compatibility layer for traditional gatsby-remark-* plugins, see below:

// gatsby-config.js
module.exports = {
  plugins: [
    `gatsby-remark-images`,
    {
      resolve: `gatsby-plugin-mdx`,
      options: {
        gatsbyRemarkPlugins: [`gatsby-remark-tufte`],
      },
    },
  ],
}

My naive hope had been that your tufte plugin would work out of the box with this, but I get an error on build when trying to enable it. Error below:

/home/user/projects/blog/my-blog/src/posts/mypost/index.mdx: Unexpected token, expected "}" (138:78)

  136 | the average outcome. Sums of dice rolls rather quickly approach a `}<a parentName="p" 
{...{"href":"https://en.wikipedia.org/wiki/Normal_distribution"}}>{`normal distribution`}</a>{`

My guess is that the mdx parsing isn't quite compatible with whatever parsing happens in the underlying tufte-markdown, but that's just a guess. I do apologize as I'm rather far from my area of expertise, so I don't have much insight into cause or if it's simply user error. I figured I'd throw this issue up and see if you (or anyone else) had any thoughts.

jeffrafter commented 3 years ago

👋 I just saw this! I am not sure how this breaking exactly either. Do you happen to have a public version of this that I could try out? I might be able to figure it out.

amas0 commented 3 years ago

Thanks for the response, I don't have anything with it up at the moment -- if you can tell me what you need in an example to take a look, I can take a crack at setting something up :+1:

I'm by no means an expert on this ecosystem, just a user, so I'm probably ignorant of a number of relevant details.