-
Notifications
You must be signed in to change notification settings - Fork 712
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
Clearly indicate abstract classes #1874
Labels
enhancement
Improved functionality
good first issue
Easier issue for first time contributors
help wanted
Contributions are especially encouraged
Comments
Gerrit0
added
good first issue
Easier issue for first time contributors
help wanted
Contributions are especially encouraged
labels
Feb 27, 2022
const td = require("typedoc");
/** @param {td.Application} */
exports.load = function(app) {
app.converter.on(td.Converter.EVENT_RESOLVE, (context, reflection) => {
if (reflection.kindOf(td.ReflectionKind.Class) && reflection.flags.isAbstract) {
const ctor = reflection.getChildByName("constructor")
// could check reflection.sources to see if it is associated with any user written code
if (ctor) context.project.removeReflection(ctor);
}
})
} |
ejuda
added a commit
to ejuda/typedoc
that referenced
this issue
Apr 6, 2022
Reflections in TypeDoc can be assigned flags, describing certain properties of the reflection, e.g. abstract, private, readonly etc. These flags were rendered using badges for most type of reflections, but not for reflections which are displayed on their own page (like classes, interfaces etc.). This made it difficult to establish e.g. whether a class is abstract (see TypeStrong#1874). This PR fixes the issue by rendering flags in the page titles next to the name of the documented entity. Styling of the badges has been amended, to account for them now showing next to much bigger headings. The styling was inspired by [Bootstrap badges](https://getbootstrap.com/docs/4.0/components/badge/). Partially resolves TypeStrong#1874.
ejuda
added a commit
to ejuda/typedoc
that referenced
this issue
Apr 7, 2022
Reflections in TypeDoc can be assigned flags, describing certain properties of the reflection, e.g. abstract, private, readonly etc. These flags were rendered using badges for most type of reflections, but not for reflections which are displayed on their own page (like classes, interfaces etc.). This made it difficult to establish e.g. whether a class is abstract (see TypeStrong#1874). This PR fixes the issue by rendering flags in the page titles next to the name of the documented entity. Styling of the badges has been amended, to account for them now showing next to much bigger headings. The styling was inspired by [Bootstrap badges](https://getbootstrap.com/docs/4.0/components/badge/). Partially resolves TypeStrong#1874.
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
Search Terms
abstract, class, constructor
Problems
Consider the following class:
it does not provide any indication on whether the class itself is abstract:
This means that the users cannot easily establish whether the class they are looking at is abstract - they have to rely on abstract methods and properties being present.
Suggested Solutions
The text was updated successfully, but these errors were encountered: