question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Idea for neat external module names

See original GitHub issue

First of all, TypeDoc 0.2.3 works great with TypeScript 1.4! Very happy with that 😃

But, I do have a request. We use a lot of external modules. The names of these modules are currently automatically composed using the relative path of the module surrounded by double quotes. This composed name is then displayed in the generated documentation (title + TOC). The name is also used as file name for the page of the module. In this file name the invalid characters are replaced with an underscore. This results in a bit “ugly” file names for external modules. Module x is displayed as "x" in the documentation and the file name for the page shows _x_.html (see screenshot below). I understand this is done to avoid name conflicts with inline modules with the same name. Seems logical.

May I do the following proposal to streamline the module name and file name:

  1. Remove the double quote prefix and suffix out of the reflection name in the onBeginResolve function of the class DynamicModulePlugin;
  2. Split up the name and file name in 2 separate properties (currently reflection.name is used for both the display name and the file name). Add a specific property for controlling the file name, so there can be a difference in the display name and the file name;
  3. Prefix this file name property for external modules with something like module_. The module with name x will end up with the file name module_x.html.
  4. Add a new tag for the external module comment block (for example @module [name]) to allow a custom name override instead of the generated name based on the relative path. This allows neat module naming. If the @module tag is omitted the path name is used instead (just how it now works, but without the double quote prefix and suffix of course 😃).

Let me know what you think of this idea. I can help you with the implementation if you want/like. I also have another idea for a future release: Automatic inheritance diagram generation (using SVG). Doxygen has such a feature for C++ documentation. But a rather simple implementation should be possible in TypeDoc. Basically the class inheritance is already plotted in the “Hierarchy” block. So all the necessary data sits there… As you can see we embed manually drawn diagrams in the description markdown and it looks great. Automatic inheritance diagrams would be a very nice addition in my opinion!

typedoc-quotes-2

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:2
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
taoqfcommented, Nov 10, 2017

I came to a problem with the double quote, modules/*.html file generated will have a _ prefix, and I will get a 404 when I put these files on my website on github. It seems github will hide these files. Is there a way I could generate files without _?

1reaction
rbucktoncommented, Oct 8, 2018

Related to @taoqf’s comment, above: https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/

I had to customize my documentation build to add a .nojekyll file to the documentation output directory to get around this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

christopherthielen/typedoc-plugin-external-module-name
Create a file named .typedoc-plugin-external-module-name.js in the folder you launch typedoc from. Create a custom mapping function in that file and export ...
Read more >
Function External modules - developing node-red stream
Starting to think about making it easier to load external modules in the Function nodeBroadcasted live on Twitch -- Watch live at ...
Read more >
How do I use namespaces with TypeScript external modules?
The proper way to organize your code is to use separate directories in place of namespaces. Each class will be in it's own...
Read more >
Four Strategies for Organizing Code | by Martin Sandin | Medium
This article outlines four different strategies for organizing code: by component, by toolbox, by layer, and by kind. I think these four form...
Read more >
Modular Front-End Development & Design - Toptal
To build websites like Legos, you have to think of websites as a collection of independent modules. This article will help you do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found