website icon indicating copy to clipboard operation
website copied to clipboard

Better callouts for notes, warnings, and cautions

Open jaredbhatti opened this issue 9 years ago • 6 comments

  • [x] Feature Request
  • [ ] Bug Report

Problem: Pages that contain critical users warnings aren't effectively called out.

Proposed Solution: Create CSS to better call out important warnings, cautions, and notes for developers using Kubernetes. I attached some example screenshots of how other sites call these out. screen shot 2017-07-24 at 9 56 26 am screen shot 2017-07-24 at 9 56 37 am

jaredbhatti avatar Jul 24 '17 16:07 jaredbhatti

Cody is on this :) Make a PR for callouts for Notes, Info, Caution, Warnings

jaredbhatti avatar Jul 24 '17 22:07 jaredbhatti

An easy way to achieve this from might be emojis + markdown quotes. Here's an example:

⚠️⚠️ WARNING: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec accumsan tellus. Vestibulum et fermentum nibh, quis suscipit lorem. Morbi ac faucibus enim. Nulla gravida molestie euismod. Nam sed aliquam elit. Donec euismod id mauris ac convallis. Nulla sit amet vulputate arcu. Etiam auctor vestibulum vestibulum. Pellentesque egestas ultrices ipsum vitae pellentesque.

or

ℹ️ NOTE: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec accumsan tellus. Vestibulum et fermentum nibh, quis suscipit lorem. Morbi ac faucibus enim. Nulla gravida molestie euismod. Nam sed aliquam elit. Donec euismod id mauris ac convallis. Nulla sit amet vulputate arcu. Etiam auctor vestibulum vestibulum. Pellentesque egestas ultrices ipsum vitae pellentesque.

I'm not sure how easily we can achieve the described task from scratch. Two solutions I can think of:

  • Author these boxes in HTML (e.g. <blockquote class="warning">...) because Markdown doesn't let us customize paragraphs. This means inside the boxes, you have to use HTML and not Markdown. Little annoyance but o.k.
  • Write Javascript to go through paragraphs and find prefixes like Warning:, Caution:, Note: and stylize them. This requires us write Javascript. Also suvh dynamic styling would occur once the page is fully loaded (so the user would see it happening) and it would not be captured by search engines easily.
  • Plugins: like http://idratherbewriting.com/documentation-theme-jekyll/mydoc_alerts.html

Do we have anything in place today or is this going to be built from scratch?

ahmetb avatar Jul 24 '17 23:07 ahmetb

Thanks for the research, @ahmetb! This will probably have to be built from scratch. Right now bolding the callouts is the only way we differentiate them from the rest of the text.

I was wondering if it would be possible to implement something like Attribute Lists from Python Markdown or Span Inline Attribute Lists from Kramdown.

It'd be convenient to just define a class {: .notice} or {: .warning}, but I like that Tom's plugin is already designed for multiple callouts. What do you think is the best path to pursue?

cody-clark avatar Jul 25 '17 16:07 cody-clark

Implementing something like those plugins for this problem sounds a bit overkill.

I'm imagining some form of template and include can get us a decent solution. e.g.

{% include warning.html content="This is my sample note." %} 

This makes it difficult putting multi-line or formatted content into the block (I assume it wouldn't accept markdown in "content" variable and would require HTML), but I think it addresses the immediate problem. Can you give this a try?

ahmetb avatar Jul 25 '17 17:07 ahmetb

I tried both solutions staged here and created this PR based off of the team feedback.

cody-clark avatar Jul 28 '17 18:07 cody-clark

Closed with PR #4535

cody-clark avatar Jul 31 '17 15:07 cody-clark