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

Revise the callout for generated component references #257

Closed
wants to merge 2 commits into from

Conversation

tengqm
Copy link
Contributor

@tengqm tengqm commented Oct 10, 2021

closes: #256

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 10, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tengqm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 10, 2021
@tengqm tengqm force-pushed the update-comp-generator branch from 56e7691 to 6351dd5 Compare October 10, 2021 08:57
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 10, 2021
@sftim
Copy link
Contributor

sftim commented Oct 10, 2021

This comment follows on from #256 (comment):

In kubernetes/website#29877 I change the “edit this page” link to highlight some new advice about third party content. See https://k8s.io/docs/setup/production-environment/container-runtimes/ for an example (needs a wide enough viewport).

We already hide the “edit this page” link for autogenerated content. Rather than omit it entirely, we could perhaps at least include a link to the in-page advice about the page being autogenerated.

So long as these generated pages are marked as auto_generated in their front matter, we can use a Hugo layout to:

  • add a pageinfo block (I'd put it at the end of the page, but it could go at the top) saying that the content is auto generated
  • mark the “edit this page” link with a similar link

Overall, I'd prefer not to put the customisation in the generator. We can add a single shortcode eg {{% auto_generated_content_warning %}} (which potentially helps with localization), or we can rely on Hugo's layout concept to let us achieve the same thing without any shortcode at all. I think that's a better way to separate the concerns. For example: the generator then doesn't have to track any change to Docsy or to our custom shortcodes that relates to this notice.

If you like, marking pages as auto_generated: true is model, and the Hugo layout is view (or possibly view-model).

Another thing I'd consider is using the blockade plugin to Prow to automatically tell submitters that they are changing generated content. Updates outside of a release are rare, and the release docs team have access (AIUI) to remove the labels that blockade sets.

I hope I've convinced you @tengqm about that other approach. If you like to see an example before deciding, I can do that too.

@tengqm
Copy link
Contributor Author

tengqm commented Oct 10, 2021

@sftim Alright, using a shortcode looks a better option. I'm not sure if we need to inject anything from the generator side. Mabye a shortcode can produce the same warning, by checking tauto_geneated: true.

/close

@k8s-ci-robot
Copy link
Contributor

@tengqm: Closed this PR.

In response to this:

@sftim Alright, using a shortcode looks a better option. I'm not sure if we need to inject anything from the generator side. Mabye a shortcode can produce the same warning, by checking tauto_geneated: true.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sftim
Copy link
Contributor

sftim commented Oct 10, 2021

Mabye a shortcode can produce the same warning, by checking tauto_geneated: true.

You can do that with a Hugo layout, which works a lot like a shortcode but doesn't require any change to the page source.
I'll aim to propose a PR that implements something along the lines of what I suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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.

Generated docs have broken link to “contribute upstream”.
3 participants