Commit da736038 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Syntax highlighting for code examples.

Using the same prettify.js that we use in source/.

For links inside code examples force showing of underlines -
otherwise prettify will make the links undistinguishable from
other source.
parent 59e59cb9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7,11 +7,13 @@
<link rel="stylesheet" type="text/css" href="resources/css/xtheme-gray.css" />
<link rel="stylesheet" type="text/css" href="resources/docs.css" />
<link rel="stylesheet" type="text/css" href="resources/style.css" />
<link rel="stylesheet" type="text/css" href="resources/prettify/prettify.css" />
<link rel="shortcut icon" href="resources/favicon.ico" />
<link rel="icon" href="resources/favicon.ico" />
<script type="text/javascript" src="resources/ext-base.js"></script>
<script type="text/javascript" src="resources/ext-all.js"></script>
<script type="text/javascript" src="resources/TabCloseMenu.js"></script>
<script type="text/javascript" src="resources/prettify/prettify.js"></script>
<script type="text/javascript" src="resources/docs.js"></script>
<script type="text/javascript" src="output/tree.js"></script>
</head>
+14 −5
Original line number Diff line number Diff line
@@ -213,6 +213,13 @@ DocPanel = Ext.extend(Ext.Panel, {
                tr.highlight('#cadaf9');
            }
        }
    },

    // Marks all code examples with "prettyprint" class.
    // Then runs the prettify library on the whole document.
    prettyPrint : function(){
        Ext.select("pre > code", this.el).addClass("prettyprint lang-js");
        prettyPrint();
    }
});

@@ -314,12 +321,14 @@ Ext.extend(MainPanel, Ext.TabPanel, {
                tab.scrollToMember(member);
            }
        }else{
            var autoLoad = {url: href};
            if(member){
                autoLoad.callback = function(){
                    Ext.getCmp(id).scrollToMember(member);
                }
            var autoLoad = {
                url: href,
                callback: function(){
                    var tab = Ext.getCmp(id);
                    tab.prettyPrint();
                    member && tab.scrollToMember(member);
                }
            };
            var p = this.add(new DocPanel({
                id: id,
                cclass : cls,
+3 −16
Original line number Diff line number Diff line
@@ -251,21 +251,8 @@
    color: #000;
    line-height: 16px !important;
}
    .body-wrap pre code b {
        font-weight: normal;
        color: #800080;
    }
    .body-wrap pre code em {
        font-weight: normal;
        color: #008080;
        background-color:#eee;
    }
    .body-wrap pre code i,
    .body-wrap pre code i b,
    .body-wrap pre code i em {
        font-weight: normal;
        font-style: normal;
        color: #999;
.body-wrap pre code a {
    text-decoration: underline !important;
}

/* Hide long descriptions initially */