Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 22:16
    Gerrit0 commented #1364
  • 21:59
    Gerrit0 commented #1408
  • 21:59

    Gerrit0 on library2

    fix: Correct handling of arrays… chore: Bump version to 0.20.0-b… (compare)

  • 20:00
    Gerrit0 commented #1410
  • 19:43
    Gerrit0 commented #1399
  • 18:38
    Gerrit0 labeled #1399
  • 18:38
    Gerrit0 unlabeled #1399
  • 18:15
    Gerrit0 commented #1407
  • 18:10
    Gerrit0 labeled #1407
  • 18:10
    Gerrit0 labeled #1407
  • 18:07
    Gerrit0 commented #1409
  • Dec 04 17:21
    marcofugaro commented #1402
  • Dec 04 17:13

    dependabot[bot] on npm_and_yarn

    chore(deps): bump highlight.js … (compare)

  • Dec 04 17:11
    dependabot[bot] opened #1411
  • Dec 04 17:11
    dependabot[bot] labeled #1411
  • Dec 04 17:08
    marcofugaro commented #1402
  • Dec 04 14:16
    mk010101 edited #1410
  • Dec 04 14:16
    mk010101 edited #1410
  • Dec 04 14:10
    mk010101 labeled #1410
  • Dec 04 14:10
    mk010101 opened #1410
Gerrit Birkeland
@Gerrit0
That makes sense to me, you can't do this:
class Nope {
  private foo(): void
  public foo(x?: string): void
}
Krisztián Balla
@krisztianb
I see. But shouldn't the flags be set in the two signatures? The first one having ["Private"] and the second one ["Public"]?
Gerrit Birkeland
@Gerrit0
That's a compiler error, all signatures need the same visibility flags
Krisztián Balla
@krisztianb
Sorry. I've read "can" instead of your "can't".
Ok, so the flags are only there once in the DeclarationReflection. Thanks.
Felix Palludan Hargreaves
@hejfelix
image.png
the linkcode tags don't seem to work?:
/**
 * Sequence `Parser<T>[]` into `Parser<T[]>` running each parser one after the other.
 * {@linkcode Foo} or [[`Foo`]]
 * @param parsers The parsers to sequence. All parsers must have a common supertype.
 */
looks like it simply doesn't understand type params:
/**
 * Sequence {@linkcode Parser}`<T>[]` into {@linkcode Parser}`<T[]>` running each parser one after the other.
 * @param parsers The parsers to sequence. All parsers must have a common supertype.
 */
this worked
Gerrit Birkeland
@Gerrit0
I would expect your first comment to work... that it doesn't looks like a bug to me, if you have something called Foo to link to. If you don't, then TypeDoc won't create a broken link.
yuzhidi
@yuzhidi

How to understand TemplateDelegate template with PageEvent?
renderer#rednerDocument call

    // Theme must be set as this is only called in render, and render ensures theme is set.
    page.template = page.template || this.theme!.resources.templates.getResource(page.templateName)!.getTemplate();
    page.contents = page.template(page, { allowProtoMethodsByDefault: true, allowProtoPropertiesByDefault: true });

handlebars show Handlebars.template with simple json data

var source = "<p>Hello, my name is {{name}}. I am from {{hometown}}. I have " +
"{{kids.length}} kids:</p>" +
"<ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>";
var template = Handlebars.compile(source):
var data = { "name": "Alan", "hometown": "Somewhere, TX",
"kids": [{"name": "Jimmy", "age": "12"}, {"name": "Sally", "age": "4"}]};
var result = template(data);
How to understand page.template(page, ...), param page is PageEvent, so complex!

Gerrit Birkeland
@Gerrit0
The whole templating system is really hard to follow. I think I only finally understood how it works last weekend. "How to understand" is unanswerable. Play with it and you'll discover things.
RoboZoom
@RoboZoom
Greetings all - anyone use typedoc with angular? Just tried experimenting with it today - it's useful, but my entire app is listed as a global... which is suboptimal
Krisztián Balla
@krisztianb

I can't compile my plugin using the latest master as I'm getting errors of this kind:

src/plugin_options.ts:381:40 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(declaration: { name: "includes" | "json" | "options" | "out" | "version" | "help" | "tsconfig" | "inputFiles" | "mode" | "includeDeclarations" | "entryPoint" | "exclude" | "externalPattern" | ... 25 more ... | "listInvalidSymbolLinks"; } & MixedDeclarationOption): void', gave the following error.
    Argument of type 'MapDeclarationOption<ClassDiagramType>' is not assignable to parameter of type '{ name: "includes" | "json" | "options" | "out" | "version" | "help" | "tsconfig" | "inputFiles" | "mode" | "includeDeclarations" | "entryPoint" | "exclude" | "externalPattern" | ... 25 more ... | "listInvalidSymbolLinks"; } & MixedDeclarationOption'.
      Type 'MapDeclarationOption<ClassDiagramType>' is not assignable to type '{ name: "includes" | "json" | "options" | "out" | "version" | "help" | "tsconfig" | "inputFiles" | "mode" | "includeDeclarations" | "entryPoint" | "exclude" | "externalPattern" | ... 25 more ... | "listInvalidSymbolLinks"; }'.
        Types of property 'name' are incompatible.
          Type 'string' is not assignable to type '"includes" | "json" | "options" | "out" | "version" | "help" | "tsconfig" | "inputFiles" | "mode" | "includeDeclarations" | "entryPoint" | "exclude" | "externalPattern" | "excludeExternals" | ... 24 more ... | "listInvalidSymbolLinks"'.
  Overload 2 of 2, '(declaration: never): void', gave the following error.
    Argument of type 'MapDeclarationOption<ClassDiagramType>' is not assignable to parameter of type 'never'.

381         typedoc.options.addDeclaration(this.classDiagramTypeOption as MapDeclarationOption<ClassDiagramType>);
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If I remember correctly @Gerrit0 once fixed a similar problem a couple of months ago.

The getValue method for instance has two overloads. One taking only specific strings values as an argument and the other having name: never.

src/plugin_options.ts:448:73 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(name: "includes" | "json" | "options" | "out" | "version" | "help" | "tsconfig" | "inputFiles" | "mode" | "includeDeclarations" | "entryPoint" | "exclude" | "externalPattern" | "excludeExternals" | ... 24 more ... | "listInvalidSymbolLinks"): unknown', gave the following error.
    Argument of type 'string' is not assignable to parameter of type '"includes" | "json" | "options" | "out" | "version" | "help" | "tsconfig" | "inputFiles" | "mode" | "includeDeclarations" | "entryPoint" | "exclude" | "externalPattern" | "excludeExternals" | ... 24 more ... | "listInvalidSymbolLinks"'.
  Overload 2 of 2, '(name: never): unknown', gave the following error.
    Argument of type 'string' is not assignable to parameter of type 'never'.

448         this.createVerboseOutputOption.value = typedoc.options.getValue(this.createVerboseOutputOption.name) as boolean;
                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gerrit Birkeland
@Gerrit0
Yes, because you are using master, that overload is disabled so that TypeDoc code can't use the less-safe version. You can run node scripts/set_strict.js false like the prepublish script does to disable that
Krisztián Balla
@krisztianb
I'll try that. Thank you.
Krisztián Balla
@krisztianb

Is there a way to use declaration files but not document the types contained in them?

For example: I created a React component like this:

/**
 * A React test component.
 */
export class TestComponent extends React.Component<string> {
    /** A dummy property. */
    public dummy: number;
}

Now I would like to create a documentation with typedoc that only contains this class. I used this command line to do so:

npx typedoc --out docs --mode file --includeDeclarations --excludeExternals test_component.tsx ./node_modules/@types/react/index.d.ts

But that generates the docs for the entire React lib too. If I omit ./node_modules/@types/react/index.d.ts the default value for the type parameters are not available in the ts.TypeParameterDeclaration instances.

Krisztián Balla
@krisztianb
@Gerrit0 have you thought about using a code formater like Prettier for the project?
Gerrit Birkeland
@Gerrit0
Declaration files - that seems odd... Possibly a bug? The compiler ought to include @types packages by default, even if td doesn't.
Prettier - Yes. I think it is a good idea, the library-mode branch uses it, but isn't done yet...
Jules Sam. Randolph
@jsamr
Hi folks,
First of all, I want to be grateful for the amazing work and energy put in this project. It is really super helpful! I am having a bit of a struggle with the tool: the distinction between how typedoc handles, on one hand, functions, type aliases and variables and on the other hand, classes, enums and interfaces seems arbitrary. Looks like it creates individual files for the later group, and flushes every other symbols in "globals" file. Is there any way I can change this behavior, and have let's say all symbols in one unique page?
Sebastian Boutin Blomfield
@sebovzeoueb
Hey, I'm not really sure if this is a bug or just outside of the scope, but I'm trying to use typedoc to generate documentation for a project written in plain JS using JSDoc comments, and it's actually working fairly decently, but I can't get --excludeNotExported to work. The reason I'm using typedoc instead of JSDoc is mostly because JSDoc doesn't support intersection types and importing typedefs.
so I'm getting this for example https://i.imgur.com/k5qCi8N.png
for this file
when I only really want it to document init
Jordan Sinko
@JordanSinko
Hey, is there support to have modules AND files? Eg.. I have a monorepo and are using https://github.com/christopherthielen/typedoc-plugin-external-module-name. It appears that I cannot have a combination of files and modules. I would like to have all the declaration/types/etc in Global at the same level as other modules. Similiar to https://typedoc.org/api/ but instead of "typescript" that would have a module in the repo.
image.png
I am grouping this under a "root" folder but preferably I would like the declaration under this folder at root alongside packages/*
Gerrit Birkeland
@Gerrit0
@sebovzeoueb JSDoc wasn't in the original scope, so there are a lot of holes in support... I do want to fully support it eventually though, and fix them when I have the time. I'm guessing the master branch doesn't have the --excludeNotExported fix I found for dealing with the TS compiler being weird about JS files... (Though it would also document DB since @typedef statements are implicitly exported)
@JordanSinko nope... not really. Since the external module name plugin completely overrides TypeDoc's module handling, if you need to use that it would have to be a request there.
Sebastian Boutin Blomfield
@sebovzeoueb
@Gerrit0 I figured this wasn't really supported, but it's good to know it's supposed to be at some point. I also noticed that typedef statements weren't being handled that well, I resorted to adding some types.d.ts files to my project and including declaration files
good to know there's a potential fix for the not exported thing, any idea when that goes live?
I think where I went wrong with my project was assuming that stuff that works for VSCode intellisense would also work for generating docs (spoiler, it doesn't)
every JS documentation tool seems to handle it a bit differently
Sebastian Boutin Blomfield
@sebovzeoueb
as far as I can tell there isn't really a good way in non ts code to export and import types and have them be picked up by JSDoc, which is what I was originally looking for
maybe I should just do what everyone else does and use TypeScript :D
Gerrit Birkeland
@Gerrit0
Yeah... documentation generation with useful output is hard. Even as the primary maintainer of TypeDoc right now, I fully admit it isn't great. I suspect I'll have a beta out this weekend (hopefully...) with that fix along with a bunch of other changes.
Jonas Nicklas
@jnicklas
I'm using typedoc 0.20.0-beta.8 and I'm struggling to make @category work. I've tried adding category tags, but it doesn't seem to change anything.
Is there some example somewhere that I could take a look at?
Gerrit Birkeland
@Gerrit0
It is entirely possible that I broke the category tag... Added to my list of things to check
We don't have a rendered test with the tag, which is something I should probably fix someday...
Krisztián Balla
@krisztianb
@Gerrit0 I saw that you added a lint script that runs Prettier and ESLint. In some of my projects I'm using Husky to prevent pushing code to the repo that doesn't satisfy the linter. What do you think about adding it to the typedoc repo too?
Gerrit Birkeland
@Gerrit0
Hmm... thats a tricky one. I don't particularly care for tools that make commands slower. Lint takes a few seconds to run, and it would be annoying to have to wait or remember to pass -n. It is CI's job to make sure code passes. I would be open to doing it for commit messages though. I've been trying to follow the conventional commit spec, but admitedly am not great at it.
irfan bilaloğlu
@irfan798
hey is there a way to start typedoc without plugins (without installing the plugin)
irfan bilaloğlu
@irfan798
typedoc --plugin none
Krisztián Balla
@krisztianb
While trying to implement #1395 I ran into a problem. Accessing the option here: https://github.com/krisztianb/typedoc/blob/a8ff6360bc1c6921a3dbb9ff6fb2dc80c129bac1/src/lib/output/plugins/MarkedPlugin.ts#L106 always returns undefined, but the option is specified in the typedoc.json file. Can anybody help me out there?
Krisztián Balla
@krisztianb
Nevermind, got it. I need to do the init of Marked later, since the options are not parsed when initialize is called.
Krisztián Balla
@krisztianb
Should we include an email address in one of the tests to check if mangling is disabled by default?
Gerrit Birkeland
@Gerrit0
Yep, that's a good idea