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

Add easy link from docs to the code #2430

Closed
jgeewax opened this issue Jul 3, 2017 · 8 comments
Closed

Add easy link from docs to the code #2430

jgeewax opened this issue Jul 3, 2017 · 8 comments
Assignees

Comments

@jgeewax
Copy link
Contributor

jgeewax commented Jul 3, 2017

For the methods we have in our docs, is it possible to add a link to the code so that we don't have to click around trying to navigate from the docs for (say) datastore.save -> code for the method?

@lukesneeringer
Copy link
Contributor

This would be a really nice feature. It does not look like something JSDoc supports out of the box. We could use @see but the GitHub links would have constantly changing line numbers, which would make maintenance tough.

I think we could write a plugin that could do this, however. The JSDoc AST already has enough information.

@stephenplusplus
Copy link
Contributor

I think we have what you're looking for, but let me know if I misunderstand:

image
https://googlecloudplatform.github.io/google-cloud-node/#/docs/google-cloud/v0.55.0/datastore?method=save

@lukesneeringer
Copy link
Contributor

So we do. I did not see that.

Would it be possible to change our template to have that be next to the header, rather than at the very bottom of a very long and drawn out explanation with multiple examples?

I am thinking along the lines of having it right-aligned right next to the name of the method.

@stephenplusplus
Copy link
Contributor

stephenplusplus commented Jul 5, 2017

Historic reason: #790 (comment)

We basically have a generic "put relevant links here" bucket-- at a minimum, they're supposed to contain:

  • Source code link (always present)
  • Upstream API reference breakdown of the object/method that's relevant (mostly present, when applicable)

Anything else, like links to guides from the official docs "Getting Started with _____", will go here as well.

@callmehiphop
Copy link
Contributor

@stephenplusplus I think @lukesneeringer's suggestion is good, we can still put other links (upstream docs, etc.) at the bottom but maybe some smaller text next to the method name that says view source or similar.

@stephenplusplus
Copy link
Contributor

I'm fine with it that way, or the way it is!

@stephenplusplus
Copy link
Contributor

This issue was moved to GoogleCloudPlatform/gcloud-common#229

@stephenplusplus
Copy link
Contributor

The positioning issue can be resolved in the common repo-- that's where the change would be made, and it would affect all of our libraries.

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

No branches or pull requests

4 participants