Skip to content
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

Print migration guide on version SDK/Starport version mismatch #1548

Closed
fadeev opened this issue Sep 6, 2021 · 4 comments · Fixed by #1550
Closed

Print migration guide on version SDK/Starport version mismatch #1548

fadeev opened this issue Sep 6, 2021 · 4 comments · Fixed by #1550
Assignees
Milestone

Comments

@fadeev
Copy link
Contributor

fadeev commented Sep 6, 2021

Output the migration file from docs.

@fadeev fadeev added this to the v0.18 milestone Sep 6, 2021
@ilgooz
Copy link
Member

ilgooz commented Sep 6, 2021

@Pantani any thoughts about the impl details on this?

This is what I have in my mind:

We create a new func under a pkg something like: pkg/offlinepage.Markdown(mdPath string) (htmlPath string, err error)

When we need to navigate users to the migration guideline, we basically call Markdown() with the path we create for docs/migration/VERSION.md through localfs.SaveTemp() pkg. Please also see the docs pkg.

Then, Markdown() returns the path for resulting html file for the migration guideline, we can either render the html in the Go side, or move contents of the MD into html and render in the browser with an embedded JS lib. After html created, we print its path to the user file:///private/tmp/starport-migration-VERSION.html. I think it's nice to create a human readable link like this for convenience. The file can be saved in user's tmp dir.

If needed we can also use anchors # to navigate to a specific section. file:///private/tmp/starport-migration-v0.18.0.html#ibc-upgrade.

@Pantani
Copy link
Collaborator

Pantani commented Sep 8, 2021

I like the approach. Is it similar I thought.... we will keep all these migration markdown files in the same folder? I can create a embed.FS for the entire folder and convert everything to a local HTML folder. The user can access all migration, in a case that needs to up more than one version, he needs to access the other migration files.

@ilgooz
Copy link
Member

ilgooz commented Sep 9, 2021

Instead of adding a new embed line, you can basically use https://pkg.go.dev/io/fs#Sub to access migration dir from docs.Docs

@Pantani
Copy link
Collaborator

Pantani commented Sep 10, 2021

I created the logic to create the HTML files based on the migrations markdown, but I'm not sure the best place to verify the version mismatch and call the method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants