Skip to content

Commit 1be0473

Browse files
authored
Merge pull request #72 from Kocal/fix/71
fix: include methods in generated documentation
2 parents 7600ad6 + cc860d9 commit 1be0473

File tree

6 files changed

+51
-0
lines changed

6 files changed

+51
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## NEXT
4+
5+
### Fixes
6+
7+
- Fix regression on methods that are not displayed (#72)
8+
39
## 2.0.0
410

511
### Features

cypress/integration/renderers/default.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,13 @@ describe('Renderers: default', () => {
9999
expect($rowChildren.eq(2).html()).to.eq('A message');
100100
});
101101
});
102+
103+
it('should render methods properly', () => {
104+
cy.contains('h3', 'Methods').should('have.attr', 'class', 'subsection-title');
105+
cy.get('#decrement').contains('decrement()');
106+
cy.get('#increment').contains('increment()');
107+
cy.get('#showDialog').contains('showDialog(counter)');
108+
109+
cy.contains('created()').should('not.exist');
110+
});
102111
});

cypress/integration/renderers/docstrap.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,13 @@ describe('Renderers: docstrap', () => {
9999
expect($rowChildren.eq(2).html()).to.eq('A message');
100100
});
101101
});
102+
103+
it('should render methods properly', () => {
104+
cy.contains('h3', 'Methods').should('have.attr', 'class', 'subsection-title');
105+
cy.get('#decrement').contains('decrement()');
106+
cy.get('#increment').contains('increment()');
107+
cy.get('#showDialog').contains('showDialog(counter)');
108+
109+
cy.contains('created()').should('not.exist');
110+
});
102111
});

cypress/integration/renderers/minami.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,13 @@ describe('Renderers: minami', () => {
103103
expect($rowChildren.eq(2).html()).to.eq('A message');
104104
});
105105
});
106+
107+
it('should render methods properly', () => {
108+
cy.contains('h3', 'Methods').should('have.attr', 'class', 'subsection-title');
109+
cy.get('#decrement').contains('decrement()');
110+
cy.get('#increment').contains('increment()');
111+
cy.get('#showDialog').contains('showDialog(counter)');
112+
113+
cy.contains('created()').should('not.exist');
114+
});
106115
});

cypress/integration/renderers/tui.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,13 @@ describe('Renderers: tui', () => {
9999
expect($rowChildren.eq(2).html()).to.eq('A message');
100100
});
101101
});
102+
103+
it('should render methods properly', () => {
104+
cy.contains('h3', 'Methods').should('have.attr', 'class', 'subsection-title');
105+
cy.get('#decrement').contains('decrement()');
106+
cy.get('#increment').contains('increment()');
107+
cy.get('#showDialog').contains('showDialog(counter)');
108+
109+
cy.contains('created()').should('not.exist');
110+
});
102111
});

index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ exports.handlers = {
3838
// Remove meta for not rendering source for this doclet
3939
delete e.doclet.meta;
4040
}
41+
42+
if (e.doclet.kind === 'function') {
43+
if (e.doclet.memberof.endsWith('.methods')) {
44+
e.doclet.scope = 'instance';
45+
e.doclet.memberof = e.doclet.memberof.replace(/\.methods$/, ''); // force method to be displayed
46+
} else {
47+
e.doclet.memberof = null; // don't include Vue hooks
48+
}
49+
}
4150
}
4251
},
4352
};

0 commit comments

Comments
 (0)