GithubHelp home page GithubHelp logo

softdevstory / node-apidoc-markdown Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martinj/node-apidoc-markdown

9.0 9.0 10.0 22 KB

Generate API documentation in markdown from apidoc data

JavaScript 100.00%

node-apidoc-markdown's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @softdevstory
  • ๐Ÿ‘€ Iโ€™m interested in ...
  • ๐ŸŒฑ Iโ€™m currently learning ...
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on ...
  • ๐Ÿ“ซ How to reach me ...

node-apidoc-markdown's People

Contributors

fastman avatar ikarus512 avatar lrills avatar martinj avatar saschak094 avatar softdevstory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

node-apidoc-markdown's Issues

Use template-literal instead of EJS

Template Literal is fastest, smallest and simplest template engine, because it use JS's literal template feature.

It's 55 times faster than EJS, and it also use less CPU and RAM ressources, so it may be a good idea to use it instead of EJS ๐Ÿ˜€

TOC links do not work

Hi.

In my process, I use apidoc and apidoc-markdown2 to generate API-related .md-files that are passed to jsdoc as tutorials. But the resulting API-related pages, contain TOC with links to API entries descriptions that do not work. Could you fix it?

In fact, I found the following fix, and do it in my local repository. The fix is as follows:
in file node_modules/apidoc-markdown2/templates/default.md
replace string:
# <%= group %>
by string:
# <%= group %> <a name='<%=: group | mlink %>'></a>
and replace:
## <%= data[group][sub][0].title %>
by:
## <%= data[group][sub][0].title %> <a name='<%=: data[group][sub][0].title | mlink %>'></a>

Thanks,
ikarus512.

Template not copied when installing with YARN

When installing with yarn:
yarn add --dev apidoc-markdown2 not all files from the templates directory are copied to the according node_modules/apidoc-markdown2/templates folder (the default.md is missing).

When using npm install --dev apidoc-markdown2 the file is there.

Using:
Node v8.1.3
Yarn 0.27.5
NPM 5.0.3

The file is required when I want to run apidoc -i lib/ -o apidoc/ && apidoc-markdown2 -p apidoc/ -o apidoc/api_doc.md

Cheers

Cannot convert undefined or null to object

Hello, I have got an error,

apidoc-markdown2 -p test -o api.rd

undefined:25
  throw err;
  ^

TypeError: ejs:37
    35| <% }); //forech parameter -%>
    36| <% } //if parameters -%>
 >> 37|
    38| <% if (data[group][sub][0].header && data[group][sub][0].header.examples && data[group][sub][0].header.examples.length) { -%>
    39|
    40| ### Header Examples

Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at eval (eval at exports.compile (C:\Users\name\AppData\Roaming\npm\node_modules\apidoc-markdown2\node_modules\ejs\lib\ejs.js:237:14), <anonymous>:34:116)
    at Array.forEach (<anonymous>)
    at eval (eval at exports.compile (C:\Users\name\AppData\Roaming\npm\node_modules\apidoc-markdown2\node_modules\ejs\lib\ejs.js:237:14), <anonymous>:30:958)
    at Array.forEach (<anonymous>)
    at eval (eval at exports.compile (C:\Users\name\AppData\Roaming\npm\node_modules\apidoc-markdown2\node_modules\ejs\lib\ejs.js:237:14), <anonymous>:30:833)
    at eval (eval at exports.compile (C:\Users\name\AppData\Roaming\npm\node_modules\apidoc-markdown2\node_modules\ejs\lib\ejs.js:237:14), <anonymous>:48:19)
    at C:\Users\name\AppData\Roaming\npm\node_modules\apidoc-markdown2\node_modules\ejs\lib\ejs.js:250:15
    at Object.<anonymous> (C:\Users\name\AppData\Roaming\npm\node_modules\apidoc-markdown2\index.js:88:31)
    at Module._compile (module.js:643:30)

Exception building the markdown

While building the markdown document with the apidoc generated files a exception occurs due to a missing if condition

  throw err;
  ^

TypeError: ejs:27
    25| 
    26| 	<%-: data[group][sub][0].type | upcase %> <%= data[group][sub][0].url %>
 >> 27| 
    28| <% if (data[group][sub][0].header && data[group][sub][0].header.fields.Header.length) { -%>
    29| ### Headers
    30| 

Cannot read property 'length' of undefined
    at eval (eval at exports.compile (/Users/sascha.kerbler/Documents/workspace/kfw-project/kfw-chain-api/node_modules/ejs/lib/ejs.js:237:14), <anonymous>:32:106)
    at Array.forEach (native)
    at eval (eval at exports.compile (/Users/sascha.kerbler/Documents/workspace/kfw-project/kfw-chain-api/node_modules/ejs/lib/ejs.js:237:14), <anonymous>:30:958)
    at Array.forEach (native)
    at eval (eval at exports.compile (/Users/sascha.kerbler/Documents/workspace/kfw-project/kfw-chain-api/node_modules/ejs/lib/ejs.js:237:14), <anonymous>:30:833)
    at eval (eval at exports.compile (/Users/sascha.kerbler/Documents/workspace/kfw-project/kfw-chain-api/node_modules/ejs/lib/ejs.js:237:14), <anonymous>:48:19)
    at /Users/sascha.kerbler/Documents/workspace/kfw-project/kfw-chain-api/node_modules/ejs/lib/ejs.js:250:15
    at Object.<anonymous> (/Users/sascha.kerbler/Documents/workspace/kfw-project/kfw-chain-api/node_modules/apidoc-markdown2/index.js:88:31)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
error Command failed with exit code 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.