-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement migrate
sub-command
#314
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is looking pretty good! Some high level comments/questions and then its probably good to go! 👍
cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success.txtar
Outdated
Show resolved
Hide resolved
cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success.txtar
Outdated
Show resolved
Hide resolved
cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success.txtar
Outdated
Show resolved
Hide resolved
Co-authored-by: Brian Flad <[email protected]>
I do also wonder if we should have a flag (or bake the behavior in) to remove the old |
# Conflicts: # go.mod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome @SBGoods! I left some random thoughts/questions but everything LGTM
|
||
--examples-dir <ARG> examples directory based on provider-dir (default: "examples") | ||
--provider-dir <ARG> relative or absolute path to the root provider code directory when running the command outside the root provider code directory | ||
--templates-dir <ARG> new website templates directory based on provider-dir; files will be migrated to this directory (default: "templates") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first glance, it wasn't immediately obvious what the input directories were vs. the output directory without reading the help text. Would it be confusing/misleading to name the --templates-dir
as --output-dir
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name should be the same to keep it in parity with the generate
command with the same flag. If we changed the flag to something like --output-dir
it might not be obvious to the user that they would need to specify generate --template-dir
to that directory after migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay that's helpful context! Makes sense to me 👍🏻
Co-authored-by: Austin Valle <[email protected]>
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Implements a new
migrate
subcommand that migrates existing provider docs using the old website directory structure (website/docs/
) to aterraform-plugin-docs
-supported templates directory.The
migrate
subcommand takes the following actions:--old-website-source-dir
folder to the--tempates-dir
folder (will create this folder if it doesn't exist)docs/d/
anddocs/r/
subdirectories todata-sources/
andresources/
respectively.html.markdown
to.md.tmpl
--examples-dir
(will create this folder if it doesn't exist)tfplugindocs
template code referring to example files.--templates-dir
folder