mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Improved layout and css of params in the default template.
This commit is contained in:
parent
6b25e91bb0
commit
aef2663dc2
73
main.js
73
main.js
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @project JSDoc
|
||||
* @project jsdoc
|
||||
* @author Michael Mathews <micmath@gmail.com>
|
||||
* @license See LICENSE.md file included in this distribution.
|
||||
*/
|
||||
@ -8,11 +8,17 @@
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
||||
|
||||
/** @global */
|
||||
/** The absolute path to the base directory of the jsdoc application.
|
||||
@type string
|
||||
@global
|
||||
*/
|
||||
const BASEDIR = arguments[0].replace(/([\/\\])main\.js$/, '$1'); // jsdoc.jar sets argument[0] to the abspath to main.js
|
||||
|
||||
/** @global */
|
||||
function require(id) { // like commonjs
|
||||
/** Include a JavaScript module, defined in the CommonJS way.
|
||||
@global
|
||||
@param {string} id The identifier of the module you require.
|
||||
*/
|
||||
function require(id, encoding) { // like commonjs
|
||||
var path = require.base + id + '.js',
|
||||
fileContent = '';
|
||||
|
||||
@ -47,18 +53,41 @@ require.cache = {}; // cache module exports. Like: {id: exported}
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
||||
|
||||
/** @global */
|
||||
/** Data representing the environment in which this app is running.
|
||||
@namespace
|
||||
*/
|
||||
env = {
|
||||
/** Running start and finish times. */
|
||||
run: {
|
||||
start: new Date(),
|
||||
finish: null
|
||||
},
|
||||
|
||||
/**
|
||||
The command line arguments passed into jsdoc.
|
||||
@type Array
|
||||
*/
|
||||
args: Array.prototype.slice.call(arguments, 1), // jsdoc.jar adds argument[0], the abspath to main.js, user args follow
|
||||
|
||||
|
||||
/**
|
||||
The parsed JSON data from the configuration file.
|
||||
@type Object
|
||||
*/
|
||||
conf: {},
|
||||
|
||||
/**
|
||||
The command line arguments, parsed into a key/value hash.
|
||||
@type Object
|
||||
@example if (env.opts.help) { print 'Helpful message.'; }
|
||||
*/
|
||||
opts: {}
|
||||
};
|
||||
|
||||
/** @global */
|
||||
/**
|
||||
Data that must be shared across the entire application.
|
||||
@namespace
|
||||
*/
|
||||
app = {
|
||||
jsdoc: {
|
||||
scanner: new (require('jsdoc/src/scanner').Scanner)(),
|
||||
@ -70,21 +99,29 @@ app = {
|
||||
try { main(); }
|
||||
finally { env.run.finish = new Date(); }
|
||||
|
||||
/** @global */
|
||||
function print(/*...*/) {
|
||||
/** Print string/s out to the console.
|
||||
@param {string} ... String/s to print out to console.
|
||||
*/
|
||||
function print() {
|
||||
for (var i = 0, leni = arguments.length; i < leni; i++) {
|
||||
java.lang.System.out.println('' + arguments[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/** @global */
|
||||
function dump(/*...*/) {
|
||||
/**
|
||||
Try to recursively print out all key/values in an object.
|
||||
@global
|
||||
@param {Object} ... Object/s to dump out to console.
|
||||
*/
|
||||
function dump() {
|
||||
for (var i = 0, leni = arguments.length; i < leni; i++) {
|
||||
print( require('common/dumper').dump(arguments[i]) );
|
||||
}
|
||||
}
|
||||
|
||||
/** @global */
|
||||
/** @global
|
||||
@param {string} filepath The path to the script file to include (read and execute).
|
||||
*/
|
||||
function include(filepath) {
|
||||
try {
|
||||
load(BASEDIR + filepath);
|
||||
@ -94,16 +131,22 @@ function include(filepath) {
|
||||
}
|
||||
}
|
||||
|
||||
/** @global */
|
||||
function exit(v) {
|
||||
java.lang.System.exit(v);
|
||||
/**
|
||||
Cause the VM running jsdoc to exit running.
|
||||
@param {number} [n = 0] The exit status.
|
||||
*/
|
||||
function exit(n) {
|
||||
n = n || 0;
|
||||
java.lang.System.exit(n);
|
||||
}
|
||||
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
||||
|
||||
/** @global */
|
||||
/**
|
||||
Run the jsoc application.
|
||||
*/
|
||||
function main() {
|
||||
var sourceFiles,
|
||||
docs,
|
||||
|
||||
@ -52,8 +52,6 @@
|
||||
function walk(object) {
|
||||
var value;
|
||||
|
||||
|
||||
|
||||
if ( value = getValue(object) ) {
|
||||
output += value + ',\n';
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"repositories": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "http://github.com/micmath/JSDoc"
|
||||
"url": "http://github.com/micmath/jsdoc"
|
||||
}
|
||||
],
|
||||
"contributors" : [
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
.function { color: #666; }
|
||||
|
||||
.access { color: #666; }
|
||||
|
||||
/*
|
||||
.symbol-head
|
||||
{
|
||||
margin-top: 8px;
|
||||
@ -27,9 +27,7 @@
|
||||
background-color: #B8B9CB;
|
||||
}
|
||||
|
||||
.detail-list {
|
||||
list-style-type:none;
|
||||
}
|
||||
|
||||
|
||||
.symbol-head .summary {
|
||||
font-style: italic;
|
||||
@ -40,6 +38,128 @@
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
.detail-list {
|
||||
list-style-type:none;
|
||||
}
|
||||
|
||||
html {
|
||||
/* stops IE resizing fonts by a massive amount */
|
||||
font-size: 100%
|
||||
}
|
||||
body {
|
||||
/* pixes monospace font sizes in webkit */
|
||||
font-size: 10px;
|
||||
/* following line is picked up by IE6 & 7, which cannot resize pixel-based font sizes */
|
||||
*font-size: 62.5%;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 0.8em;
|
||||
font-family: verdana, sans-serif;
|
||||
/*overflow: hidden;*/
|
||||
zoom: 1;
|
||||
background: url(images/pagebg.png) 0 73px repeat-x;
|
||||
color: #333333;
|
||||
}
|
||||
a:link, a:visited {
|
||||
color: #356a8b;
|
||||
text-decoration: none;
|
||||
border-bottom: 1px dotted #356a8b;
|
||||
}
|
||||
a:hover, a:active {
|
||||
color: #3B607B;
|
||||
border-color: #3B607B;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
a.image {
|
||||
border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
font-family: arial, sans-serif;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.7em;
|
||||
margin: 0 0 1em 0;
|
||||
font-family: arial, sans-serif;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.4em;
|
||||
margin: 0.4em 0;
|
||||
font-family: arial, sans-serif;
|
||||
color: #4e4e4e;
|
||||
}
|
||||
h4 {
|
||||
margin: 1em 0;
|
||||
color: #3B607B;
|
||||
}
|
||||
h5 {
|
||||
margin: 1em 0;
|
||||
}
|
||||
p {
|
||||
margin: 0 0 1em 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
dl.params dt {
|
||||
border-top: 1px solid #b2b1b1;
|
||||
color: #3B607B;
|
||||
font-weight: bold;
|
||||
padding-top: 8px;
|
||||
margin-bottom: 5px;
|
||||
font-size: 1.1em;
|
||||
float: none;
|
||||
overflow: visible;
|
||||
zoom: 0;
|
||||
}
|
||||
|
||||
dl.params dt.first {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
dl.params dd {
|
||||
border-width: 0;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
dl.param-properties {
|
||||
font-style: italic;
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
font-size: 0.9em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
dl.param-properties dt span,
|
||||
dl.param-properties dd {
|
||||
color: #555;
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: inline;
|
||||
margin-bottom: 5px;
|
||||
font-size: 1em;
|
||||
border: none;
|
||||
}
|
||||
dl.param-properties dt {
|
||||
clear: both;
|
||||
display: inline;
|
||||
font-size: 1em;
|
||||
padding: 0;
|
||||
float: none;
|
||||
overflow: visible;
|
||||
zoom: 0;
|
||||
}
|
||||
dl.param-properties dt span {
|
||||
width: 85px;
|
||||
clear: both;
|
||||
}
|
||||
dl.param-properties dd.optionalDef {
|
||||
text-indent: -5000px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@ -73,9 +193,9 @@
|
||||
|
||||
{{#hasParams}}
|
||||
<h3>Parameters:</h3>
|
||||
<ol class="params detail-list">
|
||||
<dl class="params detail-list">
|
||||
{{#params}} {{>param}} {{/params}}
|
||||
</ol>
|
||||
</dl>
|
||||
{{/hasParams}}
|
||||
|
||||
{{#returns}}
|
||||
|
||||
@ -1,8 +1,19 @@
|
||||
<li>
|
||||
{{#type}}
|
||||
{
|
||||
{{#names}}<span class="param-type">{{last}}{{#linkTo}}{{.}}{{/linkTo}}</span>{{^last?}} | {{/last?}}{{#last?}} {{/last?}}{{/names}}
|
||||
}
|
||||
{{/type}}
|
||||
<span class="param-name">{{name}}</span>
|
||||
</li>
|
||||
<dt{{#first?}} class="first"{{/first?}}><span class="param-name">{{name}}</span></dt>
|
||||
<dd>
|
||||
<dl class="param-properties">
|
||||
{{#type}}
|
||||
<dt><span>Type</span></dt>
|
||||
<dd>{{#names}}<span class="param-type">{{#linkTo}}{{.}}{{/linkTo}}</span>{{^last?}} | {{/last?}}{{#last?}} {{/last?}}{{/names}}</dd>
|
||||
{{/type}}
|
||||
{{#defaultvalue}}
|
||||
<dt><span>Default</span></dt>
|
||||
<dd>{{defaultvalue}}</dd>
|
||||
{{/defaultvalue}}
|
||||
{{#optional}}
|
||||
<dt><span>Optional</span></dt>
|
||||
<dd class="optionalDef">Yes</dd>
|
||||
{{/optional}}
|
||||
</dl>
|
||||
|
||||
<div class="param-desc">{{description}}</div>
|
||||
</dd>
|
||||
0
test/cases/src/dir1/three.js
Normal file
0
test/cases/src/dir1/three.js
Normal file
0
test/cases/src/ignored.txt
Normal file
0
test/cases/src/ignored.txt
Normal file
0
test/cases/src/one.js
Normal file
0
test/cases/src/one.js
Normal file
0
test/cases/src/two.js
Normal file
0
test/cases/src/two.js
Normal file
Loading…
x
Reference in New Issue
Block a user