-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
113 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var express = require('express'); | ||
var app = express(); | ||
|
||
var program = require('commander'); | ||
var Deep = require("./lib/deep.js"); | ||
var renderer = require("./lib/render.js"); | ||
var path = require("path"); | ||
|
||
var marked = require('marked'); | ||
|
||
// Outputs: <p>I am using <strong>markdown</strong>.</p> | ||
|
||
// output = output.replace(/^\s*[\r\n]/gm, ""); | ||
|
||
app.get('/', function (req, res) { | ||
var inputFilename = "./use-case-main.js"; | ||
var deep = new Deep(inputFilename); | ||
console.log("processing \"" + inputFilename + "\"..."); | ||
deep.parse(); | ||
var outputFilename = "use-case-main.js.MD"; | ||
var output = renderer.render("./template/markdown.MD", {definitions: deep.definitions, outputFilename:path.basename(outputFilename)}, program.describe); | ||
output = marked(output.replace(/\t/g, "")); | ||
res.send("<!DOCTYPE html><html><head><title></title></head><body>" + output + "</body></html>"); | ||
}); | ||
|
||
app.listen(process.env.PORT || 3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
<% deep.definitions.forEach(function(definition){ %> | ||
## ```<%= definition.name %>``` <% if (definition.extends) { %>Extends [<%= definition.extends.name %>](<%= deep.outputFilename %>#<%= definition.extends.name_lower %>) <% } %><% if (definition.construct) { %>Contructor [<%= definition.construct.name %>](<%= deep.outputFilename %>#<%= definition.construct.name_lower %>) <% } %> | ||
## ```<%= definition.name %>``` | ||
<% if (definition.extends) { -%> | ||
Extends [<%= definition.extends.name %>](<%= deep.outputFilename %>#<%= definition.extends.name_lower %>) | ||
<% } -%> | ||
<% if (definition.construct) { %> | ||
Contructor [<%= definition.construct.name %>](<%= deep.outputFilename %>#<%= definition.construct.name_lower -%>) | ||
<% } -%> | ||
|
||
<% if (definition.comments) { %> | ||
> <%= definition.comments %> | ||
<% } %> | ||
|
||
|
||
<% if (definition.parms.length > 0) { %> | ||
Arguments: | ||
> Arguments: | ||
<% definition.parms.forEach(function(parm){ %> | ||
***<%= parm.name %>*** ```<%= parm.type %>``` | ||
>> ***<%= parm.name %>*** ```<%= parm.type %>``` | ||
<% }) %> | ||
<% } %> | ||
|
||
<% if (definition.methods.length > 0) { %> | ||
|
||
<% definition.methods.forEach(function(method){ %> | ||
### <%= definition.name %>.<%= method.name %>( | ||
<% if (method.parms.length > 0) { %> <% method.parms.forEach(function(parm){ %> ***<%= parm.name %>*** ```<%= parm.type %>``` <% }) %> <% } %> | ||
) | ||
<% }) %> | ||
<% } %> | ||
<% }) %> | ||
### <%= definition.name %>.<%= method.name %>() | ||
<% if (method.parms.length > 0) { %> | ||
<% method.parms.forEach(function(parm){ %> | ||
> ***<%= parm.name %>*** ```<%= parm.type %>``` | ||
<% }) -%> | ||
<% } -%> | ||
<% }) -%> | ||
<% } -%> | ||
<% }) -%> |