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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choose what relationship between files dynamically #2

Open
HunteRoi opened this issue Jun 2, 2024 · 0 comments
Open

Choose what relationship between files dynamically #2

HunteRoi opened this issue Jun 2, 2024 · 0 comments

Comments

@HunteRoi
Copy link

HunteRoi commented Jun 2, 2024

Hey @Arsero !

I have been playing with your plugin and I find it quite useful! Although I think you might want to add a system for dynamic search of the relationships between files instead of manually setting them up.

I ended up with having a few proposals for you.

1st suggestion

Use the tags header information on each blog post/docs page to create the relationships between files (sources : https://docusaurus.io/docs/create-doc#doc-tags and https://docusaurus.io/docs/blog). I have a page to list tags I used on my website (available here) which means there might be an API available in docusaurus to have the list of tags for the website as well as parse them from any file.

2nd suggestion

Shift the plugin on a more open stance by allowing users to choose what kind of relationships they want based on functions you write and export from your own package.

Let me provide you with an example.

import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

import { basedOnTags, basedOnParentFolder, basedOnMentions } from 'docusaurus-graph';

const config: Config = {
   // ...
   plugins: [
       [
           "docusaurus-graph",
           {
               path: "docs",
               basedOn: basedOnParentFolder
           }
       ]
   ]
   // ...
};

export default config;

As you probably understand, you could expand it with default functions you provide but also allow other people to come up with their own relationships function!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant