softdevstory / node-apidoc-markdown Goto Github PK
View Code? Open in Web Editor NEWThis project forked from martinj/node-apidoc-markdown
Generate API documentation in markdown from apidoc data
This project forked from martinj/node-apidoc-markdown
Generate API documentation in markdown from apidoc data
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 ๐
Hi, should be great to support this tag:
http://apidocjs.com/#param-api-param-example
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
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)
Hi, i got a warning with your package that is using a very old version of ejs that have some security issues.
warning apidoc-markdown2 > [email protected]: Critical security bugs fixed in 2.5.5
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.