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

API docs should link to the code definition in github for each function #12157

Closed
KyleAMathews opened this issue Feb 27, 2019 · 4 comments · Fixed by #14240
Closed

API docs should link to the code definition in github for each function #12157

KyleAMathews opened this issue Feb 27, 2019 · 4 comments · Fixed by #14240
Assignees
Labels
help wanted Issue with a clear description that the community can help with. type: documentation An issue or pull request for improving or updating Gatsby's documentation

Comments

@KyleAMathews
Copy link
Contributor

Right now if you go to an action e.g. https://www.gatsbyjs.org/docs/actions/#createPage there's no link to the actual code definition at

actions.createPage = (

Documentation is great but sometimes you can get more clarity by looking at the code itself.

@gatsbot gatsbot bot added the type: documentation An issue or pull request for improving or updating Gatsby's documentation label Feb 27, 2019
@m-allanson m-allanson added help wanted Issue with a clear description that the community can help with. no triage labels Feb 28, 2019
@JacobBlomgren
Copy link
Contributor

@KyleAMathews I can do it! Should it be a text link or the github icon link used in other places in the docs?

@JacobBlomgren JacobBlomgren self-assigned this Feb 28, 2019
@KyleAMathews
Copy link
Contributor Author

@pieh might actually already have handled this in a different PR he was already working on.

@pieh
Copy link
Contributor

pieh commented Feb 28, 2019

The UI design is TBD (I didn't work on this part)

For actions reference page:

I just added support for providing code location in c81f6e0 (it's in not yet merged PR #11597)
screenshot 2019-02-28 at 01 53 05

After that is merged we can adjust query in https://github.com/gatsbyjs/gatsby/blob/master/www/src/pages/docs/actions.js#L73-L82 to use codeLocation to construct github links that always point to accurate position in github

For Gatsby Node/SSR/Browser API reference pages:

I've done proof of concept parser that finds where we "call" APIs - https://gist.github.com/pieh/ccbf0b2556fe3d19202ddaf61b881937 :

  • there is example output in gist as well - I just ran this on older branch so hightlighted lines are outdated in some cases
  • it doesn't find gatsby-browser API calls because I didn't handle ESM imports in my parser implementation
  • this should be turned into gatsby plugin (I think local plugin for .org site), so data can be used on .org site

@JacobBlomgren JacobBlomgren removed their assignment Feb 28, 2019
@gatsbot
Copy link

gatsbot bot commented Mar 21, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Mar 21, 2019
@lannonbr lannonbr added not stale and removed stale? Issue that may be closed soon due to the original author not responding any more. labels Mar 31, 2019
@LekoArts LekoArts self-assigned this May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants