Skip to content

Use github.com instead of api.symfony.com #136

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 1 commit into from
Dec 27, 2021

Conversation

wouterj
Copy link
Contributor

@wouterj wouterj commented Dec 24, 2021

@javiereguiluz
Copy link
Collaborator

Thank you Wouter.

@javiereguiluz javiereguiluz merged commit 97ffc89 into symfony-tools:main Dec 27, 2021
@wouterj wouterj deleted the github-urls branch December 27, 2021 10:47
@@ -42,7 +42,7 @@ public function resolve(Environment $environment, string $data): ResolvedReferen
return new ResolvedReference(
$environment->getCurrentFileName(),
$methodName.'()',
sprintf('%s/%s.html#method_%s', $this->symfonyApiUrl, str_replace('\\', '/', $className), $methodName),
sprintf('%s/%s.php#method_%s', $this->githubUrl, str_replace('\\', '/', $className), $methodName),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these is no method_... id on GitHub.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, here is me hoping they'll add this one day 🙄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they did sth. else for other languages already 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, their own code navigation logic is based on server-side knowledge of the lines are which you need to navigate. The generated links are using their L* anchors to navigate to specific line numbers. There is no special anchors in the page for the methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm correct, @OskarStark suggested them to add named anchors (i.e. class names or method names) besides line nr anchors and they were quite positive about that idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, they haven't done it yet, then. And we don't know which naming pattern they will use if they finally do it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I did, but it's long time ago...

javiereguiluz added a commit that referenced this pull request Feb 15, 2022
…aviereguiluz)

This PR was merged into the main branch.

Discussion
----------

Tweak the feature that links to Symfony repository URLs

#136 was a very nice fix from Wouter, but I find the `GITHUB_URL` constant name too generic. Since we already have a `SYMFONY_DOC_URL`, I propose to rename it to `SYMFONY_REPOSITORY_URL`.

Commits
-------

ac3600b Tweak the feature that links to Symfony repository URLs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants