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

Redo Mermaid shortcode (Docsy alignment) #46681

Merged

Conversation

sftim
Copy link
Contributor

@sftim sftim commented Jun 5, 2024

Ready our handling of Mermaid shortcodes so that we can eventually use the vanilla head.html layout from upstream Docsy.

/area web-development
/kind cleanup

Helps with #41171

Existing example | preview

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels Jun 5, 2024
Copy link

netlify bot commented Jun 5, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit ef41204
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/66cdd862e283f50008cb606a
😎 Deploy Preview https://deploy-preview-46681--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sftim sftim force-pushed the 20240605_redo_mermaid_shortcode branch from c38f339 to 299a485 Compare June 5, 2024 14:59
@sftim sftim marked this pull request as ready for review June 5, 2024 14:59
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2024
Copy link
Member

@dipesh-rawat dipesh-rawat left a comment

Choose a reason for hiding this comment

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

The changes look good, and the preview works as expected.
/lgtm

/approve (Unofficially giving the nod of approval; official approval required from sig-docs-website-owner)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 5, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: b76e040d0b9642a2b9cf71757313bae7f68de34f

@sftim sftim force-pushed the 20240605_redo_mermaid_shortcode branch from 299a485 to d8290fa Compare June 11, 2024 15:59
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 11, 2024
Copy link
Member

@dipesh-rawat dipesh-rawat left a comment

Choose a reason for hiding this comment

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

Re-applying the label from #46681 (review). The change still looks good to me ;)

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 11, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 0a1d3b7fa5e27ec625f5226e144a9dbbb5d33823

Copy link
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

See inline for two minor nits.

/lgtm

@@ -13,3 +13,13 @@
{{- if .HasShortcode "cncf-landscape" -}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.min.js" integrity="sha384-hHTwgxzjpO1G1NI0wMHWQYUxnGtpWyDjVSZrFnDrlWa5OL+DFY57qnDWw/5WSJOl" crossorigin="anonymous"></script>
{{- end -}}

{{ if .HasShortcode "mermaid" }}
<!-- Copied from https://unpkg.com/mermaid@10.6.1/dist/mermaid.min.js -->
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see how this comment makes sense anymore It might at some point in the past when part of the .min.js script was embedded here, but that clearly is no longer the case.

Suggested change
<!-- Copied from https://unpkg.com/mermaid@10.6.1/dist/mermaid.min.js -->

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why does this no longer make sense? The point is to let people confirm the value of integrity and also to understand / verify the provenance.

Copy link
Contributor

Choose a reason for hiding this comment

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

With a statement like "Copied from https://unpkg.com/mermaid@10.6.1/dist/mermaid.min.js" I expect to see code excerpted from the named file and inlined below, but I'm not seeing any such embedded code.

Oh, right, you're doing a get resource, and so losing the link to the source by the same token. Got it.

Copy link
Contributor Author

@sftim sftim Jun 26, 2024

Choose a reason for hiding this comment

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

Yep, the comment is in the place where we do the Get; this lets us ensure that the committed file contents 100% match the minified JS. We prefer to have the files be 100% the same.

One day we might be able to load Mermaid from an external CDN.

{{- with resources.Get "js/mermaid-10.6.1.min.js" -}}
<script src="{{ .RelPermalink }}" integrity="sha384-+NGfjU8KzpDLXRHduEqW+ZiJr2rIg+cidUVk7B51R5xK7cHwMKQfrdFwGdrq1Bcz"></script>
{{- else -}}
<!-- without Mermaid, the site won't appear right -->
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<!-- without Mermaid, the site won't appear right -->
{{/* Without Mermaid, the site won't appear right */ -}}

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 thought about that, but I went for an HTML comment. The build is about to fail in a few microseconds so I'm not worried about this comment appearing inside the <head> of the final rendered page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(see the very next line!)

@k8s-ci-robot
Copy link
Contributor

@chalin: changing LGTM is restricted to collaborators

In response to this:

See inline for two minor nits.

/lgtm

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-sigs/prow repository.

@sftim sftim force-pushed the 20240605_redo_mermaid_shortcode branch from d8290fa to a026f71 Compare August 6, 2024 18:11
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 6, 2024
@nate-double-u nate-double-u self-requested a review August 6, 2024 18:13
Copy link
Member

@dipesh-rawat dipesh-rawat left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 6, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 53ac7954ba39a89d990f44f872d437224430a628

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 7, 2024
@sftim sftim force-pushed the 20240605_redo_mermaid_shortcode branch from a026f71 to fff5913 Compare August 7, 2024 13:31
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 7, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 7, 2024
@sftim sftim force-pushed the 20240605_redo_mermaid_shortcode branch from fff5913 to 7af5e6c Compare August 7, 2024 13:32
@sftim
Copy link
Contributor Author

sftim commented Aug 7, 2024

(rebased)

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 9, 2024
@sftim sftim force-pushed the 20240605_redo_mermaid_shortcode branch from 7af5e6c to 66f1749 Compare August 9, 2024 09:49
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 9, 2024
Copy link
Member

@dipesh-rawat dipesh-rawat left a comment

Choose a reason for hiding this comment

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

/lgtm

(Would be good to get this merged; official approval required from sig-docs-website-owner)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 11, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 753bc8f8f52e5592a85e4c01889209290e6f7189

Ready this for vanilla Docsy
@sftim sftim force-pushed the 20240605_redo_mermaid_shortcode branch from 66f1749 to ef41204 Compare August 27, 2024 13:45
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 27, 2024
Copy link
Member

@dipesh-rawat dipesh-rawat left a comment

Choose a reason for hiding this comment

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

Re-applying the label from previous review. The change still looks good to me.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 1, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: b3ebcab6762b5e5d3d8ce10b2c5ba855432137da

@reylejano
Copy link
Member

The changes render good to me
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chalin, reylejano

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 3, 2024
@k8s-ci-robot k8s-ci-robot merged commit ae24e82 into kubernetes:main Sep 3, 2024
6 checks passed
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. area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants