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

[community/kep pages] Add automated handling for links from imported files #6926

Merged
merged 1 commit into from
Jan 11, 2018
Merged

[community/kep pages] Add automated handling for links from imported files #6926

merged 1 commit into from
Jan 11, 2018

Conversation

jesscodez
Copy link
Contributor

@jesscodez jesscodez commented Jan 10, 2018

@chenopis PTAL

I've tried to generalize this solution and not make it too brittle---basically if you mark the import config file (e.g. community.yml) with gen-absolute-links, it processes URLs from the imported pages as follows, depending on their type:

  • #id-on-page - leaves these URLs as they are
  • /path/url - adds the remote repo URL prefix
  • path/url, ./path.url - adds the remote repo URL and the relevant file's subpath as a prefix
  • http://, https:// - leaves these URLs as they are
  • mailto: - leaves these URLs as they are

Regex works for now, but people well-versed in parsing can likely come up with a cleaner solution.

Some of the URLs are broken because things in community have been moved around, I'll follow up on the CI report and fix them accordingly.


This change is Reviewable

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 10, 2018
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 10, 2018
@jesscodez
Copy link
Contributor Author

Broken links fixed with kubernetes/community#1587

@@ -159,25 +176,33 @@ func main() {
fmt.Fprintf(os.Stdout, "\n\t\t\t*\t*\t*\n\nDocs imported! Run 'git add .' 'git commit -m <comment>' and 'git push' to upload them.\n")
}

func copyFile(src, dst string) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing this function, i checked and it's not being used anywhere

@chenopis chenopis assigned chenopis and unassigned a-mccarthy Jan 11, 2018
@chenopis
Copy link
Contributor

chenopis commented Jan 11, 2018

/cc @castrojo
/cc @steveperry-53

@chenopis
Copy link
Contributor

I'm going to merge this and do more extensive testing w/ the kubectl docs.

@chenopis chenopis merged commit 563f693 into kubernetes:chenopis-import-repos Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants