This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: auto-generate operator README.mdx #65
Merged
jvallesm
merged 6 commits into
main
from
jvalles/ins-3584-create-component-readme-through-templates
Feb 26, 2024
Merged
feat: auto-generate operator README.mdx #65
jvallesm
merged 6 commits into
main
from
jvalles/ins-3584-create-component-readme-through-templates
Feb 26, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- When validating the field for README autogeneration, the field didn't pass go-playground/validator `url` validator. - When rendering the value in a README, it reference a relative path instead of an absolute one. Automatically updated with some `jq` magic: ```sh for p in $(fd definitions.json); do jq '.[0].source_url = "https://" + .[0].source_url ' $p > tmp.json && mv tmp.json $p done; ```
Just running go generate ./... will update the documents.
This is a requirement for README doc auto-generation
jvallesm
requested review from
donch1989,
pinglin and
xiaofei-du
as code owners
February 23, 2024 11:33
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
=======================================
Coverage 70.84% 70.84%
=======================================
Files 7 7
Lines 758 758
=======================================
Hits 537 537
Misses 175 175
Partials 46 46
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Some operators are excluded: - `start` and `end` as their structure is special and shouldn't be treated as operators - `image` as `$ref` schema isn't supported by `compogen` yet
jvallesm
force-pushed
the
jvalles/ins-3584-create-component-readme-through-templates
branch
from
February 26, 2024 06:57
7111cd4
to
66aae12
Compare
jvallesm
deleted the
jvalles/ins-3584-create-component-readme-through-templates
branch
February 26, 2024 07:01
donch1989
pushed a commit
that referenced
this pull request
Feb 29, 2024
🤖 I have created a release *beep* *boop* --- ## [0.9.0-beta](v0.8.0-beta...v0.9.0-beta) (2024-02-29) ### Features * auto-generate operator README.mdx ([#65](#65)) ([0647a26](0647a26)) ### Bug Fixes * add missing `array:` instillFormat in operator output ([#63](#63)) ([ca146c3](ca146c3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What is the purpose of this PR?
Because
This PR
compogen readme
(see feat: create README.mdx generation command component#59) to generate automatically aREADME.mdx
file for each operator.Excluded operators
start
andend
, as their structure is special and shouldn't be treated as operatorsimage
, as$ref
schema isn't supported bycompogen
yetNext steps / improvements
The main goal of
compogen
is minimizing the maintenance cost of the component docs at instill.tech. That's why the output is an MDX document. However, having a Markdown version of the document would be beneficial for developers using this repository, removing the need to access an external website (or offering the rendered Markdown in GitHub at the root of the component). Transforming MDX to Markdown should be feasible but I didn't manage to automate the process.It would be interesting to add input / output code samples, either by adding an example field at the task level in
tasks.json
or by checking if all the required fields have anexample
field.If this proves useful and production-ready, we can implement an GitHub action that generates the documents automatically when changes are introduced in
tasks.json
ordefinitions.json
. We can even push these changes to the website repo.