Team:Mingdao/test

From 2014hs.igem.org

(Difference between revisions)
Line 1: Line 1:
-
<html>
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
-
<body>
+
<head>
-
<link rel="stylesheet" type="text/css" media="print" href="/wiki/skins/common/commonPrint.css?270" />
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
<h1>Test</h1>
+
<meta name="generator" content="MediaWiki 1.16.0" />
-
<p>this is a paragraph</p>
+
<link rel="shortcut icon" href="/favicon.ico" />
-
</body>
+
<link rel="search" type="application/opensearchdescription+xml" href="/wiki/opensearch_desc.php" title="2011.igem.org (en)" />
 +
<link title="Creative Commons" type="application/rdf+xml" href="/wiki/index.php?title=Team:DTU-Denmark/How_to_customize_an_iGEM_wiki&amp;action=creativecommons" rel="meta" />
 +
<link rel="copyright" href="http://creativecommons.org/licenses/by/3.0/" />
 +
<link rel="alternate" type="application/atom+xml" title="2011.igem.org Atom feed" href="/wiki/index.php?title=Special:RecentChanges&amp;feed=atom" /> <title>Team:DTU-Denmark/How to customize an iGEM wiki - 2011.igem.org</title>
 +
<style type="text/css" media="screen, projection">/*<![CDATA[*/
 +
@import "/wiki/skins/common/shared.css?270";
 +
@import "/wiki/skins/igem/main.css?270";
 +
/*]]>*/</style>
 +
<link rel="stylesheet" type="text/css" media="print" href="/wiki/skins/common/commonPrint.css?270" />
 +
<!--[if lt IE 5.5000]><style type="text/css">@import "/wiki/skins/igem/IE50Fixes.css?270";</style><![endif]-->
 +
<!--[if IE 5.5000]><style type="text/css">@import "/wiki/skins/igem/IE55Fixes.css?270";</style><![endif]-->
 +
<!--[if IE 6]><style type="text/css">@import "/wiki/skins/igem/IE60Fixes.css?270";</style><![endif]-->
 +
<!--[if IE 7]><style type="text/css">@import "/wiki/skins/igem/IE70Fixes.css?270";</style><![endif]-->
 +
<!--[if lt IE 7]><script type="text/javascript" src="/wiki/skins/common/IEFixes.js?270"></script>
 +
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
 +
 +
<script>
 +
var skin="igem",
 +
stylepath="/wiki/skins",
 +
wgUrlProtocols="http\\:\\/\\/|https\\:\\/\\/|ftp\\:\\/\\/|irc\\:\\/\\/|gopher\\:\\/\\/|telnet\\:\\/\\/|nntp\\:\\/\\/|worldwind\\:\\/\\/|mailto\\:|news\\:|svn\\:\\/\\/",
 +
wgArticlePath="/$1",
 +
wgScriptPath="/wiki",
 +
wgScriptExtension=".php",
 +
wgScript="/wiki/index.php",
 +
wgVariantArticlePath=false,
 +
wgActionPaths={},
 +
wgServer="https://2011.igem.org",
 +
wgCanonicalNamespace="",
 +
wgCanonicalSpecialPageName=false,
 +
wgNamespaceNumber=0,
 +
wgPageName="Team:DTU-Denmark/How_to_customize_an_iGEM_wiki",
 +
wgTitle="Team:DTU-Denmark/How to customize an iGEM wiki",
 +
wgAction="view",
 +
wgArticleId=13168,
 +
wgIsArticle=true,
 +
wgUserName=null,
 +
wgUserGroups=null,
 +
wgUserLanguage="en",
 +
wgContentLanguage="en",
 +
wgBreakFrames=false,
 +
wgCurRevisionId=168359,
 +
wgVersion="1.16.0",
 +
wgEnableAPI=true,
 +
wgEnableWriteAPI=true,
 +
wgSeparatorTransformTable=["", ""],
 +
wgDigitTransformTable=["", ""],
 +
wgMainPageTitle="Main Page",
 +
wgFormattedNamespaces={"-2": "Media", "-1": "Special", "0": "", "1": "Talk", "2": "User", "3": "User talk", "4": "2011.igem.org", "5": "2011.igem.org talk", "6": "File", "7": "File talk", "8": "MediaWiki", "9": "MediaWiki talk", "10": "Template", "11": "Template talk", "12": "Help", "13": "Help talk", "14": "Category", "15": "Category talk"},
 +
wgNamespaceIds={"media": -2, "special": -1, "": 0, "talk": 1, "user": 2, "user_talk": 3, "2011.igem.org": 4, "2011.igem.org_talk": 5, "file": 6, "file_talk": 7, "mediawiki": 8, "mediawiki_talk": 9, "template": 10, "template_talk": 11, "help": 12, "help_talk": 13, "category": 14, "category_talk": 15, "image": 6, "image_talk": 7},
 +
wgSiteName="2011.igem.org",
 +
wgCategories=[],
 +
wgMWSuggestTemplate="https://2011.igem.org/wiki/api.php?action=opensearch\x26search={searchTerms}\x26namespace={namespaces}\x26suggest",
 +
wgDBname="2011_igem_org",
 +
wgSearchNamespaces=[0],
 +
wgMWSuggestMessages=["with suggestions", "no suggestions"],
 +
wgRestrictionEdit=[],
 +
wgRestrictionMove=[];
 +
</script>               
 +
<script type="text/javascript" src="/wiki/skins/common/wikibits.js?270"><!-- wikibits js --></script>
 +
<!-- Head Scripts -->
 +
<script src="/wiki/skins/common/ajax.js?270"></script>
 +
<script src="/wiki/skins/common/mwsuggest.js?270"></script>
 +
<script type="text/javascript" src="/wiki/index.php?title=-&amp;action=raw&amp;gen=js&amp;useskin=igem"><!-- site js --></script>
 +
<!-- jQuery Javascript -->
 +
<script type='text/javascript'        src ='/common/jquery-latest.min.js'></script>
 +
<script type='text/javascript'        src ='/common/tablesorter/jquery.tablesorter.min.js'></script>
 +
        <link rel='stylesheet' type='text/css' href='/common/tablesorter/themes/groupparts/style.css' />
 +
        <link rel='stylesheet' type='text/css' href='/common/table_styles.css' />
 +
        <link rel='stylesheet' type='text/css' href='/forum/forum_styles.css' />
 +
<script type='text/javascript'        src ='/forum/forum_scripts.js'></script>
 +
</head>
 +
 
 +
<body              class="mediawiki  ltr ns-0 ns-subject page-Team_DTU-Denmark_How_to_customize_an_iGEM_wiki">
 +
  <div id="globalWrapper">
 +
 
 +
    <div id="top-section">
 +
<div id="p-logo">
 +
    <a href="/Main_Page"
 +
      title="Main Page">
 +
    <img src='/wiki/skins/common/images/wiki.png'>"
 +
    </a>
 +
</div>  <!-- end p-logo -->
 +
<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
 +
 
 +
 
 +
 
 +
<div id="menubar" class='left-menu noprint'>
 +
  <ul>
 +
                  <li
 +
                class='selected'       ><a href="/Team:DTU-Denmark/How_to_customize_an_iGEM_wiki">Page              </a></li>
 +
              <li
 +
                class='new'       ><a href="/wiki/index.php?title=Talk:Team:DTU-Denmark/How_to_customize_an_iGEM_wiki&amp;action=edit&amp;redlink=1">Discussion              </a></li>
 +
              <li
 +
                    ><a href="/wiki/index.php?title=Team:DTU-Denmark/How_to_customize_an_iGEM_wiki&amp;action=edit">View source              </a></li>
 +
              <li
 +
                    ><a href="/wiki/index.php?title=Team:DTU-Denmark/How_to_customize_an_iGEM_wiki&amp;action=history">History              </a></li>
 +
              <li style='color:#808080;cursor:default'>teams</li>
 +
  </ul>
 +
</div> <!-- end menubar (left) -->
 +
 
 +
<div class="right-menu noprint" id="menubar">
 +
    <ul>
 +
                <li id="pt-login"><a href="/wiki/index.php?title=Special:UserLogin&amp;returnto=Team:DTU-Denmark/How_to_customize_an_iGEM_wiki" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o">Log in</a></li>     </ul>
 +
</div><!-- end right menubar -->
 +
 
 +
<div id="search-controls" class="noprint">
 +
<form action="/Special:Search" id="searchform">
 +
<input id="searchInput" name="search" type="text" title="Search 2011.igem.org [f]" accesskey="f" value="" />
 +
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="Go" title="Go to a page with this exact name if exists" />&nbsp;
 +
      <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="Search" title="Search the pages for this text" />
 +
</form>
 +
</div> <!-- close search controls -->
 +
    </div> <!-- close top-section-->
 +
    <div id="content">
 +
<a name="top" id="top"></a>
 +
<h1 class="firstHeading">Team:DTU-Denmark/How to customize an iGEM wiki</h1>
 +
<div id="bodyContent">
 +
<h3 id="siteSub" class='noprint'>From 2011.igem.org</h3>
 +
<div id="contentSub"></div>
 +
<!--
 +
<div id="jump-to-nav">Jump to:                        <a href="#column-one">navigation</a>, <a href="#searchInput">search</a></div>-->
 +
<!-- start content -->
 +
<p>
 +
 
 +
<!-- STYLESHEET -->
 +
<!-- *********** -->
 +
 
 +
    <link rel="stylesheet" href="https://2011.igem.org/Team:DTU-Denmark/stylesheet?action=raw&amp;ctype=text/css" type="text/css" />
 +
 
 +
<!-- JAVASCRIPTS -->
 +
<!-- *********** -->
 +
 
 +
    <!-- ie9.js (fixes all Internet Explorer browsers older than ie9) -->
 +
    <!--[if lt IE 9]>
 +
    <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
 +
    <![endif]-->
 +
 
 +
    <!-- jQuery Tools (slider) -->
 +
    <script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>
 +
    <script>
 +
        $(function() {
 +
    // initialize scrollable
 +
    $(".scrollable").scrollable().navigator();
 +
        });
 +
    </script>
 +
 
 +
    <!-- Navigation scroll follow -->
 +
    <script type="text/javascript">
 +
        $(window).scroll(function () {
 +
            var scrollPos = $(window).scrollTop();
 +
            if (scrollPos > 110) {
 +
                $(".navigation").addClass("stickToTop");
 +
            } else {
 +
                $(".navigation").removeClass("stickToTop");
 +
            }
 +
            if (scrollPos > 180) {
 +
                $(".toc").addClass("stickBelowNavigation");
 +
            } else {
 +
                $(".toc").removeClass("stickBelowNavigation");
 +
            }
 +
        });
 +
    </script>
 +
 
 +
    <!-- MathJax (LaTeX for the web) -->
 +
    <script type="text/x-mathjax-config">
 +
        MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
 +
        MathJax.Hub.Config({
 +
            TeX: {
 +
                equationNumbers: {  autoNumber: "AMS"  }
 +
            }
 +
        });
 +
    </script>
 +
    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
 +
 
 +
    <!-- Sexy Drop Down (drop down navigation) -->
 +
    <script type="text/javascript">
 +
        $(document).ready(
 +
            function(){
 +
                $("ul.subnav").parent().find("> a").append("<span> ▼</span>");
 +
                $("ul.topnav li").hover(
 +
                    function() {
 +
                        // Hover over
 +
                        $(this).parent().find("ul.subnav").hide();
 +
                        $(this).find("ul.subnav").show();
 +
                        // Hover out
 +
                        $(this).hover(
 +
                            function() {
 +
                            },
 +
                            function(){
 +
                                $(this).find("ul.subnav").hide();
 +
                            }
 +
                        );
 +
                    },
 +
                    function(){
 +
                        $(this).find("ul.subnav").hide();
 +
                    }
 +
 
 +
                );
 +
            }
 +
        );
 +
    </script>
 +
 
 +
    <!-- iGem wiki hacks -->
 +
        <!-- Remove all empty <p> tags -->
 +
        <script type="text/javascript">
 +
            $(document).ready(function() {
 +
                $("p").filter( function() {
 +
                    return $.trim($(this).html()) == '';
 +
                }).remove();
 +
            });
 +
        </script>
 +
 
 +
        <!-- Remove "team" from the menubar -->
 +
        <script type="text/javascript">
 +
            $(document).ready(function() {
 +
                $("menubar > ul > li:last-child").remove();
 +
            });
 +
        </script>
 +
 
 +
        <!-- Empty heading? - Then remove it.. -->
 +
        <script type="text/javascript">
 +
            $(document).ready(function() {
 +
                if ("" == "How to customize an iGEM wiki") {
 +
                    $("#heading").remove();
 +
                }
 +
            });
 +
        </script>
 +
 
 +
 
 +
<!-- HTML CONTENT -->
 +
<!-- ************ -->
 +
 
 +
    <!-- Header image -->
 +
    <div id="header">
 +
        <div class="centering">
 +
        </div>
 +
    </div>
 +
 
 +
    <!-- Navigation bar -->
 +
   
 +
 
 +
<div id="navigation">
 +
    <div class="navigation">
 +
        <div class="centering">
 +
            <ul class="topnav" id="topnav">
 +
                <li class="home navitem1">
 +
                    <a href="/Team:DTU-Denmark">Home</a>
 +
                </li>
 +
                <li class="vision navitem2">
 +
                    <a href="/Team:DTU-Denmark/Vision" title="Test: A soft introduction to the idea and it's future applications.">Vision</a>
 +
                </li>
 +
                <li class="project navitem3">
 +
                    <a href="/Team:DTU-Denmark/Project">Project</a>
 +
                    <ul class="subnav">
 +
                        <li><a href="/Team:DTU-Denmark/Project">Overview</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Bioinformatic">Bioinformatics</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Project_testing_sRNA">Experiment: Testing sRNA</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Project_improving_araBAD">Experiment: Improving araBAD</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Modeling">Modeling</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Data">Data page</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Attributions">Attributions</a></li>
 +
                    </ul>
 +
                </li>
 +
                <li class="technical_stuff navitem4">
 +
                    <a href="/Team:DTU-Denmark/Technical_stuff">Technical stuff</a>
 +
                    <ul class="subnav">
 +
                        <li><a href="/Team:DTU-Denmark/Parts">Parts</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Notebook">Notebook</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Protocols">Protocols</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Technical_stuff_math">Math</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Matlab">Matlab</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Safety">Safety</a></li>
 +
                    </ul>
 +
                </li>
 +
                <li class="background navitem5">
 +
                    <a href="/Team:DTU-Denmark/Background">Background</a>
 +
                    <ul class="subnav">
 +
                        <li><a href="/Team:DTU-Denmark/Background_sRNA">Small RNA</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Background_the_natural_system">The chitobiose system</a></li>
 +
                        <li><a href="/Team:DTU-Denmark/Background_synthetic_biology">Synthetic biology</a></li>
 +
                    </ul>
 +
                </li>
 +
                <li class="team navitem6">
 +
                    <a href="/Team:DTU-Denmark/Team">Team</a>
 +
                </li>
 +
            </ul>
 +
        </div>
 +
    </div>
 +
</div>
 +
 
 +
 
 +
 
 +
    <!-- Page heading -->
 +
    <div id="heading">
 +
        <div class="centering">
 +
            <h1>
 +
 
 +
How to customize an iGEM wiki
 +
 
 +
            </h1>
 +
        </div>
 +
    </div>
 +
 
 +
    <!-- Prepare for content -->
 +
    <div id="innercontent">
 +
        <div class="centering">
 +
            <div class="whitebox article">
 +
 
 +
</p>
 +
<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
 +
<ul>
 +
<li class="toclevel-1 tocsection-1"><a href="#Sharing_is_caring"><span class="tocnumber">1</span> <span class="toctext">Sharing is caring</span></a></li>
 +
<li class="toclevel-1 tocsection-2"><a href="#Getting_started"><span class="tocnumber">2</span> <span class="toctext">Getting started</span></a></li>
 +
<li class="toclevel-1 tocsection-3"><a href="#Using_templates"><span class="tocnumber">3</span> <span class="toctext">Using templates</span></a>
 +
<ul>
 +
<li class="toclevel-2 tocsection-4"><a href="#Centralizing_the_layout_using_templates"><span class="tocnumber">3.1</span> <span class="toctext">Centralizing the layout using templates</span></a></li>
 +
<li class="toclevel-2 tocsection-5"><a href="#Helping_your_team_using_templates"><span class="tocnumber">3.2</span> <span class="toctext">Helping your team using templates</span></a></li>
 +
<li class="toclevel-2 tocsection-6"><a href="#iGEMs_default_styling"><span class="tocnumber">3.3</span> <span class="toctext">iGEMs default styling</span></a></li>
 +
</ul>
 +
</li>
 +
<li class="toclevel-1 tocsection-7"><a href="#Styling_the_wiki"><span class="tocnumber">4</span> <span class="toctext">Styling the wiki</span></a>
 +
<ul>
 +
<li class="toclevel-2 tocsection-8"><a href="#How_to_add_your_stylesheet"><span class="tocnumber">4.1</span> <span class="toctext">How to add your stylesheet</span></a></li>
 +
<li class="toclevel-2 tocsection-9"><a href="#Styling_tricks"><span class="tocnumber">4.2</span> <span class="toctext">Styling tricks</span></a>
 +
<ul>
 +
<li class="toclevel-3 tocsection-10"><a href="#Removing_the_MediaWiki_look"><span class="tocnumber">4.2.1</span> <span class="toctext">Removing the MediaWiki look</span></a></li>
 +
<li class="toclevel-3 tocsection-11"><a href="#Redesigning_the_top_menubar"><span class="tocnumber">4.2.2</span> <span class="toctext">Redesigning the top menubar</span></a></li>
 +
</ul>
 +
</li>
 +
<li class="toclevel-2 tocsection-12"><a href="#Get_inspiration_in_our_stylesheet"><span class="tocnumber">4.3</span> <span class="toctext">Get inspiration in our stylesheet</span></a></li>
 +
</ul>
 +
</li>
 +
<li class="toclevel-1 tocsection-13"><a href="#jQuery_hacks"><span class="tocnumber">5</span> <span class="toctext">jQuery hacks</span></a>
 +
<ul>
 +
<li class="toclevel-2 tocsection-14"><a href="#Remove_all_empty_.3Cp.3E.3C.2Fp.3E_tags"><span class="tocnumber">5.1</span> <span class="toctext">Remove all empty &lt;p&gt;&lt;/p&gt; tags</span></a></li>
 +
<li class="toclevel-2 tocsection-15"><a href="#LaTeX_equations"><span class="tocnumber">5.2</span> <span class="toctext">LaTeX equations</span></a></li>
 +
<li class="toclevel-2 tocsection-16"><a href="#Fix_Internet_Explorer"><span class="tocnumber">5.3</span> <span class="toctext">Fix Internet Explorer</span></a></li>
 +
</ul>
 +
</li>
 +
</ul>
 +
</td></tr></table><script>if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
 +
<h2> <span class="mw-headline" id="Sharing_is_caring"> Sharing is caring </span></h2>
 +
<p>... that's why I created this page. I really hope that you can benefit from it, and that you do not use a lot of time making the same mistakes as I did. Enjoy!
 +
</p><p>And hey, please do the same thing!
 +
</p>
 +
<h2> <span class="mw-headline" id="Getting_started"> Getting started </span></h2>
 +
<p>So what are this WikiMedia thing, and how do you style it? Here is what you need to know to get startet:
 +
</p>
 +
<ul><li> First of all, you'll have to learn the MediaWiki-markup, which can be found <a href="http://www.mediawiki.org/wiki/Help:Contents" class="external text" rel="nofollow">here</a>.
 +
</li><li> Next, you'll need to know that you do not have access to anything conserning the backend. All you can do to affect the appereance of your wiki, is to insert HTML-code directly the wiki-editor.
 +
</li></ul>
 +
<p><i>"So I need to paste all my styling-code into every single page on the wiki?"</i>
 +
</p><p>No! Read on...
 +
</p>
 +
<h2> <span class="mw-headline" id="Using_templates"> Using templates </span></h2>
 +
<h3> <span class="mw-headline" id="Centralizing_the_layout_using_templates"> Centralizing the layout using templates </span></h3>
 +
<p>Of course it would be would be pretty annoying if you had to paste your styling-code into every single page. Then you would have to change every single page every time you make a tiny change in the layout. What you can do is to centralize the layout by making use of <a href="http://www.mediawiki.org/wiki/Help:Templates" class="external text" rel="nofollow">templates</a>. In this way you can have all your styling and scripting in a template, which can be imported into all the other pages (by manually pasting code into each page unfortunately). This means that the styling and the scripting is completely isolated from the content, and present only one place, meaning that you will only have the make your changes this one place.
 +
</p><p>How does it work? You just put in this peace of code:
 +
</p>
 +
<pre>{{&lt; YOUR TEMPLATE GOES HERE &gt;}}
 +
</pre>
 +
<p>... and then everything from your template is loaded into that particular page.
 +
</p><p>Example:
 +
</p>
 +
<pre>{{:Team:DTU-Denmark/Templates/Navigationbar}}</pre>
 +
<p>... loads the navigation bar (which consists of <a href="https://2011.igem.org/wiki/index.php?title=Team:DTU-Denmark/Templates/Navigationbar&amp;action=edit" class="external text" rel="nofollow">this code</a>) into the page.
 +
</p>
 +
<h3> <span class="mw-headline" id="Helping_your_team_using_templates"> Helping your team using templates </span></h3>
 +
<p>As you can read in the <a href="http://www.mediawiki.org/wiki/Help:Templates" class="external text" rel="nofollow">Help:Templates</a>-section, you can also make templates that takes parameters. This way you can help your team. For instance you kan tell them to write
 +
</p>
 +
<pre>{{:Team:&lt; TEAM-NAME &gt;/Templates/NiceBox|&lt;title&gt;|&lt;subtile&gt;|&lt;text&gt;|&lt;linkto&gt;}}</pre>
 +
<p>... in stead of forcing them to learn everything about the box-model, how floats work and so forth...
 +
</p>
 +
<h3> <span class="mw-headline" id="iGEMs_default_styling"> iGEMs default styling </span></h3>
 +
<p>When to start styling, you are working on top of iGEMs default layout. This means that, if you do not override an particular rule, e.g. that &lt;h2&gt; is underlined, then &lt;h2&gt; will be underlined on your wiki. It can be helpfull to have a look at the <a href="https://2011.igem.org/wiki/skins/igem/main.css" class="external text" rel="nofollow">default styling</a>.
 +
</p>
 +
<h2> <span class="mw-headline" id="Styling_the_wiki"> Styling the wiki </span></h2>
 +
<h3> <span class="mw-headline" id="How_to_add_your_stylesheet"> How to add your stylesheet </span></h3>
 +
<p>You can always links to your own external stylesheet as you are used to:
 +
</p>
 +
<pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt; YOUR CSS FILE GOES HERE &gt;&quot; type=&quot;text/css&quot; /&gt;</pre>
 +
<p>But what do you do if you want the locate the css-file on iGEMs server, so that everybody in your team can access it? You simply create a new page, write down the styling as you would do in a normal css-file, and then you use the following code in stead:
 +
</p>
 +
<pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt; YOUR PAGE HERE &gt;?action=raw&amp;ctype=text/css&quot; type=&quot;text/css&quot; /&gt;</pre>
 +
<h3> <span class="mw-headline" id="Styling_tricks"> Styling tricks </span></h3>
 +
<h4> <span class="mw-headline" id="Removing_the_MediaWiki_look"> Removing the MediaWiki look </span></h4>
 +
<p>Removes header footer and borders:
 +
</p>
 +
<pre>
 +
#contentSub, #search-controls, .firstHeading, #footer-box, #catlinks, #p-logo {
 +
    display:none;}
 +
#top-section {
 +
    border: none;
 +
    height: 0px;}
 +
#content {
 +
    border: none;}
 +
</pre>
 +
<h4> <span class="mw-headline" id="Redesigning_the_top_menubar"> Redesigning the top menubar </span></h4>
 +
<pre>
 +
/* Removes &quot;teams&quot; from the menubar */
 +
#menubar &gt; ul &gt; li:last-child {
 +
    display: none;}
 +
/* Resizes the menubar to fik the links (default is 400px) */
 +
#menubar {
 +
    width: auto;}
 +
</pre>
 +
<p>Here is made the menubar show up only when moving the mouse on top of it:
 +
</p>
 +
<pre>
 +
body {
 +
    margin: 10px 0 0 0;
 +
    padding: 0;}
 +
#top-section {
 +
    width: 965px;
 +
    height: 0;
 +
    margin: 0 auto;
 +
    padding: 0;
 +
    border: none;}
 +
#menubar {
 +
    font-size: 65%;
 +
    top: -14px;}
 +
.left-menu:hover {
 +
    background-color: transparent;}
 +
#menubar li a {
 +
    background-color: transparent;}
 +
#menubar:hover {
 +
    color: white;}
 +
#menubar li a {
 +
    color: transparent;}
 +
#menubar:hover li a {
 +
    color: white;}
 +
</pre>
 +
<h3> <span class="mw-headline" id="Get_inspiration_in_our_stylesheet"> Get inspiration in our stylesheet </span></h3>
 +
<p>You can are welcome to take a look in our <a href="https://2011.igem.org/Team:DTU-Denmark/stylesheet?action=raw&amp;ctype=text/css" class="external text" rel="nofollow">stylesheet...</a>
 +
</p>
 +
<h2> <span class="mw-headline" id="jQuery_hacks"> jQuery hacks </span></h2>
 +
<h3> <span class="mw-headline" id="Remove_all_empty_.3Cp.3E.3C.2Fp.3E_tags"> Remove all empty &lt;p&gt;&lt;/p&gt; tags </span></h3>
 +
<p>Annoyed of all those &lt;p&gt;&lt;/p&gt; and &lt;p&gt; &lt;/p&gt; emerging everywere in your markup, distroying your layout by adding a bit of vertical space here and there?
 +
</p><p>They easily emerge when using templates or &lt;html&gt;&lt;/html&gt; tags. But fortunately they are just as easy to remove. All you need to do, is to paste in this code bit:
 +
</p>
 +
<pre>
 +
&lt;!-- Remove all empty &lt;p&gt; tags --&gt;
 +
&lt;script type=&quot;text/javascript&quot;&gt;
 +
    $(document).ready(function() {
 +
        $(&quot;p&quot;).filter( function() {
 +
            return $.trim($(this).html()) == '';
 +
        }).remove()
 +
    });
 +
&lt;/script&gt;
 +
</pre>
 +
<h3> <span class="mw-headline" id="LaTeX_equations"> LaTeX equations </span></h3>
 +
<p>It is possible to enabled TeX in a MediaWiki (<a href="http://www.mediawiki.org/wiki/Manual:Math" class="external text" rel="nofollow">Manual:Math</a>), but unfortunately it doesn't seem like iGEM has done that..
 +
</p><p>Another way to enable your wiki to display LaTeX equations, is to use <a href="http://www.mathjax.org/" class="external text" rel="nofollow">MathJax</a>. MathJax is a JavaScript file located at <a href="http://cdn.mathjax.org/mathjax/latest/MathJax.js" class="external free" rel="nofollow">http://cdn.mathjax.org/mathjax/latest/MathJax.js</a>, which reads your document after it has been loaded, and then changes the content of the document according to the notation. That is, it removes everything between any of the following delimiters...
 +
</p>
 +
<pre>\(...\)
 +
$...$ (if configured)
 +
\[...\]
 +
$$...$$
 +
\begin{?} ... \end{?}
 +
</pre>
 +
<p>...and replace them with equations. All you need to do is to add the following to your wiki tekst:
 +
</p>
 +
<pre>
 +
&lt;!-- MathJax (LaTeX for the web) --&gt;
 +
&lt;script type=&quot;text/javascript&quot; src=&quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;&gt;&lt;/script&gt;
 +
</pre>
 +
<p>And if you want to use $...$ delimiters:
 +
</p>
 +
<pre>
 +
&lt;!-- MathJax (LaTeX for the web) --&gt;
 +
 
 +
&lt;!-- This part is only if you want to use $...$ delimiters --&gt;
 +
&lt;script type=&quot;text/x-mathjax-config&quot;&gt;
 +
    MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
 +
&lt;/script&gt;
 +
&lt;script type=&quot;text/javascript&quot; src=&quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;&gt;&lt;/script&gt;
 +
</pre>
 +
<p>See <a href="http://www.mathjax.org/docs/1.1/tex.html|MathJax" class="external text" rel="nofollow">documentation here</a>
 +
</p><p>I never managed to make "\label" and "\ref" work, but a non-tested version of the code, that enables the "\label" and "\ref" commands, can be found on GitHub. The issue is discussed <a href="https://github.com/mathjax/MathJax/issues/71" class="external text" rel="nofollow">here</a>.
 +
</p>
 +
<h3> <span class="mw-headline" id="Fix_Internet_Explorer"> Fix Internet Explorer </span></h3>
 +
<p>Tired of styling for Internet Explorer? Just use this simple fix:
 +
</p>
 +
<pre>
 +
&lt;!-- ie9.js (fixes all Internet Explorer browsers older than ie9) --&gt;
 +
&lt;!--[if lt IE 9]&gt;
 +
&lt;script src=&quot;http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js&quot;&gt;&lt;/script&gt;
 +
&lt;![endif]--&gt;
 +
</pre>
 +
<p>
 +
            </div>
 +
        </div>
 +
    </div>
 +
    <div id="footer-panel">
 +
        <div class="centering">
 +
            <div class="footerBox">
 +
                <h4>This project is part of iGEM</h4>
 +
                <p>Read more on the <a href="https://2011.igem.org/Main_Page">iGEM Main Page</a></p>
 +
                <br />
 +
                <a href="https://2011.igem.org/Main_Page">
 +
                    <img style="width:240px" src="https://static.igem.org/mediawiki/2011/a/a9/DTU-Denmark2011-IGEM_logo.png"></img>
 +
                </a>
 +
            </div>
 +
            <div class="footerBox">
 +
                <h4>Sponsors</h4>
 +
                <p>Thanks to:</p>
 +
                <br />
 +
                <a href="http://www.clcbio.com/"><img class="sponsorImage hasPicOnRight" src="https://static.igem.org/mediawiki/2011/4/43/CLCBIO-logo.png"></img></a>
 +
                <a href="http://www.idtdna.com/"><img class="sponsorImage hasPicOnLeft hasPicOnRight" src="https://static.igem.org/mediawiki/2011/0/01/IDT-logo.png"></img></a>
 +
                <a href="http://www.hedenielsensfond.dk/"><img class="sponsorImage hasPicOnLeft" src="https://static.igem.org/mediawiki/2011/9/9f/FHN-FOND-logo2.png"></img></a>
 +
                <a href="http://www.dtu.dk/"><img class="sponsorImage hasPicOnRight hasPicOnTop" src="https://static.igem.org/mediawiki/2011/a/a0/DTU-logo.png"></img></a>
 +
                <a href="http://www.sigmaaldrich.com/"><img class="sponsorImage hasPicOnLeft hasPicOnRight hasPicOnTop" src="https://static.igem.org/mediawiki/2011/5/52/SIGMA-logo.png"></img></a>
 +
                <a href="http://www.bio.dtu.dk/"><img class="sponsorImage hasPicOnLeft hasPicOnTop" src="https://static.igem.org/mediawiki/2011/7/76/DTU-System_Biology_sq.png"></img></a>
 +
            </div>
 +
            <div class="footerBox">
 +
                <h4>How to customize an iGEM wiki?</h4>
 +
                <p>Learn all the tricks in our <a href="/Team:DTU-Denmark/How_to_customize_an_iGEM_wiki">wiki guide</a></p>
 +
                <br />
 +
                <a href="http://www.mediawiki.org/" style="margin-right: 20px;"><img height="127px" src="http://upload.wikimedia.org/wikipedia/commons/1/1c/MediaWiki_logo.png"></img></a>
 +
                <a href="http://creativecommons.org/licenses/by/3.0/"><img height="127px" src="https://static.igem.org/mediawiki/2011/1/15/Cc.png"></img></a>
 +
            </div>
 +
        </div>
 +
    </div>
 +
 
 +
 
 +
</p>
 +
<!--
 +
NewPP limit report
 +
Preprocessor node count: 187/1000000
 +
Post-expand include size: 347/2097152 bytes
 +
Template argument size: 58/2097152 bytes
 +
Expensive parser function count: 0/100
 +
-->
 +
 
 +
<!-- Saved in parser cache with key 2011_igem_org:pcache:idhash:13168-0!1!0!!en!2!edit=0 and timestamp 20140310114059 -->
 +
<div class="printfooter">
 +
Retrieved from "<a href="https://2011.igem.org/Team:DTU-Denmark/How_to_customize_an_iGEM_wiki">https://2011.igem.org/Team:DTU-Denmark/How_to_customize_an_iGEM_wiki</a>"</div>
 +
<div id="catlinks"><div id='catlinks' class='catlinks catlinks-allhidden'></div></div> <!-- end content -->
 +
<div class="visualClear"></div>
 +
</div>
 +
    </div>
 +
<!-- PAGE FOOTER -- ITEMS FROM COLUMN ! HAVE BEEN MOVED HERE  -- RDR  -->
 +
<div class="visualClear"></div>
 +
    <div id='footer-box' class='noprint'>
 +
        <div id="footer">
 +
              <div id="f-poweredbyico"><a href="http://www.mediawiki.org/"><img src="/wiki/skins/common/images/poweredby_mediawiki_88x31.png" height="31" width="88" alt="Powered by MediaWiki" /></a></div>       <div id="f-copyrightico"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="Attribution 3.0 Unported" width="88" height="31" /></a></div>     <ul id="f-list">
 +
 +
 
 +
  <!-- Recentchanges is not handles well DEBUG -->
 +
    <li id="t-recentchanges"><a href="/Special:RecentChanges"
 +
      title='Recent changes'>Recent changes</a></li>
 +
 
 +
    <li id="t-whatlinkshere"><a href="/Special:WhatLinksHere/Team:DTU-Denmark/How_to_customize_an_iGEM_wiki"
 +
      title="List of all wiki pages that link here [j]" accesskey="j">What links here</a></li>
 +
 
 +
                        <li id="t-recentchangeslinked"><a href="/Special:RecentChangesLinked/Team:DTU-Denmark/How_to_customize_an_iGEM_wiki"
 +
                          title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li>
 +
 
 +
 
 +
 
 +
                <li id="t-specialpages"><a href="/Special:SpecialPages"
 +
                  title="List of all special pages [q]" accesskey="q">Special pages</a>
 +
                </li>
 +
                <li><a href='/Special:Preferences'>My preferences</a></li>
 +
            </ul>
 +
        </div> <!-- close footer -->
 +
        <div id='footer'>
 +
    <ul id="f-list">
 +
 
 +
            <li id="t-print"><a href="/wiki/index.php?title=Team:DTU-Denmark/How_to_customize_an_iGEM_wiki&amp;printable=yes"
 +
              title="Printable version of this page [p]" accesskey="p">Printable version</a>
 +
            </li>
 +
 
 +
            <li id="t-permalink"><a href="/wiki/index.php?title=Team:DTU-Denmark/How_to_customize_an_iGEM_wiki&amp;oldid=168359"
 +
              title="Permanent link to this revision of the page">Permanent link</a>
 +
            </li>
 +
 
 +
 
 +
        <li id="privacy"><a href="/2011.igem.org:Privacy_policy" title="2011.igem.org:Privacy policy">Privacy policy</a></li>
 +
        <li id="disclaimer"><a href="/2011.igem.org:General_disclaimer" title="2011.igem.org:General disclaimer">Disclaimers</a></li>
 +
    </ul>
 +
</div> <!-- close footer -->
 +
    </div> <!-- close footer-box -->
 +
 +
<script>if (window.runOnloadHook) runOnloadHook();</script>
 +
</div>
 +
<!-- Served in 0.169 secs. --></body>
 +
 
</html>
</html>

Revision as of 14:53, 10 March 2014

Team:DTU-Denmark/How to customize an iGEM wiki - 2011.igem.org

 

Team:DTU-Denmark/How to customize an iGEM wiki

From 2011.igem.org

How to customize an iGEM wiki

Contents

Sharing is caring

... that's why I created this page. I really hope that you can benefit from it, and that you do not use a lot of time making the same mistakes as I did. Enjoy!

And hey, please do the same thing!

Getting started

So what are this WikiMedia thing, and how do you style it? Here is what you need to know to get startet:

  • First of all, you'll have to learn the MediaWiki-markup, which can be found here.
  • Next, you'll need to know that you do not have access to anything conserning the backend. All you can do to affect the appereance of your wiki, is to insert HTML-code directly the wiki-editor.

"So I need to paste all my styling-code into every single page on the wiki?"

No! Read on...

Using templates

Centralizing the layout using templates

Of course it would be would be pretty annoying if you had to paste your styling-code into every single page. Then you would have to change every single page every time you make a tiny change in the layout. What you can do is to centralize the layout by making use of templates. In this way you can have all your styling and scripting in a template, which can be imported into all the other pages (by manually pasting code into each page unfortunately). This means that the styling and the scripting is completely isolated from the content, and present only one place, meaning that you will only have the make your changes this one place.

How does it work? You just put in this peace of code:

{{< YOUR TEMPLATE GOES HERE >}}

... and then everything from your template is loaded into that particular page.

Example:

{{:Team:DTU-Denmark/Templates/Navigationbar}}

... loads the navigation bar (which consists of this code) into the page.

Helping your team using templates

As you can read in the Help:Templates-section, you can also make templates that takes parameters. This way you can help your team. For instance you kan tell them to write

{{:Team:< TEAM-NAME >/Templates/NiceBox|<title>|<subtile>|<text>|<linkto>}}

... in stead of forcing them to learn everything about the box-model, how floats work and so forth...

iGEMs default styling

When to start styling, you are working on top of iGEMs default layout. This means that, if you do not override an particular rule, e.g. that <h2> is underlined, then <h2> will be underlined on your wiki. It can be helpfull to have a look at the default styling.

Styling the wiki

How to add your stylesheet

You can always links to your own external stylesheet as you are used to:

<link rel="stylesheet" href="< YOUR CSS FILE GOES HERE >" type="text/css" />

But what do you do if you want the locate the css-file on iGEMs server, so that everybody in your team can access it? You simply create a new page, write down the styling as you would do in a normal css-file, and then you use the following code in stead:

<link rel="stylesheet" href="< YOUR PAGE HERE >?action=raw&ctype=text/css" type="text/css" />

Styling tricks

Removing the MediaWiki look

Removes header footer and borders:

#contentSub, #search-controls, .firstHeading, #footer-box, #catlinks, #p-logo {
    display:none;}
#top-section {
    border: none;
    height: 0px;}
#content {
    border: none;}

Redesigning the top menubar

/* Removes "teams" from the menubar */
#menubar > ul > li:last-child {
    display: none;}
/* Resizes the menubar to fik the links (default is 400px) */
#menubar {
    width: auto;}

Here is made the menubar show up only when moving the mouse on top of it:

body {
    margin: 10px 0 0 0;
    padding: 0;}
#top-section {
    width: 965px;
    height: 0;
    margin: 0 auto;
    padding: 0;
    border: none;}
#menubar {
    font-size: 65%;
    top: -14px;}
.left-menu:hover {
    background-color: transparent;}
#menubar li a {
    background-color: transparent;}
#menubar:hover {
    color: white;}
#menubar li a {
    color: transparent;}
#menubar:hover li a {
    color: white;}

Get inspiration in our stylesheet

You can are welcome to take a look in our stylesheet...

jQuery hacks

Remove all empty <p></p> tags

Annoyed of all those <p></p> and <p> </p> emerging everywere in your markup, distroying your layout by adding a bit of vertical space here and there?

They easily emerge when using templates or <html></html> tags. But fortunately they are just as easy to remove. All you need to do, is to paste in this code bit:

<!-- Remove all empty <p> tags -->
<script type="text/javascript">
    $(document).ready(function() {
        $("p").filter( function() {
            return $.trim($(this).html()) == '';
        }).remove()
    });
</script>

LaTeX equations

It is possible to enabled TeX in a MediaWiki (Manual:Math), but unfortunately it doesn't seem like iGEM has done that..

Another way to enable your wiki to display LaTeX equations, is to use MathJax. MathJax is a JavaScript file located at http://cdn.mathjax.org/mathjax/latest/MathJax.js, which reads your document after it has been loaded, and then changes the content of the document according to the notation. That is, it removes everything between any of the following delimiters...

\(...\)
$...$ (if configured)
\[...\]
$$...$$
\begin{?} ... \end{?}

...and replace them with equations. All you need to do is to add the following to your wiki tekst:

<!-- MathJax (LaTeX for the web) -->
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

And if you want to use $...$ delimiters:

<!-- MathJax (LaTeX for the web) -->

<!-- This part is only if you want to use $...$ delimiters -->
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

See documentation here

I never managed to make "\label" and "\ref" work, but a non-tested version of the code, that enables the "\label" and "\ref" commands, can be found on GitHub. The issue is discussed here.

Fix Internet Explorer

Tired of styling for Internet Explorer? Just use this simple fix:

<!-- ie9.js (fixes all Internet Explorer browsers older than ie9) -->
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->