BioPerl talk:Style guide

From BioPerl
Jump to: navigation, search

<pre> and all GeSHi tags

Altering the CSS style for the <pre> tags will alter the presentation of Below are some code options for altering the CSS presentation of <pre>and GeSHi tags such as <perl> tags. i.e.

#!/usr/bin/perl -w
print "Hello world";

change the way the box above is presented with dashed lines around it.

Original <pre> tag in "$IP/skins/monobook/main.css"
pre {   
        padding: 1em; 
        border: 1px dashed #2f6fab;
        color: black;
        background-color: #f9f9f9;
        line-height: 1.1em;
}
CSS style obtained from http://perldoc.perl.org/css.css
pre {
  padding: 1em;       
  font-size: 1.2em;
  line-height: 1.3em;  
  background: #eeeedd;
  border-width: 1px;
  border-style: solid;
  border-color: #ccc;
}

This will style <pre> tags like the http://perldoc.perl.org/ code chunks.

From MediaWiki monobook class=catlinks
pre {
  font-size: 1.2em;
  line-height: 1.3em;
  border: 1px solid #aaa;
  background-color: #f9f9f9;
  padding: 5px;
  margin-top: 1em;
  clear: both;
}

This will look like the box around Categories list (if an article is categorised) down the bottom of the page.

The file that needs to be altered is the monobook (default) skin which is under "$IP/skins/monobook/main.css". On the downside, monobook is just the default skin, so if a user alters their skin in the preferences the tags will not render unless the CSS hacks are also put in those skins CSS files. --Zven 23:10, 22 May 2007 (EDT)


I updated monobook main.css to be

pre {
  font-size: 1em;
  line-height: 1.3em;
  border: 1px solid #aaa;
  background-color: #f9f9f9;
  padding: 5px;
  margin-top: 1em;
  clear: both;
}

I wasn't digging the extra big fontsize personally. We'll have to see if anyone else has an opinion. --jason stajich 13:51, 26 May 2007 (EDT)

the size is not important as people can adjust the browser text size anyway --Zven 17:14, 30 May 2007 (EDT)

Code sample indention?

Do we have a preference of 2 vs. 3 spaces for the wiki code samples? I seem to be stumbling into both. I vote 3. --Jhannah 12:58, 28 May 2007 (EDT)

  • I don't think it matters as long as it displays as code. One could (should?) also use <perl> tags w/o spaces to prettify perl code; see Bptutorial for some examples. --Chris Fields 17:44, 28 May 2007 (EDT)
Personal tools
Variants
Actions
Main Links
documentation
community
development
Toolbox