use of alerts on the help wiki

Andrew Sayers andrew-ubuntu-doc at pileofstuff.org
Sun Sep 21 08:24:14 UTC 2008


Based on all the feedback, I've attached a new implementation that I
hope will please everybody.  This implementation only has one macro,
used like this:

<<Alert(Hint: Use alerts to draw the reader's attention to important
issues)>>

<<Alert(Note: Alerts can include ''formatting'')>>

<<Alert(Warning: Use alerts sparingly, so readers don't become
desensitised to them)>>

The macro will see the initial "Hint" etc., and style the box
appropriately.  For known alert types, any text before the first colon
is deleted.  Unknown alert types are converted to notes with text before
the colon left intact.

As a special case, <<Alert(list_of_alerts)>> will print an unordered
list of known alert types, suitable for use in an explanatory page.

This should be at least as easy to use as the old implementation, easier
to maintain, and should let authors experiment with new alert types
before coming to the list.

Matthew - I've changed the HTML around a bit, so this CSS will be better
with it:

/* CSS for Alert macros */

/* General styling for all alert boxes */
.alert { border: 1pt solid #6d4c07; width: 50%; margin: 0.5em auto 0.5em
auto; }
.alert td { border: none; }

/* Force this <td> to the width of the image */
.alert .image { width: 1px; }

/* Colours based on those used at /community/ResizeEncryptedPartitions */
.alert.warning { background-color: #CCAAAA; color: black }
.alert.note { background-color: #FFFACD; }
/* Colours chosen by Andrew Sayers */
.alert.hint { background-color: #DDDDDD; }

I haven't checked this against many browsers yet, but I'm not expecting
any surprises.  This also fixes the alignment issue, which turned out to
be an issue with the image <td> expanding too far.

	- Andrew

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Alert.py
Type: text/x-python
Size: 2429 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-doc/attachments/20080921/6a94230c/attachment.py>


More information about the ubuntu-doc mailing list