Skip to content

Commit

Permalink
Created custom JSDuck theme, integrated with doc build process.
Browse files Browse the repository at this point in the history
Fixes #108
  • Loading branch information
John Yanarella committed Jul 1, 2013
1 parent d491cb7 commit d7f0395
Show file tree
Hide file tree
Showing 16 changed files with 189 additions and 10 deletions.
13 changes: 13 additions & 0 deletions packages/deft/.jsduck/config.template.json
@@ -0,0 +1,13 @@
{
"--title": "Deft JS - v${deftjs.version} API Documentation",
"--ext-namespaces": "Ext",
"--ignore-global": true,
"--head-html": [
"<link rel=\"stylesheet\" href=\"theme/resources/css/theme.css\" type=\"text/css\" />",
"<script type=\"text/javascript\" src=\"theme/resources/js/theme.js\"></script>"
],
"--output": "docs",
"--": [
"src/js"
]
}
Binary file added packages/deft/.jsduck/theme/favicon.ico
Binary file not shown.
58 changes: 58 additions & 0 deletions packages/deft/.jsduck/theme/resources/css/theme.css
@@ -0,0 +1,58 @@
#loading .logo {
background: url(../images/loading.gif) no-repeat center;
background-size: 64px 64px;
}

#north-region {
background: #4e4e4e; /* Old browsers */
background: -moz-linear-gradient(top, #4e4e4e 0%, #3e3e3e 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4e4e4e), color-stop(100%,#3e3e3e)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #4e4e4e 0%,#3e3e3e 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #4e4e4e 0%,#3e3e3e 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #4e4e4e 0%,#3e3e3e 100%); /* IE10+ */
background: linear-gradient(to bottom, #4e4e4e 0%,#3e3e3e 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4e4e4e', endColorstr='#3e3e3e',GradientType=0 ); /* IE6-9 */
}

#north-region .dropdown {
background-position: center right;
}

#north-region #header-content {
height: 42px;
background: url(../images/logo.png) 0 0 no-repeat;
background-size: 32px 32px;
padding-top: 8px;
padding-left: 38px;
font-size: 16px;
}

#search-container {
margin: 12px 0 0 0 !important;
}

.doctab.overview.classes {
margin-right: 182px;
}

.doctabs .doctab .l {
background: url(../images/tabs.png) no-repeat -8px -141px;
}
.doctabs .doctab .m {
background: url(../images/tabs.png) repeat-x 0 -173px;
}
.doctabs .doctab .r {
background: url(../images/tabs.png) no-repeat 0 -239px;
}

#center-container h1, #center-container h1 .class-source-link {
color: #222222;
}

.class-overview .new-keyword {
color: #3c84c5;
}

a:link, a:visited {
color: #3c84c5;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions packages/deft/.jsduck/theme/resources/js/theme.js
@@ -0,0 +1,12 @@
Ext.define('Docs.view.CustomViewport', {
override: 'Docs.view.Viewport',

initComponent: function () {
this.callParent();

// Resize the north region and header.
var northRegion = Ext.getCmp('north-region');
northRegion.setHeight(80);
northRegion.child('container').setHeight(52);
}
});
22 changes: 17 additions & 5 deletions packages/deft/build.xml
Expand Up @@ -119,13 +119,25 @@

<!-- For some reason, deleting and re-adding the docs folder often causes a write error. A slight delay usually avoids this. -->
<sleep seconds="2" />

<!-- Create updated JSDuck configuration file. -->
<loadfile property="jsduck.config" srcFile=".jsduck/config.template.json">
<filterchain>
<expandproperties/>
</filterchain>
</loadfile>
<echo message="${jsduck.config}" file="jsduck.json" />

<echo message="Generating API documentation..." />

<exec executable="${jsDuckExecutable}" timeout="20000" failonerror="false">
<arg line='--ext-namespaces=Ext --output=docs --ignore-global --title="DeftJS - API Documentation" src/js' />
<arg line='--head-html="&lt;style type=text/css&gt;.class-categories .section .left-column{float:left;width:350px;margin-left:20px} .class-categories .section .middle-column{float:left;width:350px} .class-categories .section .right-column{float:left;width:350px}&lt;/style&gt;"' />
</exec>
<exec executable="${jsDuckExecutable}" timeout="20000" failonerror="false" />

<echo message="Applying custom JSDuck theme..." />
<copy todir="docs" overwrite="true">
<fileset file=".jsduck/theme/favicon.ico"></fileset>
</copy>
<copy todir="docs/theme/resources">
<fileset dir=".jsduck/theme/resources"></fileset>
</copy>

</target>

Expand Down
Binary file modified packages/deft/docs/favicon.ico
Binary file not shown.
11 changes: 6 additions & 5 deletions packages/deft/docs/index.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>DeftJS - API Documentation</title>
<title>Deft JS - v0.9.0pre API Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="fragment" content="!">
Expand All @@ -16,14 +16,15 @@

<script type="text/javascript" src="app-2a09dc1c9acadab58e390b770a9565d0.js"></script>

<style type=text/css>.class-categories .section .left-column{float:left;width:350px;margin-left:20px} .class-categories .section .middle-column{float:left;width:350px} .class-categories .section .right-column{float:left;width:350px}</style>
<link rel="stylesheet" href="theme/resources/css/theme.css" type="text/css" />
<script type="text/javascript" src="theme/resources/js/theme.js"></script>

</head>
<body id="ext-body">

<div id="loading"><span class="title">DeftJS - API Documentation</span><span class="logo"></span></div>
<div id="loading"><span class="title">Deft JS - v0.9.0pre API Documentation</span><span class="logo"></span></div>

<div id="header-content"><strong>DeftJS </strong>API Documentation</div>
<div id="header-content"><strong>Deft JS </strong>v0.9.0pre API Documentation</div>

<div id='categories-content' style='display:none'>
<div class='section'>
Expand Down Expand Up @@ -61,7 +62,7 @@ <h3>Others...</h3>



<div id='footer-content' style='display: none'>Generated on Fri 28 Jun 2013 05:22:03 by <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> 4.10.4.</div>
<div id='footer-content' style='display: none'>Generated on Mon 01 Jul 2013 18:29:02 by <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> 4.10.4.</div>



Expand Down
58 changes: 58 additions & 0 deletions packages/deft/docs/theme/resources/css/theme.css
@@ -0,0 +1,58 @@
#loading .logo {
background: url(../images/loading.gif) no-repeat center;
background-size: 64px 64px;
}

#north-region {
background: #4e4e4e; /* Old browsers */
background: -moz-linear-gradient(top, #4e4e4e 0%, #3e3e3e 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4e4e4e), color-stop(100%,#3e3e3e)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #4e4e4e 0%,#3e3e3e 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #4e4e4e 0%,#3e3e3e 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #4e4e4e 0%,#3e3e3e 100%); /* IE10+ */
background: linear-gradient(to bottom, #4e4e4e 0%,#3e3e3e 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4e4e4e', endColorstr='#3e3e3e',GradientType=0 ); /* IE6-9 */
}

#north-region .dropdown {
background-position: center right;
}

#north-region #header-content {
height: 42px;
background: url(../images/logo.png) 0 0 no-repeat;
background-size: 32px 32px;
padding-top: 8px;
padding-left: 38px;
font-size: 16px;
}

#search-container {
margin: 12px 0 0 0 !important;
}

.doctab.overview.classes {
margin-right: 182px;
}

.doctabs .doctab .l {
background: url(../images/tabs.png) no-repeat -8px -141px;
}
.doctabs .doctab .m {
background: url(../images/tabs.png) repeat-x 0 -173px;
}
.doctabs .doctab .r {
background: url(../images/tabs.png) no-repeat 0 -239px;
}

#center-container h1, #center-container h1 .class-source-link {
color: #222222;
}

.class-overview .new-keyword {
color: #3c84c5;
}

a:link, a:visited {
color: #3c84c5;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions packages/deft/docs/theme/resources/js/theme.js
@@ -0,0 +1,12 @@
Ext.define('Docs.view.CustomViewport', {
override: 'Docs.view.Viewport',

initComponent: function () {
this.callParent();

// Resize the north region and header.
var northRegion = Ext.getCmp('north-region');
northRegion.setHeight(80);
northRegion.child('container').setHeight(52);
}
});
13 changes: 13 additions & 0 deletions packages/deft/jsduck.json
@@ -0,0 +1,13 @@
{
"--title": "Deft JS - v0.9.0pre API Documentation",
"--ext-namespaces": "Ext",
"--ignore-global": true,
"--head-html": [
"<link rel=\"stylesheet\" href=\"theme/resources/css/theme.css\" type=\"text/css\" />\n",
"<script type=\"text/javascript\" src=\"theme/resources/js/theme.js\"></script>"
],
"--output": "docs",
"--": [
"src/js"
]
}

0 comments on commit d7f0395

Please sign in to comment.