Skip to content

Conversation

@Wryhder
Copy link
Contributor

@Wryhder Wryhder commented Feb 18, 2025

Proposed changes

Add a template for alerts (aka callouts or admonitions).

Alerts are useful for highlighting important information or including contextual warnings or tips that might get skipped over otherwise in long pieces of content.


@kingthorin @psiinon I separated out the alert template mentioned in the other PR (#2976) to this one.

Please let me know if there are any changes you'd like me to make. Thanks for your time and help with this.

@Wryhder Wryhder changed the title Add template for blockquote alerts (aka callouts) Add a template for blockquote alerts (aka callouts) Feb 18, 2025
@psiinon
Copy link
Member

psiinon commented Feb 18, 2025

Logo
Checkmarx One – Scan Summary & Details846e49bb-51cb-4464-9ad5-51e4500fd6b0

New Issues (2)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CVE-2025-25288 Npm-@octokit/plugin-paginate-rest-9.2.0
detailsRecommended version: 9.2.2
Description: The package @octokit/plugin-paginate-rest is the Octokit plugin to paginate REST API endpoint responses. In versions through 9.2.1 and 9.3.0-beta.1...
Attack Vector: NETWORK
Attack Complexity: LOW
Vulnerable Package
MEDIUM CVE-2025-25290 Npm-@octokit/request-8.2.0
detailsRecommended version: 8.4.1
Description: @octokit/request sends parameterized requests to GitHub's APIs with sensible defaults in browsers and Node. Starting in versions 1.0.0 through 8.4....
Attack Vector: NETWORK
Attack Complexity: LOW
Vulnerable Package

@kingthorin
Copy link
Member

chibbyalucard added 2 commits February 20, 2025 18:52
@Wryhder
Copy link
Contributor Author

Wryhder commented Feb 20, 2025

Leaving a comment about force-pushed changes. I added the sign-off trailer.

@psiinon
Copy link
Member

psiinon commented Feb 26, 2025

@Wryhder thanks! Do you have instructions for a quick way to try this out? Or is that in your other PR?

@Wryhder
Copy link
Contributor Author

Wryhder commented Feb 26, 2025

@psiinon My bad! I should probably include this info in the README? These examples are straight from the Hugo docs, in case the formatting below is wonky (I'm on mobile):

> [!NOTE]
> Useful information that users should know, even when skimming content.

> [!TIP]
> Helpful advice for doing things better or more easily.

> [!IMPORTANT]
> Key information users need to know to achieve their goal.

> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.

> [!CAUTION]
> Advises about risks or negative outcomes 

@psiinon
Copy link
Member

psiinon commented Feb 26, 2025

Thanks! Will try them out now 😁

@psiinon
Copy link
Member

psiinon commented Feb 26, 2025

I think these look great! We'd def need to go through the rest of the site to see where we should use them, but that def doesnt have to be in this PR 😉

Screenshot 2025-02-26 at 17-28-19 ZAP – ZAP Updates - January 2025

@@ -0,0 +1,28 @@
{{ $emojis := dict
"caution" ":exclamation:"
Copy link
Member

Choose a reason for hiding this comment

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

How about these, so we dont get 3x info source?

  "caution" ":bangbang:"
  "important" ":information_source:"
  "note" ":page_facing_up:"
  "tip" ":bulb:"
  "warning" ":warning:"

Copy link
Member

Choose a reason for hiding this comment

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

Screenshot 2025-02-26 at 17-46-02 ZAP – ZAP Updates - January 2025

Copy link
Member

Choose a reason for hiding this comment

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

Thank you, I figured there must be something better 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much better, thanks! I'll add those in a bit.

chibbyalucard added 2 commits March 3, 2025 22:41
Copy link
Member

@psiinon psiinon left a comment

Choose a reason for hiding this comment

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

Love this. Now we just need to work out all the existing pages we should update to use it :D

}

/* Styles for blockquote alerts, aka admonitions or callouts */
// Source: https://github.com/KKKZOZ/hugo-admonitions
Copy link
Member

Choose a reason for hiding this comment

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

Any specific reason not to use the module instead of c/p?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not especially. There are several more types of callouts in the module and definitely more robust styling. However, I was just looking to add the most basic types.

Note that the template itself is from an example in the Hugo docs (only a couple of lines changed). It's just the CSS I copied from the module (one line changed).

Do you suggest adding the module directly?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kingthorin I replied @thc202 earlier. My comment is supposed to be up there just before yours, although I added it using the mobile app. Maybe that's why it's not showing up? Anyway, here it is again:

Not especially. There are several more types of callouts in the module and definitely more robust styling. However, I was just looking to add the most basic types.

Note that the template itself is from an example in the Hugo docs (only a couple of lines changed). It's just the CSS I copied from the module (one line changed).

Do you suggest adding the module directly?

Copy link
Member

Choose a reason for hiding this comment

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

That would be preferable than duplicate functionality IMHO.

@Wryhder
Copy link
Contributor Author

Wryhder commented Mar 4, 2025

Love this. Now we just need to work out all the existing pages we should update to use it :D

@psiinon I'm gonna create a new PR for that. But I was thinking of modifying just the docs, not existing articles. What needs to be highlighted will probably be obvious in some of the articles, but I was thinking there's a risk of highlighting wrongly in articles where I don't have adequate context.

I'll take a look at the articles regardless, but please let me know what you think.

@thc202
Copy link
Member

thc202 commented Mar 4, 2025

Worth noting that 90% of the docs are generated from the help content.

@Wryhder
Copy link
Contributor Author

Wryhder commented Mar 4, 2025

@kingthorin @thc202 Can you see my response above to your question about using the hugo-admonition module? Just in case not:

Not especially. There are several more types of callouts in the module and definitely more robust styling. However, I was just looking to add the most basic types.

Note that the template itself is from an example in the Hugo docs (only a couple of lines changed). It's just the CSS I copied from the module (one line changed).

Do you suggest adding the module directly?

@thc202
Copy link
Member

thc202 commented Mar 4, 2025

No, is it as a pending comment?

{{ $emojis := dict
"caution" ":bangbang:"
"important" ":information_source:"
"note" ":memo:"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@psiinon I changed the emoji for "note" from 📄 to 📝. I was thinking the latter looks more colourful and is more noticeable (matches the other icons better, I think).

callouts_changed emoji

}

/* Styles for blockquote alerts, aka admonitions or callouts */
// Source: https://github.com/KKKZOZ/hugo-admonitions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not especially. There are several more types of callouts in the module and definitely more robust styling. However, I was just looking to add the most basic types.

Note that the template itself is from an example in the Hugo docs (only a couple of lines changed). It's just the CSS I copied from the module (one line changed).

Do you suggest adding the module directly?

}

/* Styles for blockquote alerts, aka admonitions or callouts */
// Source: https://github.com/KKKZOZ/hugo-admonitions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kingthorin I replied @thc202 earlier. My comment is supposed to be up there just before yours, although I added it using the mobile app. Maybe that's why it's not showing up? Anyway, here it is again:

Not especially. There are several more types of callouts in the module and definitely more robust styling. However, I was just looking to add the most basic types.

Note that the template itself is from an example in the Hugo docs (only a couple of lines changed). It's just the CSS I copied from the module (one line changed).

Do you suggest adding the module directly?

@Wryhder
Copy link
Contributor Author

Wryhder commented Mar 4, 2025

No, is it as a pending comment?

Yes, I thought "Pending" meant you were reviewing it. Didn't realize I hadn't actually submitted my comments.

@kingthorin kingthorin merged commit 62b5cfe into zaproxy:main Mar 4, 2025
3 checks passed
@Wryhder
Copy link
Contributor Author

Wryhder commented Apr 3, 2025

@kingthorin @psiinon Regarding PR #3042, perhaps a shortcode would work better for both HTML and Markdown files. Usage syntax would look something like this (see the Adding Custom Alerts section in this article):

{{< alert type="note" title="Note" >}}
Useful information that users should know, even when skimming content.
{{< /alert >}}

(Although I really liked the simplicity of the current syntax.)

What do you think? I can update this branch when I get a chance.

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.

4 participants