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
Search boosts #1930
Search boosts #1930
Changes from 25 commits
2844af7
adb740e
6870ceb
5ec06bc
84ccef0
356ab3d
aa7483f
ca60240
d9a60fc
8d2a6e5
009a244
545fc88
6a41cee
ee9b66e
aa9a272
b68ede6
735ac30
9e9af66
8864deb
d0bdf5a
26d4a9a
f30213b
54abe77
3601b26
ae839ef
d6e5b18
09d7c26
7ca811b
45bf9da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import type { LogLevel } from "../loggers"; | |
import type { SortStrategy } from "../sort"; | ||
import { isAbsolute, join, resolve } from "path"; | ||
import type { EntryPointStrategy } from "../entry-point"; | ||
import type { ReflectionKind } from "../../models/reflections/kind"; | ||
import { ReflectionKind } from "../../models/reflections/kind"; | ||
|
||
export const EmitStrategy = { | ||
true: true, // Alias for both, for backwards compatibility until 0.23 | ||
|
@@ -50,6 +50,12 @@ export type TypeDocOptionValues = { | |
: TypeDocOptionMap[K][keyof TypeDocOptionMap[K]]; | ||
}; | ||
|
||
const Kinds = Object.values(ReflectionKind); | ||
export interface SearchConfig { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I'd like to split this up into a few options:
I think it makes sense to always give exact matches a large boost, probably needs experimentation to figure out what that should be. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (removed the numResults thing; we don't need it right now, and I don't want to needlessly prolong this review) |
||
searchGroupBoosts?: { [key: typeof Kinds[number]]: number }; | ||
searchCategoryBoosts?: { [key: string]: number }; | ||
} | ||
|
||
/** | ||
* Describes all TypeDoc options. Used internally to provide better types when fetching options. | ||
* External consumers should likely use {@link TypeDocOptions} instead. | ||
|
@@ -107,6 +113,8 @@ export interface TypeDocOptionMap { | |
version: boolean; | ||
showConfig: boolean; | ||
plugin: string[]; | ||
searchCategoryBoosts: unknown; | ||
searchGroupBoosts: unknown; | ||
logger: unknown; // string | Function | ||
logLevel: typeof LogLevel; | ||
markedOptions: unknown; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I'm lowercasing everything, but the actual kind is "Class". Any preference on casing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed all the
toLowerCase
stuff, so that the kind names align withrequiredToBeDocumented
. d6e5b18There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking of which, are you sure that
searchKindBoosts
wouldn't be a better name for this? You refer to "kind" in the description forrequiredToBeDocumented
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With 0.22, yes,
searchKindBoosts
does look like the better name - I'm looking ahead to 0.23 though, where TypeDoc accepts an@group
tag. By default, groups are determined by kind, but this gives additional flexibility. I think I'm happy with this, just need to find the time to pull it down and play with it a bit :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okie-doke