krisztianb / typedoc-plugin-merge-modules

Plugin for TypeDoc that merges the content of modules
ISC License
22 stars 4 forks source link

merge things into the same file #12

Closed Zamiell closed 2 years ago

Zamiell commented 2 years ago

Hello, and thanks for updating this plugin to work with the latest TypeDoc!

Now, on to my issue. I was wondering if there could be a new option to merge things on to the same page.

For example, with the following typedoc.json:

{
    "$schema": "https://typedoc.org/schema.json",
    "entryPointStrategy": "Resolve",
    "entryPoints": [
        "./src/foo.ts",
        "./src/bar.ts"
    ]
}

And the following foo.ts:

export enum FooEnum {
  VALUE_1 = 0,
  VALUE_2 = 1,
}

export interface FooInterface {
  thing1: number;
  thing2: number;
}

And the following bar.ts:

// Same as "foo.ts", just different names.

export enum BarEnum {
  VALUE_1 = 0,
  VALUE_2 = 1,
}

export interface BarInterface {
  thing1: number;
  thing2: number;
}

Without any plugins, TypeDoc will generate docs that have FooEnum, FooInterface, BarEnum, and BarInterface all on separate HTML pages.

Instead, what I want is to have 2 HTML pages with 2 things each on them, because I have explicitly told TypeDoc to have 2 entry points.

(Essentially, this would allow people to document "chunks" or "features" of an app/library, and have everything concerning the feature be contained on a single HTML page.)

Is this possible?

krisztianb commented 2 years ago

Hi. This sounds a lot like #10 where somebody wanted to have the documentation details of several "things" in one file. Could you check if that is the same thing you are looking for?

Zamiell commented 2 years ago

Yes, it looks to be the same.

krisztianb commented 2 years ago

Well that is out of scope of this plugin as this one only merges module content and not HTML detail pages.

I don't know how familiar you are with how TypeDoc works. It basically does this:

  1. Scan code and create Reflection instances which are objects containing everything that should be documented.
  2. For every Reflection instance it generates a HTML file using a React "template".

So what you are looking for requires the direct manipulation/merging of the HTML files since you can't store the information of several "things" in one Reflection instance. Moreover I'm not sure if that would result in a reasonable output.

Zamiell commented 2 years ago

Ok, thanks, I'll close this issue.

Can I hire you to create typedoc-plugin-merge-pages? You can message me on Discord @ Zamiel#8743

krisztianb commented 2 years ago

I think you are better off merging the modules and leaving the detail pages as they are. Merging detail pages will most likely break the navigation and the search functionality of TypeDoc.