Agaric Design Collective

Styling XML: Making Colloquy transcripts browser-viewable

 
By Benjamin Melançon
on 31 Aug
0 comments

Agaric wants:
colloquy IRC export as html

Well, it outputs XML, so why don't we theme that?

http://www.w3.org/TR/html4/present/styles.html#h-14.2.3

http://www.w3.org/Style/styling-XML

css after text
pseudo text

http://www.w3schools.com/css/css_pseudo_elements.asp

Too cool!

sender {
color: #900;
}
sender[self="yes"] {
color: #009;
}
sender:after {
content: ":";
}

xml display any selector as a tool-tip
xml display element as a tool-tip
xml show arbitrary element as a tooltip

Could probably be done with JavaScript, see here for a hint at an approach:
http://www.activewidgets.com/javascript.forum.13662.2/tooltip-alike-cont...

Putting the style in a head style definition worked, even though this isn't defined for XML proper.

<head><style type="text/css">
log {
  font-family: sans-serif;
}
envelope {
  display: block;
  margin-top: 6px;
  margin-bottom: 6px;
}
message {
  display: block;
  margin-bottom: 2px;
}
event {
  font-size: small;
  color: #ccc;
}
who {
  display: none;
}
sender {
  display: block;
  color: #900;
  font-style: italic;
  margin: 2px 0 1px 0;
  padding: 1px 0 1px 0;
}
sender[self="yes"] {
  color: #009;
}
sender:after {
  content: ":";
}
envelope message {
  border-left: 2px dotted #666;
  margin: 0 0 0 3px;
  padding: 1px 0 1px 3px;
}
/* envelope message:before {
  content: ": ";
}
*/
</style></head>

I'm submitting a feature-request ticket to Colloquy for this. Agaric loves open source free software! As Dan said, how was software developed any other way?

The ability to save transcripts as XHTML so it can be viewed across platforms in a web browser would be great.

This can be done in a trivial way by wrapping the existing XML output in body tags and a throwing in a head section with CSS styles.

Attached is an example of this... which is at the same time a discussion about it.

There could be a default style and the option to create custom ones, again I would guess fairly easily.

And I don't know how it works, but my guess is the XML plus style XHTML result could be passed to Apple's Print to PDF feature easily also, adding this feature to Colloquy.

Changes in the XML, or a transforming program, would make possible some things like a nick before every line and showing times (in my preference as tool tips), but this wouldn't be necessary at all for the benefit of nicely themed browser-viewable exports of Colloquy chats.

Without further ado, the proof of concept will be attached.

UPDATE: although Agaric's feature proposal ticket (Add "Save as XHTML" simply by providing a wrapper around XML transcript) was assigned, nothing has happened with it yet: http://colloquy.info/project/ticket/1087

AttachmentSize
colloquy-colloquyTranscript.html.txt9.87 KB
 

Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.