jpedroschmitz / jpedroschmitz/rocketdocs

How to register components with the MDX renderer?

Open
#89 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: feature request
Dominant language
JavaScript
Stars
263
Forks
88
PR merge metrics
No merged PRs in 30d

Description

Description of issue

I want my MDX file to render a custom template component but it's not clear where I need to register it in order to make it available. Currently it says:

Component ADRList was not imported, exported, or provided by MDXProvider as global scope

Usage example

The project in question uses a multi-level structure which cannot (and should not) be represented through the sidebar.
Instead, I'd like to put documents into the directory and have the index file create a TOC for all other MDX files in the same directory. As such, I created a Gatsby template component that could be included in the MDX, but I don't know where to register it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the Gatsby template component and MDXProvider are configured, using the ADRList error and the MDX renderer as entry points. Document where custom components must be registered and how the multi-level directory use case should expose ADRList in an MDX file; done means a newcomer can follow the instructions without the import or provider error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.