A couple of hours ago the venerable hermit Xiong was opining in the monastery courtyard on the lack of a standard way of posting the output of a script on the monastery notice boards.

Some fellow monks (myself included at times) have used the <code> tags to do this, but in cases of notices containing both code and output, this leads to a lack of visual distinction between the two. Some monks may have customised their display settings for code (adding line numbers and so forth) in a manner inappropriate for displaying script output.

An ideal solution would be for the monastery to adopt HTML's <samp> element which is designed for this very purpose: marking up sample output. It could perhaps be implemented in a manner similar to <code>, so that its contents are automatically escaped, whitespace preserved, etc.

In the mean time I have taken to including output samples like this:

<code> use Modern::Perl; say "Hello world!"; </code> <pre class="output"> Hello world! </pre>

On 450961 you can add some custom CSS to display <pre class="output"> nicely. Right now I'm using:

pre.output { color: #006; background:#ddf url(http://buzzword.org.uk/2012/output) no-repeat sc +roll top right; padding:0.33em; border:1px solid; font-size:90%; line-height:1.05; } pre.output em { font-style: italic; color: black; } pre.output strong { font-weight: bolder; color: black; }

But you can use whatever you like.


In reply to Standard way for displaying a script's output. by tobyink

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.