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

[docs] Import local files in vuepress documentation #7929

Closed
4 tasks
amaury1093 opened this issue Nov 13, 2020 · 7 comments
Closed
4 tasks

[docs] Import local files in vuepress documentation #7929

amaury1093 opened this issue Nov 13, 2020 · 7 comments
Labels
good first issue T:Docs Changes and features related to documentation.

Comments

@amaury1093
Copy link
Contributor

amaury1093 commented Nov 13, 2020

Summary

We use +++ in md files to import code snippets from github.com, we should prefer <<< with relative paths

Problem Definition

To include a code snippet in the docs, we use +++ with a remote github hash, e.g.:

+++ https://github.com/cosmos/cosmos-sdk/blob/4a1b2fba43b1052ca162b3a1e0b6db6db9c26656/types/tx_msg.go#L10-L33

+++ is a flavored Markdown syntax to import & display code blocks.

There's no need to import code blocks from a specific tag, each doc should point to local code.

Proposal

I didn't manage to display local docs in vuepress with +++, also didn't find any official documentation on +++.

Vuepress does allow importing local code snippets with <<<: https://v1.vuepress.vuejs.org/guide/markdown.html#import-code-snippets. Note: this feature is still in beta.

The proposal is to switch all docs to use <<< with local refs.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@amaury1093 amaury1093 added the T:Docs Changes and features related to documentation. label Nov 13, 2020
@amaury1093 amaury1093 added this to the v0.40 [Stargate] milestone Nov 13, 2020
@jwhitt3r
Copy link

I would be interested in supporting the project, and would be happy to help on this issue.

@amaury1093
Copy link
Contributor Author

@jwhitt3r sure, that would be great! Let us know here if you have any questions.

@clevinson
Copy link
Contributor

Hey @jwhitt3r, We'd like to get this worked on. Are you still interested in taking it on? Otherwise we can assign to someone on our team.

@ryanchristo
Copy link
Contributor

I think using local paths might be problematic. Consider the situation where a developer updates a file, adding ten new lines of code before the line where an example in the documentation starts. The example will display the same line range regardless of the update and the example will no longer be accurate. Each code update would require cross-referencing the documentation to make sure the code update does not cause unintended alterations to examples in the documentation.

@jwhitt3r
Copy link

Hay sorry @clevinson I don't think I can commit to the project. Apologies for the late reply!

@amaury1093
Copy link
Contributor Author

@ryanchristo yeah good point. Maybe let's just close this issue then? The current way of doing things is fine.

@ryanchristo
Copy link
Contributor

Sounds good. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue T:Docs Changes and features related to documentation.
Projects
None yet
Development

No branches or pull requests

5 participants