Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Reference Guide or Documentation for FeatureScript Docs Comments?
orion_deyoe
Member Posts: 12 EDU
Does official documentation exist for the docs comment syntax in FeatureScript? These are the comments that start with "/**" and generate the popups that appear when hovering over a function or type.
I have been able to figure out a few things from the std source as well as trial and error but searching for real documentation on all of the keywords and brackets and such has been fruitless.
Specifically right now I'm stuck on trying to force a newline in the docs to show something like a list.
Answers
https://cad.onshape.com/FsDoc/index.html
It's pretty much all documented there.
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
No, it is not. I have been through every piece of documentation on this page and there is not a single reference to the "/**" style of comment or any of the syntax for formatting them. I am not talking about a standard "/* */" block comment here. I have looked through a decent amount of standard library source code to pull out what I could, but it is not easily searchable and many of the functions in that code have extremely minimal docs comments so they aren't even good examples of what I'm looking for.
From my agent…
The
/** ... */blocks in the Onshape standard library are FsDoc-style documentation comments, very close in spirit to JSDoc.Key patterns:
/**marks a doc comment that FsDoc can pick up for generated API docs.*, then close with*/.Examples in the standard library:
box.fsshows module-level docs, @type , @field , and short function comments.mateConnector.fsshows the rich feature-parameter style: @param definition {{ ... @field ... }}.splineUtils.fsshows @type , @seeAlso , @param , and @returns .properties.fsshows inline examples like @eg , links to docs/help pages, and property/type docs.Practical takeaway: for custom FeatureScript,
/** ... */is the right format when documenting exported helpers, types, feature definitions, and structureddefinitionmaps. It is documentation only; it does not affect FeatureScript execution.Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
Onshape docs are pretty lean in some areas, but overall they are fantastic. Your best resource for writing FS is the std library itself. @S1mon 's strategy is a good one: give the codebase to an AI. To that end, one enormously useful tool is @javawizard 's std library mirror: https://github.com/javawizard/onshape-std-library-mirror
It hasn't been bumped recently which makes me nervous that he's run afoul of the api pricing changes but @javawizard provides a tool to write your own importer as well: https://github.com/javawizard/onshape-std-library-importer