Comments (8)
FWIW, one can write a tsdoc comment on the props
property, which links to the Props
interface, and the docs for that interface can have all the info.
from tsdoc.
FYI this summer we are planning to enable API Extractor analysis for the office-ui-fabric-react library, which is a collection of React controls.
As far as I know, a documentation tool can model React controls as ordinary TypeScript classes and interfaces. If there are specific TSX features that you think would need special handling in the doc comment syntax, this would be in scope for TSDoc.
from tsdoc.
React components are initialized based on a call toReact.createElement
, not by doing new MyComponent
(at least not explicitly) or myComponent.prop = 'value'
so what documentation fields exactly should be generated where? React.createElement
will pick up the props type/interface in its second argument, so TSDoc you place on the props type's/interface's members will show up in Intellisense there.
Can you give an example of what would be generated based on the code you provided so far?
from tsdoc.
possibly something like this.
Props | Type | Requied | Description |
---|---|---|---|
name | string | yes | Some descriptioin |
or something JavaScript object like this
{
propName: "name",
type: "string",
isRequired: true,
default: "Someone",
description: "..."
}
from tsdoc.
But where? On the component class? On its constructor? Or do you have in mind generating documentation files (for example MarkDown) form TSDoc documentation comments?
from tsdoc.
Generating markdown would be nice. ref: like jsdoc-to-markdown
But where? On the component class? On its constructor? Or do you have in mind generating documentation files (for example MarkDown) form TSDoc documentation comments?
from tsdoc.
Now I understand. I think that's out of the scope for TSDoc itself (similarly to your link being a tool on top of JSDoc not a feature of JSDoc itself). Perhaps it would be good to ask jsdoc-to-markdown if they will add support for TSDoc.
from tsdoc.
Closing this because it seems like the questions were answered. Feel free to reopen if anyone wants to continue the discussion.
from tsdoc.
Related Issues (20)
- Validate invalid params through tsdoc eslint plugin HOT 1
- This repo is missing important files
- Documentation coverage? HOT 1
- JSDoc/TSDoc `@inherit[dD]oc` mismatch HOT 1
- Is it dead? HOT 4
- VS Code unable to load Schema
- tsdoc-unnecessary-backslash false positive
- Weird warnings about multiple declarations HOT 1
- Grouping classes under the same index name
- Support for defining custom tag syntax HOT 1
- tsdoc-html-tag-missing-equals erroneously flagging boolean attributes
- tsdoc-malformed-html-name erroneously flagging use of less than symbol HOT 1
- Unable to load schema from 'https://json.schemastore.org/tsconfig HOT 1
- `tsdoc-reference-unquoted-identifier` is incorrectly reported for certain identifiers
- [ Question ][ Playground ] Intended Behaviour? HOT 2
- eslint-plugin-tsdoc: Missing rule to check for absence of a TSDoc comment HOT 1
- ESLint flat configurations? HOT 1
- "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json"
- Can inherit doc also copy the TSDoc when I hover?
- Support tables in TSDoc comments HOT 1
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 tsdoc.