Skip to content

docs: show source link #1780

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

Merged
merged 23 commits into from
Feb 3, 2023
Merged

docs: show source link #1780

merged 23 commits into from
Feb 3, 2023

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Jan 25, 2023

Fixes #1695

This PR ads a Goto Source link to each method.

grafik

The source link targets the first line of the last api signature (not the impl signature).
E.g. https://github.com/faker-js/faker/blob/d16a4d2d/src/modules/date/index.ts#L105

I haven't found a good way to display it yet.
If we don't find something better, we can just start with this and change the appearance later.

Things to decide:

  • The exact text/appearance of that link?
  • Whether the link targets the correct code location?
  • Whether the link should target the branch or commit?
  • Should the module have a source link (+since) as well?

Things to keep in mind:

  • We have to exclude the sourceLink from the diff as both the commitId/branchName and the line number are likely to create lots of false positives.

@ST-DDT ST-DDT added c: docs Improvements or additions to documentation p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision labels Jan 25, 2023
@ST-DDT ST-DDT requested review from a team January 25, 2023 00:17
@ST-DDT ST-DDT self-assigned this Jan 25, 2023
@ST-DDT ST-DDT marked this pull request as ready for review January 25, 2023 00:31
@codecov
Copy link

codecov bot commented Jan 25, 2023

Codecov Report

Merging #1780 (3aaebea) into next (32b9034) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1780      +/-   ##
==========================================
- Coverage   99.63%   99.63%   -0.01%     
==========================================
  Files        2346     2346              
  Lines      235115   235115              
  Branches     1135     1132       -3     
==========================================
- Hits       234263   234258       -5     
- Misses        830      835       +5     
  Partials       22       22              
Impacted Files Coverage Δ
src/modules/internet/user-agent.ts 93.49% <0.00%> (-1.48%) ⬇️

@ST-DDT ST-DDT marked this pull request as draft January 26, 2023 23:18
@ST-DDT ST-DDT marked this pull request as ready for review January 27, 2023 00:27
@matthewmayer
Copy link
Contributor

I think its a bit too prominent. Most people reading the docs won't use it. I'd make it light gray so its less prominent than the method name and description.

@xDivisionByZerox
Copy link
Member

I think its a bit too prominent. Most people reading the docs won't use it. I'd make it light gray so its less prominent than the method name and description.

We could also add a small github icon with a tooltip 🤔

Shinigami92
Shinigami92 previously approved these changes Jan 27, 2023
@ST-DDT ST-DDT requested review from a team January 27, 2023 19:37
@ST-DDT ST-DDT requested a review from Shinigami92 January 31, 2023 08:44
@ST-DDT
Copy link
Member Author

ST-DDT commented Feb 1, 2023

Preview

grafik
grafik

@ST-DDT ST-DDT added s: accepted Accepted feature / Confirmed bug and removed s: needs decision Needs team/maintainer decision labels Feb 1, 2023
@ST-DDT ST-DDT requested a review from matthewmayer February 1, 2023 17:00
Shinigami92
Shinigami92 previously approved these changes Feb 1, 2023
@ST-DDT ST-DDT requested review from a team and removed request for matthewmayer February 1, 2023 17:10
@ST-DDT
Copy link
Member Author

ST-DDT commented Feb 1, 2023

Why does it keep removing the request for review from @matthewmayer ?

@Shinigami92
Copy link
Member

@ST-DDT if you consider @matthewmayer's review already as member review, then I accept if you already merge right now 🙂

@matthewmayer team membership does not mean you need to attempt at meetings but provides you the ability for green approvals (and other stuff)
If you want, just say you want that your approvals count to our green-approval (internal) guide line

If a PR has 2 green approvals, it needs to wait for 24 hours to get merged, or does get a third green approval and can then directly merged
Still at least one core maintainer (@ST-DDT or @Shinigami92 ^^) needs to also be one of the approvals (what is mostly always the case anyway)

@matthewmayer
Copy link
Contributor

Sure, you can add me on the team if that makes it easier to request reviews etc. Since my Typescript is fairly limited I'll only approve PRs which are more locale-focused or documentation-focused like this one.

@Shinigami92 Shinigami92 merged commit d35da05 into next Feb 3, 2023
@ST-DDT ST-DDT deleted the docs/show-source-link branch February 4, 2023 00:36
matthewmayer pushed a commit to matthewmayer/faker that referenced this pull request Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: docs Improvements or additions to documentation p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add "Go to Source" link in api-docs (per method)
4 participants