cbou / markdox

Markdox is a documentation generator based on Dox and Markdown. It parse Javascript and even Coffeescript.
http://cbou.github.com/markdox
230 stars 27 forks source link

Markdox not working? #24

Closed tihomir-kit closed 9 years ago

tihomir-kit commented 9 years ago

Am I doing something wrong here or is markdox not working?

I installed markdox through npm, downloaded this fixture (I assume this is like a sample source file?) and after that I ran markdox dox-parser.js from the folder where dox-parser.js was located.

A file named output.md got generated but it contained this:

<? docfiles.forEach(function(doc) { ?>

<!-- Start <?= doc.filename ?> -->

<? doc.javadoc.forEach(function(comment) { ?>
<? if (!comment.ignore) { ?>
<? if (comment.name) { ?>
<? if (comment.isMethod || comment.isFunction) { ?>
## <?= comment.name ?>(<?= comment.paramStr ?>)
<? } else { ?>
## <?= comment.name ?>
<? } ?>
<? } ?>

<?= comment.description ?>

<? if (comment.deprecated) { ?>
**Deprecated**
<? } ?>

<? if (comment.author) { ?>
Author: <?- comment.author ?>
<? } ?>

<? if (comment.version) { ?>
Version: <?= comment.version ?>
<? } ?>

<? if (comment.see) { ?>
See: <?= comment.see ?>
<? } ?>

<? if (comment.paramTags.length > 0) { ?>
### Params:
<? comment.paramTags.forEach(function(paramTag) { ?>
* **<?= paramTag.joinedTypes ?>** *<?= paramTag.name ?>* <?= paramTag.description ?><? }) ?>
<? } ?>

<? if (comment.returnTags.length > 0) { ?>
### Return:
<? comment.returnTags.forEach(function(returnTag) { ?>
* **<?= returnTag.joinedTypes ?>** <?= returnTag.description ?>
<? }) ?>
<? } ?>
<? } ?>
<? }) ?>

<!-- End <?= doc.filename ?> -->

<? }) ?>

Can you please tell me if I missed something here?

Thanks

phun-ky commented 9 years ago

I have the same exact issue, with both v0.1.4 and v0.1.7. I'm very glad that I was not the only one with this!

Can we please fix this?!

phun-ky commented 9 years ago

I think it as something to do with https://github.com/tj/ejs, but I can't seem to narrow it down to the exact point. It looks like the template wont be compiled/rendered.

copy commented 9 years ago

For some reason, ejs seems to be ignoring the ejs.open and ejs.close properties. This can be fixed by grabbing the 1.0 version of ejs from https://github.com/tj/ejs (throw it into markdox/node_modules)

eranimo commented 9 years ago

Can we get a bower update using ejs version 1.0?

jtuulos commented 9 years ago

I just issued a PR to fix the dependency: https://github.com/cbou/markdox/pull/26

A temporary local fix is shrinkwrapping your markdox dependency:

  1. Run npm shrinkwrap [--dev] (the flag is required if markdox is a devDependency)
  2. Optional: Remove all other packages but markdox in the resulting file, npm-shrinkwrap.json (but keep anything under markdox.dependencies)
  3. Find ejs under markdox.dependencies and change the version from 2.1.4 to 1.0.0 (example below)
  4. Remove the currently installed markdox: npm remove markdox
  5. Run npm install without parameters, the shrinkwrapped version with ejs@1.0.0 should now be installed
"ejs": {
  "version": "1.0.0",
  "from": "ejs@>=0.7.2",
  "resolved": "https://registry.npmjs.org/ejs/-/ejs-1.0.0.tgz"
},
blainsmith commented 9 years ago

Thanks for the fix @jtuulos

cbou commented 9 years ago

Thanks for the PR. Sorry for not having time to look at this. The fix is now published on npm.