Skip to content

Instantly share code, notes, and snippets.

@lmullen
Created September 1, 2014 20:49
Show Gist options
  • Save lmullen/e2d2d4aabf84220c517a to your computer and use it in GitHub Desktop.
Save lmullen/e2d2d4aabf84220c517a to your computer and use it in GitHub Desktop.

Revisions

  1. lmullen created this gist Sep 1, 2014.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    The file `page.st` goes in the `templates/` directory in the Gitit wiki home directory. You'll put the Ace JavaScript and CSS files in `static/`.
    81 changes: 81 additions & 0 deletions page.st
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,81 @@
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="icon" sizes="128x128" href="$base$/img/favicon.png">
    $if(feed)$
    <link href="$base$/_feed/" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed" />
    <link href="$base$/_feed$pageUrl$" type="application/atom+xml" rel="alternate" title="This page's ATOM Feed" />
    $endif$
    <title>$wikititle$ - $pagetitle$</title>
    $if(printable)$
    <link href="$base$/css/print.css" rel="stylesheet" media="all" type= "text/css" />
    $else$
    <link href="$base$/css/custom.css" rel="stylesheet" media="screen, projection" type="text/css" />
    <link href="$base$/css/print.css" rel="stylesheet" media="print" type= "text/css" />
    $endif$
    <!--[if IE]><link href="$base$/css/ie.css" rel="stylesheet" media="screen, projection" type="text/css" /><![endif]-->
    </head>
    <body>
    <div id="doc3" class="yui-t1">
    <div id="yui-main">
    <div id="maincol" class="yui-b">
    $userbox()$
    $tabs$
    $content()$
    $footer()$
    </div>
    </div>
    <div id="sidebar" class="yui-b first">
    $logo()$
    $if(sitenav)$
    $sitenav()$
    $endif$
    $if(pagetools)$
    $pagetools()$
    $endif$
    $if(markuphelp)$
    $markuphelp()$
    $endif$
    </div>
    </div>
    $javascripts$
    $expire()$
    $getuser()$

    <style type="text/css" media="screen">
    #editor {
    height: 350px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: Monaco, "Liberation Mono", Courier, monospace;
    }
    #editedText {
    visibility: hidden;
    display: none;
    }
    </style>
    <script src="$base$/js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
    <script>
    var ta = document.getElementById("editedText");
    var editorDiv = document.createElement("div");
    editorDiv.setAttribute("id", "editor");
    ta.parentNode.insertBefore(editorDiv, ta.nextSibling);
    var editor = ace.edit(editorDiv);
    editor.getSession().setValue(ta.value);
    editor.getSession().on('change', function(){
    ta.value = editor.getSession().getValue();
    });
    editor.setTheme("ace/theme/github");
    editor.getSession().setMode("ace/mode/markdown");
    editor.setHighlightActiveLine(false);
    editor.setShowPrintMargin(false);
    editor.getSession().setUseWrapMode(true);
    editor.setKeyboardHandler("ace/keyboard/vim");
    editor.focus();
    </script>
    </body>
    </html>