Skip to content

entry point restricting class member documentation #388

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

Closed
datamadic opened this issue Jan 18, 2017 · 5 comments
Closed

entry point restricting class member documentation #388

datamadic opened this issue Jan 18, 2017 · 5 comments

Comments

@datamadic
Copy link

I believe this is similar to both issue 186 and issue 172 but it may warrant a ticket itself.

My goal is to generate docs for a library with a single entry point that documents the public methods and properties (from the root's perspective) while excluding modules that may be used internally.

For example (in the snippet below) if Main is to be my entry point I would want thing1 in the Properties section of Main's generated documentation to be a link to the Thing1 class. This is the case if I generate the docs without the entryPoint flag. The issue is that the unwanted Thing2 is also documented (even with --excludePrivate it ends up in the Externals section). If I generate with with the entryPoint flag the Thing1 link in the Properties section just becomes a link back to the main page.

Is there some combo of flags / settings that I am overlooking that allows me to have docs generated from an entry point's perspective allowing links to properties without documenting all Externals? Apologies for taking your time if this is already possible!

An example repo

// main.ts
import Thing1 from "./thing1";
import Thing2 from "./thing2";

export default class Main {
    thing1: Thing1;

    constructor() {

        // used internally, no need to document this
        let other = new Thing2();

        // this is user facing, should be documented
        this.thing1 = new Thing1();
    }
}
// Thing1.ts
export default class Thing1 {
    pub() {
        console.log('thats public');
    }
    private prv() {
        console.log('thats private');
    }
}
// Thing2.ts
export default class Thing2 {
    fn() {
        console.log('so hidden');
    }
}
@aciccarello
Copy link
Collaborator

Would adding a comment with @hidden to the Thing2 class and using the --stripInternal flag help? (see #62, #104, #198, and #364 for some info since I'm not sure where it's documented)

/**
 * @hidden
 */
export default class Thing2 {
    fn() {
        console.log('so hidden');
    }
}

@datamadic
Copy link
Author

Thanks for following up!

After looking through the tickets and trying different combos of @hidden, @internal, and --stripInternal I have still not been able end up where the thing1 link works without the thing2 link showing up. I tried @hidden at both the module and instance level. It looks like the @hidden tag will keep thing2 from being in the content section but not the menu section (again, unless I have just not used the correct flag configurations...) For example:

screen shot 2017-01-19 at 2 21 30 pm

Notice that the content section is empty (the menu renders all the way to the left) Then when it correctly documents thing1 all is well:

screen shot 2017-01-19 at 2 21 55 pm

These particular screen shots were form docs generated with the following (though I tried many combos with internal and in the Main module as well):
typedoc --out docs-all src --readme none --mode modules --stripInternal --excludePrivate

/**
  * @hidden
  */
export default class Thing2 {

    /**
     * @hidden
     */
    fn() {
        console.log('so hidden');
    }
}

Is there perhaps something that I am missing?

Thanks again for taking a look!

@aciccarello
Copy link
Collaborator

Related to #250

@vekexasia
Copy link

would be nice to have such behavior :)

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 3, 2019

Closing in favor of #639

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

4 participants