Skip to content

Commit 3ecf395

Browse files
committed
fixed package.json conflict
1 parent 8e8aa06 commit 3ecf395

File tree

8 files changed

+84
-3
lines changed

8 files changed

+84
-3
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const vueDataTag = require('./lib/tags/vue-data');
88
const vuePropTag = require('./lib/tags/vue-prop');
99
const vueComputedTag = require('./lib/tags/vue-computed');
1010
const vueEventTag = require('./lib/tags/vue-event');
11+
const vueSlotTag = require('./lib/tags/vue-slot');
1112

1213
// Used to compute good line number for Vue methods
1314
const exportDefaultLines = {};
@@ -54,6 +55,7 @@ exports.handlers = {
5455
data: e.doclet._vueData || [],
5556
computed: e.doclet._vueComputed || [],
5657
event: e.doclet._vueEvent || [],
58+
slots: e.doclet._vueSlots || []
5759
};
5860

5961
render(template, data, (err, str) => {
@@ -86,4 +88,5 @@ exports.defineTags = function defineTags(dictionary) {
8688
dictionary.defineTag(vuePropTag.name, vuePropTag.options);
8789
dictionary.defineTag(vueComputedTag.name, vueComputedTag.options);
8890
dictionary.defineTag(vueEventTag.name, vueEventTag.options);
91+
dictionary.defineTag(vueSlotTag.name,vueSlotTag.options);
8992
};

lib/core/renderer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const ejs = require('ejs');
22
const renderType = require('../templates/utils/renderType');
33

44
module.exports = function render(template, {
5-
props, data, computed, event,
5+
props, data, computed, event, slots,
66
}, cb) {
77
ejs.renderFile(
88
template,
@@ -12,6 +12,7 @@ module.exports = function render(template, {
1212
data,
1313
computed,
1414
event,
15+
slots
1516
},
1617
cb,
1718
);

lib/tags/vue-slot.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
exports.name = 'vue-slot';
2+
3+
exports.options = {
4+
canHaveName: true,
5+
onTagged(doclet, tag) {
6+
doclet._isVueDoc = true;
7+
doclet._vueSlots = doclet._vueSlots || [];
8+
doclet._vueSlots.push(tag.value || {});
9+
},
10+
};

lib/templates/default.ejs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,21 @@
7979
</table>
8080
<% } %>
8181
82+
<% if(slots.length > 0) { %>
83+
<h3 class="subsection-title" style="margin-top: 1em" data-jsdoc-vuejs="section-event">Slots</h3>
84+
<table data-jsdoc-vuejs="table-event">
85+
<thead>
86+
<tr>
87+
<th>Name</th>
88+
<th>Description</th>
89+
</tr>
90+
</thead>
91+
<tbody><% slots.forEach(function(c) { %><tr>
92+
<td><code><%- c.name %></code></td>
93+
<td><%- typeof c.description === 'undefined' ? '-' : c.description %></td>
94+
</tr><% }) %></tbody>
95+
</table>
96+
<% } %>
97+
98+
8299
<div class="container-overview"><div><p> <%# Re-open JSDoc template tags %>

lib/templates/docstrap.ejs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,20 @@
7878
</table>
7979
<% } %>
8080
81+
<% if(slots.length > 0) { %>
82+
<h3 class="subsection-title" style="margin-top: 1em" data-jsdoc-vuejs="section-event">Slots</h3>
83+
<table data-jsdoc-vuejs="table-event" class="table table-responsive table-hover table-striped">
84+
<thead>
85+
<tr>
86+
<th>Name</th>
87+
<th>Description</th>
88+
</tr>
89+
</thead>
90+
<tbody><% slots.forEach(function(c) { %><tr>
91+
<td><code><%- c.name %></code></td>
92+
<td><%- typeof c.description === 'undefined' ? '-' : c.description %></td>
93+
</tr><% }) %></tbody>
94+
</table>
95+
<% } %>
96+
8197
<div class="container-overview"><div><p> <%# Re-open JSDoc template tags %>

lib/templates/minami.ejs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,20 @@
7878
</table>
7979
<% } %>
8080
81+
<% if(slots.length > 0) { %>
82+
<h3 class="subsection-title" style="margin-top: 1em" data-jsdoc-vuejs="section-event">Slots</h3>
83+
<table class="params" data-jsdoc-vuejs="table-event">
84+
<thead>
85+
<tr>
86+
<th>Name</th>
87+
<th>Description</th>
88+
</tr>
89+
</thead>
90+
<tbody><% slots.forEach(function(c) { %><tr>
91+
<td><code><%- c.name %></code></td>
92+
<td><%- typeof c.description === 'undefined' ? '-' : c.description %></td>
93+
</tr><% }) %></tbody>
94+
</table>
95+
<% } %>
96+
8197
<div class="container-overview"><div><p> <%# Re-open JSDoc template tags %>

lib/templates/tui.ejs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,22 @@
9999
</div>
100100
<% } %>
101101
102+
<% if(slots.length > 0) { %>
103+
<h3 class="subsection-title" style="margin-top: 1em" data-jsdoc-vuejs="section-event">Slots</h3>
104+
<div class="container-params">
105+
<table class="params" data-jsdoc-vuejs="table-event">
106+
<thead>
107+
<tr>
108+
<th>Name</th>
109+
<th class="last">Description</th>
110+
</tr>
111+
</thead>
112+
<tbody><% slots.forEach(function(c) { %><tr>
113+
<td class="name"><code><%- c.name %></code></td>
114+
<td class="description last"><%- typeof c.description === 'undefined' ? '-' : c.description %></td>
115+
</tr><% }) %></tbody>
116+
</table>
117+
</div>
118+
<% } %>
119+
102120
<div class="container-overview"><div><p> <%# Re-open JSDoc template tags %>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "jsdoc-vue",
3-
"version": "0.0.0-development",
2+
"name": "@djtorrey/jsdoc-vue3",
3+
"version": "0.0.2-development",
44
"description": "A JSDoc plugin for documenting vue 3 files.",
55
"main": "index.js",
66
"files": [

0 commit comments

Comments
 (0)