Skip to content

Commit 52a7d17

Browse files
authored
Merge pull request #133 from docsbydoxdox/hotfix/added-missing-scope-to-methods
[hotfix] Added missing scope to methods
2 parents 78ce236 + 0a3cad6 commit 52a7d17

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

packages/doxdox-renderer-bootstrap/src/__snapshots__/index.test.ts.snap

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ exports[`bootstrap render 1`] = `
3434
position: relative;
3535
}
3636
37+
.method-scope {
38+
font-size: 1.5rem;
39+
color: #999;
40+
}
41+
3742
.method-permalink {
3843
position: absolute;
3944
margin-left: -1em;
@@ -57,7 +62,7 @@ exports[`bootstrap render 1`] = `
5762
<div class=\\"p-5 col-md-3\\">
5863
<p><b>directory/index.js</b></p>
5964
<ul class=\\"list-unstyled ml-0\\">
60-
<li><a href=\\"#index-js-methodname\\">methodName</a></li>
65+
<li><a href=\\"#index-js-methodname\\" class=\\"\\">methodName</a></li>
6166
</ul>
6267
</div>
6368
@@ -69,6 +74,7 @@ exports[`bootstrap render 1`] = `
6974
methodName(param)
7075
</h2>
7176
77+
7278
<p>Method description</p>
7379
7480

packages/doxdox-renderer-bootstrap/src/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const renderMethod = (method: Method) => `<div class="mb-5"><a name="${
2525
}" class="method-permalink" aria-label="Permalink">#</a>
2626
${method.fullName}
2727
</h2>
28+
${method.private ? `<p class="method-scope">private method</p>` : ''}
2829
2930
${method.description ? md.render(method.description) : ''}
3031
@@ -67,7 +68,12 @@ ${method.returns.map(
6768
const renderFileNav = (file: File) => `<p><b>${file.path}</b></p>
6869
<ul class="list-unstyled ml-0">
6970
${file.methods
70-
.map(method => `<li><a href="#${method.slug}">${method.name}</a></li>`)
71+
.map(
72+
method =>
73+
`<li><a href="#${method.slug}" class="${
74+
method.private ? 'text-muted' : ''
75+
}">${method.name}</a></li>`
76+
)
7177
.join('')}
7278
</ul>`;
7379

@@ -107,6 +113,11 @@ export default async (doc: Doc): Promise<string> => `<!DOCTYPE html>
107113
position: relative;
108114
}
109115
116+
.method-scope {
117+
font-size: 1.5rem;
118+
color: #999;
119+
}
120+
110121
.method-permalink {
111122
position: absolute;
112123
margin-left: -1em;

packages/doxdox-renderer-dash/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ const renderMethod = (doc: Doc, method: Method) => `<!DOCTYPE html>
3535
<title>${doc.name}${doc.description ? ` - ${doc.description}` : ''}</title>
3636
<link rel="stylesheet" href="resources/bootstrap.min.css">
3737
<link rel="stylesheet" href="resources/github.min.css">
38+
<style>
39+
.method-scope {
40+
font-size: 1.5rem;
41+
color: #999;
42+
}
43+
</style>
3844
</head>
3945
4046
<body>
@@ -44,6 +50,7 @@ const renderMethod = (doc: Doc, method: Method) => `<!DOCTYPE html>
4450
<h2 class="method-name">
4551
${method.fullName}
4652
</h2>
53+
${method.private ? `<p class="method-scope">private method</p>` : ''}
4754
4855
${method.description ? md.render(method.description) : ''}
4956

packages/doxdox-renderer-pdf/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const renderMethod = (method: Method) => `<div class="mb-5"><a name="${
2222
}" />
2323
2424
<h2 class="method-name">${method.fullName}</h2>
25+
${method.private ? `<p class="method-scope">private method</p>` : ''}
2526
2627
${method.description ? md.render(method.description) : ''}
2728
@@ -101,6 +102,11 @@ export default async (doc: Doc): Promise<Buffer> => {
101102
.method-name {
102103
position: relative;
103104
}
105+
106+
.method-scope {
107+
font-size: 1.5rem;
108+
color: #999;
109+
}
104110
</style>
105111
</head>
106112
<body>

0 commit comments

Comments
 (0)