web-documentation 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/deploy.js +1 -1
- package/package.json +11 -11
- package/source/index.css +11 -9
- package/source/index.html.ejs +12 -9
- package/source/index.ts +32 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-documentation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Declarative multilanguage documentation website generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"watch": "weboptimizer build --watch"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@aws-sdk/client-s3": "^3.
|
|
53
|
+
"@aws-sdk/client-s3": "^3.1039.0",
|
|
54
54
|
"@babel/eslint-parser": "^7.28.6",
|
|
55
55
|
"@babel/runtime": "^7.29.2",
|
|
56
56
|
"@eslint/js": "^10.0.1",
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
"@types/node": "^25.6.0",
|
|
64
64
|
"@types/unzipper": "^0.10.11",
|
|
65
65
|
"@types/webpack-env": "^1.18.8",
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "^8.59.
|
|
67
|
-
"@typescript-eslint/parser": "^8.59.
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^8.59.1",
|
|
67
|
+
"@typescript-eslint/parser": "^8.59.1",
|
|
68
68
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
69
69
|
"archiver": "^7.0.1",
|
|
70
|
-
"clientnode": "^4.0.
|
|
70
|
+
"clientnode": "^4.0.1392",
|
|
71
71
|
"css-loader": "^7.1.4",
|
|
72
72
|
"cssnano": "^7.1.7",
|
|
73
73
|
"default-gateway": "^7.2.2",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"marked-highlight": "^2.2.4",
|
|
87
87
|
"marked-xhtml": "^1.0.15",
|
|
88
88
|
"mini-css-extract-plugin": "^2.10.2",
|
|
89
|
-
"postcss": "^8.5.
|
|
89
|
+
"postcss": "^8.5.12",
|
|
90
90
|
"postcss-fontpath": "^1.0.0",
|
|
91
91
|
"postcss-import": "^16.1.1",
|
|
92
92
|
"postcss-loader": "^8.2.1",
|
|
@@ -98,16 +98,16 @@
|
|
|
98
98
|
"postcss-url": "^10.1.3",
|
|
99
99
|
"prop-types": "^15.8.1",
|
|
100
100
|
"style-loader": "^4.0.0",
|
|
101
|
-
"stylelint": "^17.9.
|
|
101
|
+
"stylelint": "^17.9.1",
|
|
102
102
|
"stylelint-config-standard": "^40.0.0",
|
|
103
|
-
"typescript-eslint": "^8.59.
|
|
103
|
+
"typescript-eslint": "^8.59.1",
|
|
104
104
|
"ua-parser-js": "^2.0.9",
|
|
105
105
|
"unzipper": "^0.12.3",
|
|
106
|
-
"web-component-wrapper": "^0.0.
|
|
107
|
-
"web-internationalization": "^2.0.
|
|
106
|
+
"web-component-wrapper": "^0.0.579",
|
|
107
|
+
"web-internationalization": "^2.0.17",
|
|
108
108
|
"weboptimizer": "^3.0.22",
|
|
109
109
|
"webpack-dev-server": "^5.2.3",
|
|
110
|
-
"website-utilities": "^1.0.
|
|
110
|
+
"website-utilities": "^1.0.399"
|
|
111
111
|
},
|
|
112
112
|
"engines": {
|
|
113
113
|
"node": ">=24",
|
package/source/index.css
CHANGED
|
@@ -172,17 +172,19 @@ body {
|
|
|
172
172
|
|
|
173
173
|
a:hover { color: var(--color11); }
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
website-utilities {
|
|
176
|
+
.wu-scroll-to-top {
|
|
177
|
+
right: 45px;
|
|
178
|
+
z-index: 4;
|
|
179
|
+
}
|
|
179
180
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
.wu-scroll-to-top.wu-scroll-up {
|
|
182
|
+
bottom: calc(2 * 34px);
|
|
183
|
+
}
|
|
183
184
|
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
.wu-scroll-to-top.wu-scroll-down {
|
|
186
|
+
bottom: 34px;
|
|
187
|
+
}
|
|
186
188
|
}
|
|
187
189
|
/** endregion */
|
|
188
190
|
/** region image */
|
package/source/index.html.ejs
CHANGED
|
@@ -187,10 +187,9 @@ _%>
|
|
|
187
187
|
</div>
|
|
188
188
|
</header>
|
|
189
189
|
<!--endregion-->
|
|
190
|
-
|
|
191
|
-
<section class="wu-section section">
|
|
190
|
+
<main class="wu-router-outlet section">
|
|
192
191
|
<!--region home-->
|
|
193
|
-
<
|
|
192
|
+
<section
|
|
194
193
|
class="section__inner section__home"
|
|
195
194
|
data-website-utilities-section="home"
|
|
196
195
|
>
|
|
@@ -208,10 +207,10 @@ _%>
|
|
|
208
207
|
_%>
|
|
209
208
|
|
|
210
209
|
<%- content %>
|
|
211
|
-
</
|
|
210
|
+
</section>
|
|
212
211
|
<!--endregion-->
|
|
213
212
|
<!--region about this website-->
|
|
214
|
-
<
|
|
213
|
+
<section
|
|
215
214
|
class="section__inner section__about-this-website"
|
|
216
215
|
data-website-utilities-section="about-this-website"
|
|
217
216
|
>
|
|
@@ -250,9 +249,13 @@ _%>
|
|
|
250
249
|
Website:
|
|
251
250
|
<!--deDE:Webseite:-->
|
|
252
251
|
<!--frFR:Site:-->
|
|
253
|
-
<a href="https://torben.website">
|
|
252
|
+
<a href="https://torben.website">
|
|
253
|
+
https://torben.website
|
|
254
|
+
</a>
|
|
254
255
|
<br>
|
|
255
|
-
<span
|
|
256
|
+
<span
|
|
257
|
+
class="section__inner__arrow-left-home icon icon-arrow-left"
|
|
258
|
+
></span>
|
|
256
259
|
<a href="#home">
|
|
257
260
|
home
|
|
258
261
|
<!--deDE:Startseite-->
|
|
@@ -260,9 +263,9 @@ _%>
|
|
|
260
263
|
</a>
|
|
261
264
|
</p>
|
|
262
265
|
<%- _.include('legal-notes') %>
|
|
263
|
-
</
|
|
266
|
+
</section>
|
|
264
267
|
<!--endregion-->
|
|
265
|
-
</
|
|
268
|
+
</main>
|
|
266
269
|
<!--endregion-->
|
|
267
270
|
<!--region footer-->
|
|
268
271
|
<footer class="footer">
|
package/source/index.ts
CHANGED
|
@@ -57,6 +57,9 @@ export const log = new Logger({name: 'web-documentation'})
|
|
|
57
57
|
* @property _defaultOptions.showExample.htmlWrapper - HTML example wrapper.
|
|
58
58
|
* @property _defaultOptions.section - Configuration object for section
|
|
59
59
|
* switches between the main page and legal notes descriptions.
|
|
60
|
+
* @property self - Reference to this class.
|
|
61
|
+
* @property doRender - Indicates that this components should evaluate given
|
|
62
|
+
* body content.
|
|
60
63
|
* @property options - Finally configured given options.
|
|
61
64
|
*/
|
|
62
65
|
export class WebDocumentation<
|
|
@@ -110,6 +113,8 @@ export class WebDocumentation<
|
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
|
|
116
|
+
static doRender = true
|
|
117
|
+
|
|
113
118
|
readonly self = WebDocumentation
|
|
114
119
|
// region api properties
|
|
115
120
|
@property({type: object})
|
|
@@ -158,13 +163,21 @@ export class WebDocumentation<
|
|
|
158
163
|
/**
|
|
159
164
|
* Updates controlled dom elements.
|
|
160
165
|
* @param reason - Why an update has been triggered.
|
|
166
|
+
* @param resolveRendering - Indicates whether rendering should be resolved
|
|
167
|
+
* finally. Should be set to "false" via super calls in inherited render
|
|
168
|
+
* methods which do further dom manipulations afterwards and resolve the
|
|
169
|
+
* rendering process by their own.
|
|
170
|
+
* @returns A promise resolving when rendering has finished. A promise may
|
|
171
|
+
* be needed for classes inheriting from this class.
|
|
161
172
|
*/
|
|
162
|
-
async render(reason
|
|
163
|
-
await super.render(reason)
|
|
173
|
+
async render(reason = 'unknown', resolveRendering = true): Promise<void> {
|
|
174
|
+
await super.render(reason, false)
|
|
164
175
|
|
|
165
176
|
if (Object.keys(this.options).length === 0)
|
|
166
177
|
this._extendOptions()
|
|
167
178
|
|
|
179
|
+
await this.waitForNestedComponentRendering()
|
|
180
|
+
|
|
168
181
|
this.grabDomNodes()
|
|
169
182
|
|
|
170
183
|
/*
|
|
@@ -173,29 +186,29 @@ export class WebDocumentation<
|
|
|
173
186
|
*/
|
|
174
187
|
this._showExamples()
|
|
175
188
|
|
|
176
|
-
// TODO we may need to delay internationalization until this has been
|
|
177
|
-
// finished rendering
|
|
178
|
-
|
|
179
189
|
this._makeCodeEllipsis()
|
|
180
190
|
|
|
181
191
|
this._generateTableOfContentsLinks()
|
|
192
|
+
|
|
193
|
+
await this.resolveRenderingPromiseIfSet(reason, resolveRendering)
|
|
182
194
|
}
|
|
183
195
|
/// endregion
|
|
184
196
|
grabDomNodes(): void {
|
|
185
|
-
this.aboutThisWebsiteLinkDomNodes = this.
|
|
197
|
+
this.aboutThisWebsiteLinkDomNodes = this.hostDomNode.querySelectorAll(
|
|
186
198
|
this.options.selectors.aboutThisWebsiteLink
|
|
187
199
|
)
|
|
188
|
-
this.aboutThisWebsiteSectionDomNode = this.
|
|
200
|
+
this.aboutThisWebsiteSectionDomNode = this.hostDomNode.querySelector(
|
|
189
201
|
this.options.selectors.aboutThisWebsiteSection
|
|
190
202
|
)
|
|
191
203
|
|
|
192
204
|
this.codeDomNodes =
|
|
193
|
-
this.
|
|
205
|
+
this.hostDomNode.querySelectorAll(this.options.selectors.code)
|
|
194
206
|
|
|
195
207
|
this.headlineDomNodes =
|
|
196
|
-
this.
|
|
197
|
-
this.tableOfContentDomNode =
|
|
198
|
-
this.
|
|
208
|
+
this.hostDomNode.querySelectorAll(this.options.selectors.headlines)
|
|
209
|
+
this.tableOfContentDomNode = this.hostDomNode.querySelector(
|
|
210
|
+
this.options.selectors.tableOfContent
|
|
211
|
+
)
|
|
199
212
|
}
|
|
200
213
|
// endregion
|
|
201
214
|
// region protected methods
|
|
@@ -205,8 +218,13 @@ export class WebDocumentation<
|
|
|
205
218
|
* Extends given options by default options.
|
|
206
219
|
*/
|
|
207
220
|
_extendOptions() {
|
|
208
|
-
|
|
209
|
-
|
|
221
|
+
/*
|
|
222
|
+
NOTE: Using the internal setter avoids to trigger an additinal
|
|
223
|
+
rendering.
|
|
224
|
+
*/
|
|
225
|
+
this.setPropertyValue(
|
|
226
|
+
'options',
|
|
227
|
+
extend<Options>(true, {}, this.self._defaultOptions, this.options)
|
|
210
228
|
)
|
|
211
229
|
}
|
|
212
230
|
/**
|
|
@@ -353,7 +371,7 @@ export class WebDocumentation<
|
|
|
353
371
|
* Shows marked example codes directly in browser.
|
|
354
372
|
*/
|
|
355
373
|
_showExamples(): void {
|
|
356
|
-
for (const domNode of getAll(this.
|
|
374
|
+
for (const domNode of getAll(this.hostDomNode))
|
|
357
375
|
if (domNode.nodeName === this.options.showExample.domNodeName) {
|
|
358
376
|
const match: null | RegExpMatchArray =
|
|
359
377
|
(domNode.textContent || '').match(
|