From 96aa970be61dfb09235f81c47c3a76babf7abc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20B=C3=B6gle?= Date: Thu, 14 Feb 2019 01:25:47 +0100 Subject: [PATCH 1/3] fix(default theme): only render either note or section Fixes notes also showing up as duplicate sections. fix #1113 --- src/default_theme/index._ | 11 ++++++----- src/default_theme/section._ | 3 --- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/default_theme/index._ b/src/default_theme/index._ index 3d7c69d2e..978ba0cad 100644 --- a/src/default_theme/index._ +++ b/src/default_theme/index._ @@ -4,10 +4,10 @@ <%- config['project-name'] %> <%- config['project-version'] %> | Documentation - - - - <% if (config['project-description']) { %> + + + + <% if (config['project-description']) { %> '><% } %> @@ -96,13 +96,14 @@ <% docs.forEach(function(s) { %> <% if (s.kind === 'note') { %>
<%=renderNote({ note: s })%>
- <% } %> + <% } else { %> <%= renderSection({ section: s, renderSection: renderSection, renderSectionList: renderSectionList, renderParamProperty: renderParamProperty }) %> + <% } %> <% }) %> diff --git a/src/default_theme/section._ b/src/default_theme/section._ index c463fccb7..67b8b1c0e 100644 --- a/src/default_theme/section._ +++ b/src/default_theme/section._ @@ -16,10 +16,7 @@ <% } %> <%= md(section.description) %> - - <% if (section.kind !== "note") { %>
<%= signature(section) %>
- <% } %> <% if (section.type) { %>

Type: From 572957f2ed4d40ef785f8a4156fe0c839a5d8698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20B=C3=B6gle?= Date: Thu, 14 Feb 2019 01:43:17 +0100 Subject: [PATCH 2/3] undo revertion of c5f32ae --- src/default_theme/index._ | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/default_theme/index._ b/src/default_theme/index._ index 978ba0cad..7c96bd8fa 100644 --- a/src/default_theme/index._ +++ b/src/default_theme/index._ @@ -4,10 +4,10 @@ <%- config['project-name'] %> <%- config['project-version'] %> | Documentation - - - - <% if (config['project-description']) { %> + + + + <% if (config['project-description']) { %> '><% } %> From 80dd93bc54175c11c4e39f8870439f4e9f35cd18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20B=C3=B6gle?= Date: Thu, 14 Feb 2019 15:51:50 +0100 Subject: [PATCH 3/3] update test snapshot --- __tests__/__snapshots__/test.js.snap | 61 ++++------------------------ 1 file changed, 7 insertions(+), 54 deletions(-) diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 135a0c87e..d3f21a25d 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -1616,10 +1616,7 @@ exports[`html nested.input.js 1`] = `

Creates a new Klass

- -
new Klass(foo: any)
-

@@ -1680,10 +1677,7 @@ exports[`html nested.input.js 1`] = ` This is a [klasssic]Klass This is a [link to something that does not exist]DoesNot

- -
isClass(other: Object, also: any): boolean
- @@ -1758,10 +1752,7 @@ This is a [link to something that does not exist]DoesNotA function that triggers the case where the autolinker doesn't find the referenced class type

- -
isWeird(other: Weird): boolean
- @@ -1827,10 +1818,7 @@ the referenced class type

This method takes a Buffer object that will be linked to nodejs.org

- -
isBuffer(buf: (Buffer | string), size: number): boolean
- @@ -1906,10 +1894,7 @@ the referenced class type

This method takes an array of buffers and counts them

- -
isArrayOfBuffers(buffers: Array<Buffer>): number
- @@ -1983,10 +1968,7 @@ k.isArrayOfBuffers();

A magic number that identifies this Klass.

- -
MAGIC_NUMBER
- @@ -2039,10 +2021,7 @@ k.isArrayOfBuffers();

Get this Klass's foo

- -
getFoo(): Number
- @@ -2102,10 +2081,7 @@ k.isArrayOfBuffers();

A function with an options parameter

- -
withOptions(options: Object, otherOptions: number?)
- @@ -2203,10 +2179,7 @@ k.isArrayOfBuffers();

A function with a deep options parameter

- -
withDeepOptions(options: Object)
- @@ -2314,10 +2287,7 @@ k.isArrayOfBuffers();

Klass event

- -
event
- @@ -2353,6 +2323,7 @@ k.isArrayOfBuffers(); +
@@ -2370,10 +2341,7 @@ k.isArrayOfBuffers();

a typedef with nested properties

- -
CustomError
- @@ -2427,6 +2395,7 @@ k.isArrayOfBuffers();
+
@@ -2446,10 +2415,7 @@ k.isArrayOfBuffers(); a klass instance multiword, like a klass

- -
bar(): Klass
- @@ -2485,6 +2451,7 @@ like a klass

+
@@ -2502,10 +2469,7 @@ like a klass

Rest property function

- -
bar(toys: ...Number): undefined
- @@ -2554,6 +2518,7 @@ like a klass

+
@@ -2573,10 +2538,7 @@ like a klass

a klass instance multiword, like a klass. This needs a number input.

- -
bar(): undefined
- @@ -2612,6 +2574,7 @@ like a klass. This needs a +
@@ -2629,10 +2592,7 @@ like a klass. This needs a This is Foo

- -
new Foo()
- @@ -2673,10 +2633,7 @@ like a
klass. This needs a This is bar

- -
bar
- @@ -2714,6 +2671,7 @@ like a
klass. This needs a +
@@ -2731,10 +2689,7 @@ like a klass. This needs a I am the container of stream types

- -
customStreams
- @@ -2773,10 +2728,7 @@ like a
klass. This needs a I am a passthrough stream that belongs to customStreams

- -
new passthrough()
- @@ -2816,6 +2768,7 @@ like a
klass. This needs a +