microsoft / docusaurus-plugins

Plugins for Docusaurus and Rise4Fun
https://microsoft.github.io/docusaurus-plugins/
MIT License
12 stars 2 forks source link

Documentation point to wrong `npm` package #46

Open sharky98 opened 1 year ago

sharky98 commented 1 year ago

Hello, I wanted to try the plugin remark-plugin-import-file if it fit my use case. However, there seems to have a lot of discrepancies in this repository regarding this package. Probably due to the recent changes in namespace?

What is working

What is not aligned what is working

  1. README.md

  2. Documentation

  3. Documentation

Regards!

sharky98 commented 1 year ago

Adding a fourth issue.

  1. Documentation
// highlight-start
const importFile = require("@rise4fun/docusaurus-remark-plugin-import-file");
// highlight-end

module.exports = {
  presets: [
    [
      '@docusaurus/preset-classic',
      {
        docs: {
          remarkPlugins: [
          ...,
          // highlight-start
            importFile
          // highlight-end
          ],
        },
      },
    ],
  ],
};

If using only the docs plugin without the preset, it should looks like this.

// highlight-start
const importFile = require("@rise4fun/docusaurus-remark-plugin-import-file");
// highlight-end

module.exports = {
  plugins: [
    [
      '@docusaurus/plugin-content-docs',
      /** @type {import("@docusaurus/plugin-content-docs").Options} */
      ({
        ...,
        remarkPlugins: [
          ...,
          // highlight-start
            importFile
          // highlight-end
          ],
      }),
    ],
  ],
};
sharky98 commented 1 year ago

On a better note, once configured correctly, this plugin do works with my use case!!! 🎉🚀