-
Notifications
You must be signed in to change notification settings - Fork 679
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
Is using a documentation generation library an anti-pattern? #2310
Comments
If your whole API fits into a single file, then sure, you don't need an auto documentation library. Such tools are for the projects on a completely different scale. Also, you can't have hyperlinks in |
Can I see some real world examples. I think a section should be added somewhere to inform people that they might not need typedoc. I think I had to re invent the wheel to understand that. |
Short answer: Longer answer:
Many of the best libraries I've used don't use a documentation generator, but they tend to have manually written documentation as a replacement. Personally, I've found documentation generators existing to be useful because they result in devs writing more documentation, even if I never visit the generated site. |
We can get the top level identifiers of the
The problem is that usually these declaration files have been automatically generated, hence not created with readability in mind, so people do not find them readable.
I have hard time to understand these people. One of the things that I do not like about documentation generations libraries is that the documentation that gets produced is not familiar. I find it really hard to read documentation that does not open in IDE or github.
There is no need for install. In github we can open files like they were in VSCode. Just add
I have the opposite experience for my personal projects that use Also I have found myself wasting a lot of time to make the documentation generation libraries behave they way I want them. This time could easily be used to improve Do you agree for a section to be added somewhere in typedoc documentation that informs people that they might not need any documentation generation library and instead use In the end I feel |
Can someone share a link to info on this |
Well I can. Just tell me what you want me to do:
|
I don't feel that it's the job of a tool to tell people not to use that tool, unless that tool has become obsolete with further additions to the environment. Just because it doesn't make sense to you, the number of people who do want a documentation site indicates that there is still a demand for this. |
I was thinking something along the lines of "you might not need redux" article created by the creator of redux. It will just inform people that they might not need typedoc.
There will always be demand for that. I am just saying that some (maybe most) of that demand is because people have not seen the alternative: |
How do you maintain your |
Can you be more specific. How is
What is the reasoning for that? |
Single-file entry points eventually become unmanageable for actual browsing, collapsible sections or no. This is why tools like Finding that tooling doesn't make sense on the scale of a personal project and concluding that there's no reason for it to exist is a very elementary (and common) programming mistake. |
Can I see a real world example where a documentation generation library made that manageable?
I do not understand what this has to do with our discussion?
Finding? You mean using? |
Take a look at the documentation for a large-scale project like React. |
Is this what you are talking about? |
No, I mean the API reference. |
That is not something big for I personally find it hard to read the documentation. Take for example /**
* @description
* Hook to be called inside a component to define its state.
*/
export declare const useState: <T>(
/**
* @description
* If creating the context parameter on each render is cpu expensive, then
* provide a function that returns it, which will be called only in the
* first render and never again.
*/
initialState : T | (() => T)
) => [
currentState : T,
/**
* @description
* Calling this, will trigger a re-render of the component, in which, the
* returned value of the context function, will be the state.
*/
setNewState : (currentState : T) => T
]; Which one do you find more readable? The ## Documentation
Take a look at `./publicApi.ts`.
## Examples
Take a look at `./examples`. In By the way I am in the process of creating an MVC framework from scratch. It is when I went for Look, although I lack the experience with creating/maintaining really big projects, we have to question whether an unmanageable Finally as far as I can see React is not using TypeScript. Maybe that is why I have hard time reading its documentation. |
I've also mused on this and gone back and forth. One thing I would say is if you are using TypeDoc with something like Docusaurus (via the plugin), then it's nice to have your "guide" docs be able to link into the underlying API docs. However, I think a lot of libraries just do the API docs and that's it, they don't have an overarching guide on how it all fits together, they just put the API docs online and leave it at that. I feel if you do that there's a higher chance the value is significantly lower as you've just created a reflection of what the IDE integration can provide. I don't blame them of course -- documentation is time-consuming. And I wouldn't say there's no value -- discoverability to newbies poking around deciding if to use your library is important. There's probably some SEO benefit as well in that end users who are googling an error from a black-box perspective might get them to the problem quicker. The react example is interesting as it kind of smushes it into one, and ignores the nitty gritty verbosity of autogenerated API docs in favour of hand crafted wording. It's very nice in my opinion (some may disagree), but it's also a lot of work. I've found a happy medium is some pages in docusaurus explaining the big picture but with links to specific places in the API docs. |
How can this happen is it fixed?
…On Sat, Aug 19, 2023, 10:18 AM Gerrit Birkeland ***@***.***> wrote:
Closed #2310 <#2310> as
completed.
—
Reply to this email directly, view it on GitHub
<#2310 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWMIKFIILMMMZ2ASRIBT6XLXWDKNJANCNFSM6AAAAAAZJTNIDQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Search terms
publicApi.ts
Question
When I use a single file:
publicApi.ts
, that acts as documentation for my library, I get the following benefits:node_modules
folder.d.ts
files sincepublicApi.ts
can be the entry point for types for my node module.d.ts
if they want to just use a bundledindex.js
, since they can renamepublicApi.ts
toindex.d.ts
Given all these benefits why should anyone use any documentation generation library?
The text was updated successfully, but these errors were encountered: