APP-7160: viam module update CLI now accepts markdown_link and short_description for models #4672
+388
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the ability for a developer to further explain the purpose and usage of each model within their module.
short_description
is a simple text field limited to 100 characters.markdown_link
is a bit more complicated: The link is a relative file path to where the CLI is ran. The purpose is to allow developers to write markdown documentation within their github repo that can be displayed when browsing their respository, and also show this markdown inline within the machine builder on app.viam.com (See the scope document for more details.The
markdown_link
can include an anchor tag which links to a specific heading of the markdown content. In this case the content is parse and only the content within that section is consumed for that specific model. This feature allows developers to write a single markdown document for a module containing multiple models, and be able to show just the relevant section for the component/service being used on app.viam.com. In more detail, I've:generateAnchor
should explain the rules. LMK if you have questions. The code also ensures that anchors are unique when there are duplicate header names, which Github also does.In addition to tests I've ran the CLI locally and confirmed that the fields are correctly populated in MongoDB for my test module.
In the future: