Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The remark config documentation misses some important information #8036

Open
nibble0101 opened this issue Apr 27, 2024 · 3 comments 路 May be fixed by nibble0101/astro#1
Open

The remark config documentation misses some important information #8036

nibble0101 opened this issue Apr 27, 2024 · 3 comments 路 May be fixed by nibble0101/astro#1
Labels
help wanted Issues looking for someone to run with them! improve documentation Enhance existing documentation (e.g. add an example, improve description)

Comments

@nibble0101
Copy link

馃搵 Explain your issue

I wanted to add the remarkToc plugin to my astro config as described in the documentation.

export default defineConfig({
  markdown: {
    remarkPlugins: [remarkToc],
  },
});

However, I wanted to customize the remarkToc plugin instead of using the defaults. This information is missing in the docs. I had to first look look up the RemarkPlugins type in the repo before figuring out how to pass in the config object like so:

export default defineConfig({
  markdown: {
    remarkPlugins: [[remarkToc, { ordered: true }]],
  },
});

I think it would be a good idea to explain the different ways of adding the plugins with custom config or linking to that explanation it if it has been explained somewhere else in the docs.

@TheOtterlord TheOtterlord added the improve documentation Enhance existing documentation (e.g. add an example, improve description) label Apr 27, 2024
@TheOtterlord
Copy link
Member

The markdown guide explains this (see Customizing a plugin. I did notice the reference is presented first in the search results, which I'm guessing is what lead you to reference? We could 100% look at adding a plugin with options or a link to the example.

@nibble0101
Copy link
Author

The markdown guide explains this (see Customizing a plugin. I did notice the reference is presented first in the search results, which I'm guessing is what lead you to reference? We could 100% look at adding a plugin with options or a link to the example.

Yes, I ended up in the reference via search. An example plugin with options or a link to the existing example will make things a lot easier.

@sarah11918
Copy link
Member

Interestingly when I searched, I did not get reference first but did get the upgrade guides first, then the Learn, and then reference!

What if we just update the example on the configuration reference page, which currently shows remarkToc anyway, and just add any old custom value, e.g. the one on the Markdown page:

remarkPlugins: [ [remarkToc, { heading: "contents"} ] ],

We try to keep the configuration page as concise as possible, but this at least is a visual clue to point people in the right direction without needing a ton of words to clutter the page.

Would be happy if someone would like to make a PR to that effect! The change to make would be on this line

@sarah11918 sarah11918 added the help wanted Issues looking for someone to run with them! label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues looking for someone to run with them! improve documentation Enhance existing documentation (e.g. add an example, improve description)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants