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

Allow customization of JavascriptIndexPlugin #1953

Closed
GerkinDev opened this issue Jun 20, 2022 · 6 comments
Closed

Allow customization of JavascriptIndexPlugin #1953

GerkinDev opened this issue Jun 20, 2022 · 6 comments
Labels
enhancement Improved functionality good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged

Comments

@GerkinDev
Copy link

Search Terms

JavascriptIndexPlugin, search, weight, extension

Problem

I'm writing a plugin that alters some custom reflections in the javascript index. It needs to modify weight of custom reflections (which was implemented in a very recent release) and format the reflection name with a special pattern. Since I wasn't able to alter how reflections are gathered, I had to override the plugin entierly, which complexifies my workflow in order to always stay up to date with Typedoc.

Suggested Solution

Ideally, plugins should be able to alter what is iterated on here:

for (const reflection of event.project.getReflectionsByKind(
ReflectionKind.All
)) {

Maybe the JavascriptIndexPlugin could be converted to an event emitter we could hook events on.

@GerkinDev GerkinDev added the enhancement Improved functionality label Jun 20, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 20, 2022

It needs to modify weight of custom reflections

Can be achieved by setting reflection.relevanceBoost during Converter.EVENT_RESOLVE today

I'm okay with adding an event to Renderer for further modification of rows before building the index.

@Gerrit0 Gerrit0 added help wanted Contributions are especially encouraged good first issue Easier issue for first time contributors labels Jun 20, 2022
@GerkinDev
Copy link
Author

Yesterday when I checked, this new option was still undocumented

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 25, 2022

@GerkinDev
Copy link
Author

Well, in the original post, when I said that "it was recently implemented", I was talking about typedoc. Indeed, I'm overriding the JavascriptIndexPlugin, and I've seen those changes related to this feature. So I can now drop it from my plugin.
But the user documentation at http://typedoc.org/guides/options/ does not mention this new setting, and the options map api doc at http://typedoc.org/api/interfaces/TypeDocOptionMap.html#searchCategoryBoosts does not comment how this option behave nor its exact type. I still have to look at the source code to understand it. But that's an entierly different issue.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 25, 2022

User docs - true, there's a branch fixing it that'll be merged soon.

Options map API doc - true, and unless someone else puts a comment there, it won't. None of the other options discuss implementation details either as comments which aren't right next to the implementation are even more likely to become out of date than normal.

@Gerrit0 Gerrit0 closed this as completed in f172a24 Jul 2, 2022
@GerkinDev
Copy link
Author

Great! I'll test this in my next plugin version! Have an excellent weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

2 participants