Comments (11)
Should I close this issue since it is resolved?
No thanks, putting a /** */
comment is just a workaround, the issue is still unresolved.
but there are new issues
Oh... I believe there has been a misunderstanding, this is a tool built for my own use.
@IMax153 I'm afraid the new README file will lead users to think that this is a general purpose documentation tool
from docs-ts.
@Eleseer I merged v0.6 a couple of hours ago, it's not yet "officially" released (I'm testing right now the new version against my projects).
You can run npm i docs-ts@next
to get the experimental release though.
from docs-ts.
@Eleseer I merged v0.6 a couple of hours ago, it's not yet "officially" released (I'm testing right now the new version against my projects).
You can run
npm i docs-ts@next
to get the experimental release though.
I'll try it tomorrow then, ty!
from docs-ts.
I have installed the docs-ts@next
and now config is readable - half the problem solved, but Missing documentation
error persists:
...
14.02.2021 | 16:45:16 | DEBUG | Project name detected: @aliser/foo
14.02.2021 | 16:45:16 | DEBUG | Checking for configuration file...
14.02.2021 | 16:45:16 | INFO | Found configuration file
14.02.2021 | 16:45:16 | DEBUG | Parsing configuration file found at: ...\docs-ts.json
14.02.2021 | 16:45:16 | INFO | Found 1 modules
14.02.2021 | 16:45:16 | DEBUG | Parsing files...
Missing documentation in src/index.ts module
...
from docs-ts.
Thanks @Eleseer, looks like "enforceVersion": false
is not respected at the module level.
If you put a /** */
comment on the very first line of your module the error goes away I guess?
from docs-ts.
Yeah, it's works now, documentation is being generated, but there are new issues:
- The TOC root entry is called
utils
, why is that? - The documentation on overloaded methods is partially ignored - all overloads are showing up, but documentation is there only on the first one of the overloads.
- At least one of the JSDoc's tags is just ignored,
@returns
in my case.
Should I close this issue since it is resolved?
from docs-ts.
Uh oh, okay. Thanks anyway.
from docs-ts.
Thanks to you for the bug report, I'm sorry for the misunderstanding
from docs-ts.
Hmmm - @gcanti, I suppose that those of us who have been using docs-ts
for our own personal projects take it for granted that we tend to structure our projects/documentation in the same way that you do. Therefore, I can completely understand how the new README
would be misleading.
@Eleseer - apologies for any confusion that this has caused! It was certainly not my intent.
As for respecting the Config
at the module level, I believe we could correct that by modifying parseModuleDocumentation
:
export const parseModuleDocumentation: Parser<Documentable> = pipe(
RE.ask<ParserEnv>(),
RE.chainEitherK(env => {
const name = getModuleName(env.path)
// If any of the settings enforcing documentation are set to `true`, then
// a module should have associated documentation
const isDocumentationRequired = M.fold(M.monoidAny)([
env.settings.enforceDescriptions,
env.settings.enforceExamples,
env.settings.enforceVersion
])
const onMissingDocumentation = () =>
isDocumentationRequired
? E.left(`Missing documentation in ${env.path.join('/')} module`)
: E.right(Documentable(name, O.none, O.none, false, RA.empty, O.none))
return pipe(
env.sourceFile.getStatements(),
RA.foldLeft(onMissingDocumentation, statement =>
pipe(
statement.getLeadingCommentRanges(),
RA.foldLeft(onMissingDocumentation, commentRange =>
pipe(
getCommentInfo(name)(commentRange.getText())(env),
E.map(info =>
Documentable(name, info.description, info.since, info.deprecated, info.examples, info.category)
)
)
)
)
)
)
})
)
As for the README
, I can think of two ways to tackle this issue:
-
Make the
README
more detailed
a). Add a statement saying that this library is primarily for your own personal use
b). State that this library is opinionated about what is included in documentation (could point tofp-ts
as an example?)
c). Could also include a more feature-rich example of documentation
d). List JSDoc tags that are respected bydocs-ts
e). Describe other common pain points for new users (e.g., only documentation for the first function overload will be included) -
Gut the
README
a). Add a statement saying that this library is primarily for your own personal use
b). Remove most of theREADME
content, only leaving behind the information about the new config file
What do you think? Is there a better solution? I can take care of working on whatever option is selected.
from docs-ts.
I believe we could correct that by modifying parseModuleDocumentation
a) b)
Yes, we could state that this is primarily used as an opinionated documentation tool for the fp-ts
ecosystem
c)
we could point to fp-ts
as an example
d)
👍 the supported tags are
@category
@example
@since
@deprecated
e)
from docs-ts.
@gcanti - I split up this issue into two separate PRs since one is addressing a source code issue and one is addressing a documentation issue.
For the issues with the README
, I added a disclaimer to the beginning of the document just under the table of contents outlining that this library is primarily intended for use with fp-ts
ecosystem libraries. In addition, I added a table outlining the supported JSDoc tags. And finally, I added a FAQ section that I figured we could add to as questions about specific use cases arise over time.
Let me know what you think!
from docs-ts.
Related Issues (20)
- [discussion] Why use ts-morph over tsc? HOT 3
- Error when compiling docs HOT 2
- `@types/node` is needed HOT 2
- Horizontal scrolling in rendered code blocks HOT 4
- @example imports still buggy HOT 1
- Incorrect return type for `toNullable` and `toUndefined` HOT 1
- "Missing examples" when examples are enforced in fp-ts-std HOT 10
- View rendered docs locally HOT 4
- Omit `.ts` in sidebar HOT 2
- Can't ignore private methods from being generated HOT 1
- Enforcement exclusions HOT 4
- Modules with only exports from other modules result in empty ToC
- Feature request: Forward options to ts-morph
- ts-morph needs updating
- tsx support
- "Why" section of the readme seems incomplete HOT 1
- Consider migrating to vitepress
- Bug: getter documentation is skipped
- Document how to make use of & debug the example type checking? HOT 2
- Prettier as peer dependency prevents upgrading it in consumers projects HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs-ts.