forked from mozilla/sphinx-js
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I added hooks preConvert and postConvert. preCommit receives just the typedoc app and runs right after application bootstrap. (To run earlier I think you'd need to make an actual typedoc plugin). `postConvert` runs right at the end. I also added a map from typedoc reflections to the corresponding ir item that postConvert can look at. I also added an extra_data dictionary which we pass to Python so that implementations of these hooks can pass extra information to be handled on the Pythons side. (None of the Python-side hooks can use this info yet, it can only be used via a monkeypatch.) No test coverage for any of this...
- Loading branch information
Showing
8 changed files
with
51 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
import { ParameterReflection } from "typedoc"; | ||
import { | ||
Application, | ||
DeclarationReflection, | ||
ParameterReflection, | ||
ProjectReflection, | ||
} from "typedoc"; | ||
import { TopLevel } from "./ir.ts"; | ||
|
||
export type SphinxJsConfig = { | ||
shouldDestructureArg?: (p: ParameterReflection) => boolean; | ||
shouldDestructureArg?: (param: ParameterReflection) => boolean; | ||
preConvert?: (app: Application) => Promise<void>; | ||
postConvert?: ( | ||
app: Application, | ||
project: ProjectReflection, | ||
typedocToIRMap: ReadonlyMap<DeclarationReflection, TopLevel>, | ||
) => Promise<void>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
/** Declare some extra stuff we monkeypatch on to typedoc */ | ||
|
||
declare module "typedoc" { | ||
export interface TypeDocOptionMap { | ||
sphinxJsConfig: string; | ||
} | ||
export interface Application { | ||
extraData: { | ||
[key: string]: any; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters