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

Convert absolute links to document embedded objects to raw content refs #50

Merged
merged 2 commits into from
Oct 14, 2020

Conversation

g-pavlov
Copy link
Contributor

@g-pavlov g-pavlov commented Oct 14, 2020

What this PR does / why we need it:
Links to embedded objects, such as images on GitHub like: https://github.com/gardener/gardener/blob/v1.11.1/logo/gardener-large.png get redirected to https://raw.githubusercontent.com to get the raw content for the image to be embedded and that mostly doesn't work well with every non-gitHub environment. In addition documentation is written with all sorts of image reference links.
Now, every blob link that is resolved as absolute on a document, will be rewritten for 'raw' content type link that GitHub resolves correctly to requests for raw content.
Raw https://raw.githubusercontent.com links like also rewritten to the match the same consistent pattern.

The github.ResourceLocator object is now able to resolve URLs for every GitHub object - code (tree|blob), wiki (page), releases, pull(s), issue(s) and raw.githubusercontent links.

Processed destinations in document links are now inspected more carefully and returned early without modifications if they cannot/should not be processed.

Failures to parse a GitHub URL are now reported as errors.

Release note:

Absolute links to page embedded objects (images) in documents are now rewritten to match GitHub's format for raw content links consistently and display embedded objects correctly. The behavior is controlled with the `--rewrite-embedded-to-raw` flag, which is true by default.
Failures to parse a GitHub URL are now reported as errors. Invalid links on the documents will now fail the build.

@g-pavlov g-pavlov added component/documentation Gardener Documentation kind/enhancement Enhancement, improvement, extension labels Oct 14, 2020
@g-pavlov g-pavlov self-assigned this Oct 14, 2020
@gardener-robot gardener-robot added needs/review Needs review size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Oct 14, 2020
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 14, 2020
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 14, 2020
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 14, 2020
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 14, 2020
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 14, 2020
@g-pavlov g-pavlov merged commit cec23be into master Oct 14, 2020
@g-pavlov g-pavlov deleted the rawresourceformat branch October 14, 2020 17:11
@g-pavlov g-pavlov changed the title Rawresourceformat Convert absolute links to document embedded objects to raw content refs Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/documentation Gardener Documentation kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review needs/second-opinion Needs second review by someone else size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants