typedoc2md/typedoc-plugin-markdown

Generates Filenames with special chars

Apollon77 opened this issue · 5 comments

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

I used the 4.0.1 on https://github.com/project-chip/matter.js with the updated config in project-chip/matter.js#875 and got this warning:

Some of the file names contain characters that are not allowed on Windows: 'TlvObject"'. If you commit, it might not be possible to check out the Git repository on Windows.

So it seems he used double quotes in a filename ... in fact I locally then found various files in a directory called " in the namespaces directory

find . -name '"*'
./docs/matter-node-ble.js/-internal-/namespaces/"
./docs/matter-node.js/exports/cluster/-internal-/namespaces/"
./docs/matter-node.js/exports/certificate/-internal-/namespaces/"
./docs/matter-node.js/exports/datatype/-internal-/namespaces/"
./docs/matter-node.js/exports/schema/-internal-/namespaces/"

After that also lookin in the error sof process if found eg

[warning] Failed to resolve link to "MatterSpecification.v10.Core" in comment for ."/Users/ingof/Dev/GitHub/official-matter.js/packages/matter.js/dist/esm/tlv/TlvObject".ObjectSchema.

Something is wrong here and he created a "full path" directory somehow.

The repo told above is a public one, so you can easiely test yourself

TypeDoc configuration

see project-chip/matter.js#875

basically:

"typedocOptions": {
"entryPoints": [...],
"plugin": ["typedoc-plugin-missing-exports", "typedoc-plugin-markdown"],
"excludeExternals": true,
"parametersFormat": "table",
"membersWithOwnFile": ["Class", "Enum", "Interface"],
"out": "..."
}

Expected behavior

No invalid paths/filenames are generated

Thanks.

So its included a fullpath in the name because the symbol represents a module that's been imported from the local file system. This is actually the typescript symbol name created when converting the project. Now there is a bug here (which will be fixed) but the fix will be to normalize the name so it doesn't try to create a weird file path.

If you don't want the fullpath in the module name what you can do is to override the module name as follows:

packages/matter.js/src/tlv/TlvObject.ts

Screenshot 2024-05-10 at 14 54 57

Hm ... Why this was no issue before 4.0? How to achieve the same result as in 3.x?

Hm ... Why this was no issue before 4.0? How to achieve the same result as in 3.x?

The module name is not a new issue (see output from v3). This is the resolved name from the ts compiler and also what you will see in the default html theme.

Screenshot 2024-05-10 at 16 50 45

As I say - there will be a fix to the file paths coming shortly.

Fix to file paths is available in typedoc-plugin-markdown@4.0.2. As previouslly mentioned the file path in the symbol name is not coming from this plugin.

Ok, thank you! I will verify soon