diff --git a/docs/create.js b/docs/create.js index 2e0df72..43eb893 100644 --- a/docs/create.js +++ b/docs/create.js @@ -52,15 +52,26 @@ glob(match, function(er, files){ } }); - var output = "\n\n\n\n\n\n\n\n\n"; - output += "\n\n\n"; for(var section in docs){ if(!docs.hasOwnProperty(section)){ @@ -68,8 +79,19 @@ glob(match, function(er, files){ } methods = docs[section]; - output += "
\n"; - output += "

" + section + "

\n"; + output += "
\n"; + output += "
\n

" + section + "

\n"; + + output += "\n"; + for(var name in methods){ if(!methods.hasOwnProperty(name)){ continue; @@ -77,33 +99,42 @@ glob(match, function(er, files){ doc = methods[name]; var className = section + "-" + name; - output += "
\n"; + output += "
\n"; + + var definition = name + "("; + if(doc.params && typeof doc.params === "object"){ + definition += Object.keys(doc.params).join(", "); + } + definition += ")"; - output += "

" + name + "

\n"; - output += "
\n"; - output += "
\n"; + output += "

" + definition + "

\n"; + output += "
\n"; output += doc.comment; - output += "

Parameters:

\n"; - for(var param in doc.params){ - if(!doc.params.hasOwnProperty(param)){ - continue; + if(doc.params){ + output += "

Parameters:

\n"; + output += "
\n"; + for(var param in doc.params){ + if(!doc.params.hasOwnProperty(param)){ + continue; + } + var comment = doc.params[param]; + output += "
" + param + "
\n"; + output += "
" + comment + "
\n"; } - var comment = doc.params[param]; - output += "
" + param + "
\n"; - output += comment; + output += "
\n"; } output += "
\n"; - output += "
\n"; + output += "
\n"; output += doc.example; output += "
\n"; output += "
\n"; - output += "
\n"; - } output += "
\n"; } + output += "\n"; + output += "\"Fork"; output += ""; console.log(output); }); diff --git a/docs/styles.css b/docs/styles.css deleted file mode 100644 index e758e2c..0000000 --- a/docs/styles.css +++ /dev/null @@ -1,49 +0,0 @@ - -h2 { - width: 100%; - font-size: 2em; - background-color: #eee; -} - -h3 { - width: 100%; - font-size: 1.5em; -} - -.function { - border-top: solid 1px #eee; -} - -.function .container { - display: flex; -} - -.function .doc { - width: 50%; -} - -.function .doc p { - text-indent: 1.5em; -} - -.function .example { - width: 50%; - flex-grow: 2; - flex-basis: auto; - overflow-x: scroll; -} - -.function .example code { - border-radius: 5px; - border: solid 1px #000; -} - -@media all and (max-width: 800px) { - .function .container { - flex-direction: column; - } - - .function .doc, .function .example { - width: 100%; - } -}