Unify docs and embedded docs and/or define them alongside the functions #2745
Replies: 4 comments
-
Basically the scheme I am thinking about is to extend docgenerator.js so that while it is at it, it writes a JSON file in the embedded docs format with everything it's extracted from the comments, placing it basically where the current embedded docs json files go. So running directly from source without having done the build, very few (if any) symbols would have embedded docs. But in the full bundle, the embedded docs would be there. And the tree-shaking would work just as it does now, because comments are not included in the bundles, and the generated JSON file would be accessed just the way the current hand-written ones are, i.e., it would not included in a bundle exactly as the current help is or is not. In the generation of the embedded-docs JSON, the Does that sound plausible and worthwhile? I feel it would eliminate a significant amount of duplicated information. Let me know and I will take a stab at implementation, if it seems like a good direction to go. |
Beta Was this translation helpful? Give feedback.
-
I agree with you that the best approach would be to use the jsdoc comments as the "single source of thuth", and from there, auto generate the docs for the web site and the embedded docs (using the docgenerator).
Yes that makes a lot of sense. In like 80% of the cases, the examples for plain js vs expression parser are 1:1 the same except for stripping the |
Beta Was this translation helpful? Give feedback.
-
Great, I will give this a stab when I have a chance. Doing only the |
Beta Was this translation helpful? Give feedback.
-
Continuation from the discussion in #2047 (which became a bit off-topic)
In #2047 two ideas where brought up by @gwhitney:
math.evaluate('help(sin)')
.Some practical notes:
help
function with embedded docs is separated from the source code of the individual functions.Beta Was this translation helpful? Give feedback.
All reactions