@bartificer/linkify 2.3.5 → 2.4.0

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.
Files changed (97) hide show
  1. package/dist/index.js +1 -1
  2. package/docs/LinkData.class.mjs.html +93 -5
  3. package/docs/LinkTemplate.class.mjs.html +93 -5
  4. package/docs/Linkifier.class.mjs.html +99 -11
  5. package/docs/PageData.class.mjs.html +93 -5
  6. package/docs/defaults.mjs.html +116 -12
  7. package/docs/docdash-overrides.css +5 -0
  8. package/docs/externals.jsdoc.html +91 -4
  9. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  10. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  11. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  12. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  17. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  18. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  19. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  27. package/docs/index.html +930 -7
  28. package/docs/index.js.html +139 -17
  29. package/docs/module-cheerio.html +189 -3
  30. package/docs/module-defaults.html +585 -3
  31. package/docs/module-link-data.LinkData.html +944 -0
  32. package/docs/module-link-data.html +222 -0
  33. package/docs/module-link-template.LinkTemplate.html +817 -0
  34. package/docs/module-link-template.html +222 -0
  35. package/docs/module-linkifier.Linkifier.html +2323 -0
  36. package/docs/module-linkifier.html +232 -0
  37. package/docs/module-linkify.html +806 -3
  38. package/docs/module-mustache.html +189 -3
  39. package/docs/module-node-fetch.html +189 -3
  40. package/docs/module-page-data.PageData.html +1788 -0
  41. package/docs/module-page-data.html +222 -0
  42. package/docs/module-title-case.html +189 -3
  43. package/docs/module-urijs.html +189 -3
  44. package/docs/module-url-slug.html +189 -3
  45. package/docs/module-utilities.html +1468 -3
  46. package/docs/scripts/collapse.js +39 -0
  47. package/docs/scripts/commonNav.js +28 -0
  48. package/docs/scripts/linenumber.js +25 -0
  49. package/docs/scripts/nav.js +12 -0
  50. package/docs/scripts/polyfill.js +4 -0
  51. package/docs/scripts/{third-party → prettify}/Apache-License-2.0.txt +202 -202
  52. package/docs/scripts/prettify/lang-css.js +2 -0
  53. package/docs/scripts/prettify/prettify.js +28 -0
  54. package/docs/scripts/search.js +99 -265
  55. package/docs/styles/jsdoc.css +776 -0
  56. package/docs/styles/prettify.css +80 -0
  57. package/docs/utilities.mjs.html +124 -5
  58. package/examples/clipboardURLToMarkdown.mjs +80 -1
  59. package/package.json +3 -2
  60. package/src/LinkData.class.mjs +2 -1
  61. package/src/LinkTemplate.class.mjs +2 -1
  62. package/src/Linkifier.class.mjs +8 -7
  63. package/src/PageData.class.mjs +2 -1
  64. package/src/defaults.mjs +26 -8
  65. package/src/index.js +48 -13
  66. package/src/utilities.mjs +33 -1
  67. package/docs/data/search.json +0 -1
  68. package/docs/fonts/Inconsolata-Regular.ttf +0 -0
  69. package/docs/fonts/OpenSans-Regular.ttf +0 -0
  70. package/docs/fonts/WorkSans-Bold.ttf +0 -0
  71. package/docs/module-LinkData.LinkData.html +0 -13
  72. package/docs/module-LinkData.html +0 -3
  73. package/docs/module-LinkTemplate.LinkTemplate.html +0 -3
  74. package/docs/module-LinkTemplate.html +0 -3
  75. package/docs/module-Linkifier.Linkifier.html +0 -3
  76. package/docs/module-Linkifier.html +0 -3
  77. package/docs/module-PageData.PageData.html +0 -15
  78. package/docs/module-PageData.html +0 -3
  79. package/docs/scripts/core.js +0 -726
  80. package/docs/scripts/core.min.js +0 -23
  81. package/docs/scripts/resize.js +0 -90
  82. package/docs/scripts/search.min.js +0 -6
  83. package/docs/scripts/third-party/fuse.js +0 -9
  84. package/docs/scripts/third-party/hljs-line-num-original.js +0 -369
  85. package/docs/scripts/third-party/hljs-line-num.js +0 -1
  86. package/docs/scripts/third-party/hljs-original.js +0 -5171
  87. package/docs/scripts/third-party/hljs.js +0 -1
  88. package/docs/scripts/third-party/popper.js +0 -5
  89. package/docs/scripts/third-party/tippy.js +0 -1
  90. package/docs/scripts/third-party/tocbot.js +0 -672
  91. package/docs/scripts/third-party/tocbot.min.js +0 -1
  92. package/docs/styles/clean-jsdoc-theme-base.css +0 -1159
  93. package/docs/styles/clean-jsdoc-theme-dark.css +0 -412
  94. package/docs/styles/clean-jsdoc-theme-light.css +0 -482
  95. package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -30
  96. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -1
  97. package/docs/styles/clean-jsdoc-theme.min.css +0 -1
@@ -0,0 +1,1788 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>PageData - @bartificer/linkify Documentation</title>
7
+
8
+ <meta name="description" content="Documentation for the @bartificer/linkify package" />
9
+
10
+ <meta name="keywords" content="documentation, linkify, link, template, javascript, generator, npm, module, package" />
11
+ <meta name="keyword" content="documentation, linkify, link, template, javascript, generator, npm, module, package" />
12
+
13
+
14
+
15
+ <meta property="og:title" content="@bartificer/linkify"/>
16
+ <meta property="og:type" content="website"/>
17
+ <meta property="og:image" content=""/>
18
+ <meta property="og:site_name" content="@bartificer/linkify Documentation"/>
19
+ <meta property="og:url" content="https://bartificer.github.io/linkify/"/>
20
+
21
+ <script src="scripts/prettify/prettify.js"></script>
22
+ <script src="scripts/prettify/lang-css.js"></script>
23
+ <!--[if lt IE 9]>
24
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
25
+ <![endif]-->
26
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
27
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
28
+ <script src="scripts/nav.js" defer></script>
29
+
30
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
31
+ </head>
32
+ <body>
33
+
34
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
35
+ <label for="nav-trigger" class="navicon-button x">
36
+ <div class="navicon"></div>
37
+ </label>
38
+
39
+ <label for="nav-trigger" class="overlay"></label>
40
+
41
+ <nav class="wrap">
42
+
43
+ <input type="text" id="nav-search" placeholder="Search" />
44
+
45
+
46
+ <h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/bartificer/linkify" target="_blank" >On GitHub</a></h2><h2><a href="https://bartificer.net/" target="_blank" >Bartificer Creations</a></h2><h3>Modules</h3><ul><li><a href="module-defaults.html">defaults</a><ul class='members'><li data-type='member'><a href="module-defaults.html#.linkTemplates">linkTemplates</a></li><li data-type='member'><a href="module-defaults.html#.smallWords">smallWords</a></li><li data-type='member'><a href="module-defaults.html#.speciallyCapitalisedWords">speciallyCapitalisedWords</a></li></ul></li><li><a href="module-link-data.html">link-data</a></li><li><a href="module-link-template.html">link-template</a></li><li><a href="module-linkifier.html">linkifier</a></li><li><a href="module-linkify.html">linkify</a><ul class='members'><li data-type='member'><a href="module-linkify.html#.LinkData">LinkData</a></li><li data-type='member'><a href="module-linkify.html#.LinkTemplate">LinkTemplate</a></li><li data-type='member'><a href="module-linkify.html#.Linkifier">Linkifier</a></li><li data-type='member'><a href="module-linkify.html#.PageData">PageData</a></li><li data-type='member'><a href="module-linkify.html#.VERSION">VERSION</a></li><li data-type='member'><a href="module-linkify.html#.default">default</a></li><li data-type='member'><a href="module-linkify.html#.linkify">linkify</a></li></ul></li><li><a href="module-page-data.html">page-data</a></li><li><a href="module-utilities.html">utilities</a><ul class='methods'><li data-type='method'><a href="module-utilities.html#.batchFixCustomWordCases">batchFixCustomWordCases</a></li><li data-type='method'><a href="module-utilities.html#.escapeRegex">escapeRegex</a></li><li data-type='method'><a href="module-utilities.html#.extractSlug">extractSlug</a></li><li data-type='method'><a href="module-utilities.html#.regulariseWhitespace">regulariseWhitespace</a></li><li data-type='method'><a href="module-utilities.html#.stripQueryString">stripQueryString</a></li><li data-type='method'><a href="module-utilities.html#.stripUTMParameters">stripUTMParameters</a></li><li data-type='method'><a href="module-utilities.html#.toTitleCase">toTitleCase</a></li></ul></li></ul><h3>Classes</h3><ul><li><a href="module-link-data.LinkData.html">LinkData</a><ul class='methods'><li data-type='method'><a href="module-link-data.LinkData.html#asPlainObject">asPlainObject</a></li></ul></li><li><a href="module-link-template.LinkTemplate.html">LinkTemplate</a><ul class='methods'><li data-type='method'><a href="module-link-template.LinkTemplate.html#addFilter">addFilter</a></li><li data-type='method'><a href="module-link-template.LinkTemplate.html#filtersFor">filtersFor</a></li></ul></li><li><a href="module-linkifier.Linkifier.html">Linkifier</a><ul class='methods'><li data-type='method'><a href="module-linkifier.Linkifier.html#fetchPageData">fetchPageData</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#generateLink">generateLink</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#getTemplate">getTemplate</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#getTemplateNameForDomain">getTemplateNameForDomain</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#getTransformerForDomain">getTransformerForDomain</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#registerDefaultTemplateMapping">registerDefaultTemplateMapping</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#registerTemplate">registerTemplate</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#registerTransformer">registerTransformer</a></li></ul></li><li><a href="module-page-data.PageData.html">PageData</a><ul class='methods'><li data-type='method'><a href="module-page-data.PageData.html#addSecondaryHeading">addSecondaryHeading</a></li><li data-type='method'><a href="module-page-data.PageData.html#addTopLevelHeading">addTopLevelHeading</a></li><li data-type='method'><a href="module-page-data.PageData.html#asPlainObject">asPlainObject</a></li><li data-type='method'><a href="module-page-data.PageData.html#h1">h1</a></li><li data-type='method'><a href="module-page-data.PageData.html#h2">h2</a></li></ul></li></ul><h3>Externals</h3><ul><li><a href="module-cheerio.html">cheerio</a></li><li><a href="module-mustache.html">mustache</a></li><li><a href="module-node-fetch.html">node-fetch</a></li><li><a href="module-title-case.html">title-case</a></li><li><a href="module-urijs.html">urijs</a></li><li><a href="module-url-slug.html">url-slug</a></li></ul>
47
+
48
+ </nav>
49
+
50
+ <div id="main">
51
+
52
+ <h1 class="page-title">PageData</h1>
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+ <section>
61
+
62
+ <header>
63
+
64
+ <h2>
65
+ <span class="ancestors"><a href="module-page-data.html">page-data</a>.</span>
66
+
67
+
68
+ PageData
69
+
70
+ </h2>
71
+
72
+ <div class="class-description usertext"><p>A class representing the data extracted from web pages that can be transformed into link data for use when rendering links.</p></div>
73
+
74
+
75
+ </header>
76
+
77
+ <article>
78
+
79
+ <div class="container-overview">
80
+
81
+
82
+
83
+
84
+ <h2>Constructor</h2>
85
+
86
+
87
+ <h4 class="name" id="PageData"><span class="type-signature"></span>new PageData<span class="signature">(url)</span><span class="type-signature"></span></h4>
88
+
89
+
90
+
91
+
92
+
93
+
94
+ <dl class="details">
95
+
96
+ <dt class="tag-description">Description:</dt>
97
+ <dd class="tag-description"><ul class="dummy"><li><p>This constructor throws a ValidationError unless a valid URL is passed.</p></li></ul></dd>
98
+
99
+
100
+
101
+ <dt class="tag-source">Source:</dt>
102
+ <dd class="tag-source"><ul class="dummy"><li>
103
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line17">line 17</a>
104
+ </li></ul></dd>
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+ </dl>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <h5 class="h5-parameters">Parameters:</h5>
151
+
152
+
153
+ <table class="params">
154
+ <thead>
155
+ <tr>
156
+
157
+ <th>Name</th>
158
+
159
+
160
+ <th>Type</th>
161
+
162
+
163
+
164
+
165
+
166
+ <th class="last">Description</th>
167
+ </tr>
168
+ </thead>
169
+
170
+ <tbody>
171
+
172
+
173
+ <tr>
174
+
175
+ <td class="name"><code>url</code></td>
176
+
177
+
178
+ <td class="type">
179
+
180
+
181
+ <span class="param-type">URL</span>
182
+
183
+
184
+
185
+
186
+ </td>
187
+
188
+
189
+
190
+
191
+
192
+ <td class="description last"><p>The page's full URL.</p></td>
193
+ </tr>
194
+
195
+
196
+ </tbody>
197
+ </table>
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <h5 class="h5-throws">Throws:</h5>
213
+
214
+
215
+
216
+ <dl>
217
+ <dt>
218
+ <div class="param-desc usertext">
219
+ <p>A validation error is thrown if an invalid URL
220
+ is passed.</p>
221
+ </div>
222
+ </dt>
223
+ <dd></dd>
224
+ <dt>
225
+ <dl class="param-type">
226
+ <dt>
227
+ Type
228
+ </dt>
229
+ <dd>
230
+
231
+ <span class="param-type">ValidationError</span>
232
+
233
+
234
+
235
+ </dd>
236
+ </dl>
237
+ </dt>
238
+ <dd></dd>
239
+ </dl>
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+ </div>
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+ <h3 class="subsection-title">Members</h3>
266
+
267
+
268
+
269
+ <h4 class="name" id="domain"><span class="type-signature"></span>domain<span class="type-signature"></span></h4>
270
+
271
+
272
+
273
+
274
+
275
+ <dl class="details">
276
+
277
+ <dt class="tag-description">Description:</dt>
278
+ <dd class="tag-description"><ul class="dummy"><li><p>Get the domain-part of the URL as a string.</p></li></ul></dd>
279
+
280
+
281
+
282
+ <dt class="tag-source">Source:</dt>
283
+ <dd class="tag-source"><ul class="dummy"><li>
284
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line88">line 88</a>
285
+ </li></ul></dd>
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+ </dl>
318
+
319
+
320
+
321
+
322
+
323
+ <div class="description usertext">
324
+ <p>Get the domain-part of the URL as a string.</p>
325
+ </div>
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+ <h4 class="name" id="h1s"><span class="type-signature"></span>h1s<span class="type-signature"></span></h4>
337
+
338
+
339
+
340
+
341
+
342
+ <dl class="details">
343
+
344
+ <dt class="tag-description">Description:</dt>
345
+ <dd class="tag-description"><ul class="dummy"><li><p>An alias for <code>.topLevelHeadings</code>.</p></li></ul></dd>
346
+
347
+
348
+
349
+ <dt class="tag-source">Source:</dt>
350
+ <dd class="tag-source"><ul class="dummy"><li>
351
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line149">line 149</a>
352
+ </li></ul></dd>
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+ <dt class="tag-see">See:</dt>
383
+ <dd class="tag-see">
384
+ <ul>
385
+ <li>PageData#topLevelHeadings</li>
386
+ </ul>
387
+ </dd>
388
+
389
+
390
+
391
+ </dl>
392
+
393
+
394
+
395
+
396
+
397
+ <div class="description usertext">
398
+ <p>An alias for <code>.topLevelHeadings</code>.</p>
399
+ </div>
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+ <h4 class="name" id="h2s"><span class="type-signature"></span>h2s<span class="type-signature"></span></h4>
411
+
412
+
413
+
414
+
415
+
416
+ <dl class="details">
417
+
418
+ <dt class="tag-description">Description:</dt>
419
+ <dd class="tag-description"><ul class="dummy"><li><p>An alias for <code>.secondaryHeadings</code>.</p></li></ul></dd>
420
+
421
+
422
+
423
+ <dt class="tag-source">Source:</dt>
424
+ <dd class="tag-source"><ul class="dummy"><li>
425
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line170">line 170</a>
426
+ </li></ul></dd>
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+ <dt class="tag-see">See:</dt>
457
+ <dd class="tag-see">
458
+ <ul>
459
+ <li>PageData#secondaryHeadings</li>
460
+ </ul>
461
+ </dd>
462
+
463
+
464
+
465
+ </dl>
466
+
467
+
468
+
469
+
470
+
471
+ <div class="description usertext">
472
+ <p>An alias for <code>.secondaryHeadings</code>.</p>
473
+ </div>
474
+
475
+
476
+
477
+
478
+
479
+
480
+
481
+
482
+
483
+
484
+ <h4 class="name" id="headings"><span class="type-signature"></span>headings<span class="type-signature"></span></h4>
485
+
486
+
487
+
488
+
489
+
490
+ <dl class="details">
491
+
492
+ <dt class="tag-description">Description:</dt>
493
+ <dd class="tag-description"><ul class="dummy"><li><p>Get the page's section headings.</p></li></ul></dd>
494
+
495
+
496
+
497
+ <dt class="tag-source">Source:</dt>
498
+ <dd class="tag-source"><ul class="dummy"><li>
499
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line118">line 118</a>
500
+ </li></ul></dd>
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+
523
+
524
+
525
+
526
+
527
+
528
+
529
+
530
+
531
+
532
+ </dl>
533
+
534
+
535
+
536
+
537
+
538
+ <div class="description usertext">
539
+ <p>Get the page's section headings.</p>
540
+ </div>
541
+
542
+
543
+
544
+
545
+
546
+
547
+
548
+
549
+
550
+
551
+ <h4 class="name" id="mainHeading"><span class="type-signature"></span>mainHeading<span class="type-signature"></span></h4>
552
+
553
+
554
+
555
+
556
+
557
+ <dl class="details">
558
+
559
+ <dt class="tag-description">Description:</dt>
560
+ <dd class="tag-description"><ul class="dummy"><li><p>The text from the most important heading on the page. If the page
561
+ has <code>h1</code> tags, the first one will be used, if not, the first <code>h2</code> tag
562
+ will be used, and if there's none of those either, an empty string will
563
+ be returned.</p></li></ul></dd>
564
+
565
+
566
+
567
+ <dt class="tag-source">Source:</dt>
568
+ <dd class="tag-source"><ul class="dummy"><li>
569
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line182">line 182</a>
570
+ </li></ul></dd>
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+ </dl>
603
+
604
+
605
+
606
+
607
+
608
+ <div class="description usertext">
609
+ <p>The text from the most important heading on the page. If the page
610
+ has <code>h1</code> tags, the first one will be used, if not, the first <code>h2</code> tag
611
+ will be used, and if there's none of those either, an empty string will
612
+ be returned.</p>
613
+ </div>
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+ <h4 class="name" id="path"><span class="type-signature"></span>path<span class="type-signature"></span></h4>
625
+
626
+
627
+
628
+
629
+
630
+ <dl class="details">
631
+
632
+
633
+
634
+ <dt class="tag-source">Source:</dt>
635
+ <dd class="tag-source"><ul class="dummy"><li>
636
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line95">line 95</a>
637
+ </li></ul></dd>
638
+
639
+
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+ </dl>
670
+
671
+
672
+
673
+
674
+
675
+
676
+
677
+
678
+
679
+
680
+
681
+
682
+
683
+
684
+ <h4 class="name" id="secondaryHeadings"><span class="type-signature"></span>secondaryHeadings<span class="type-signature"></span></h4>
685
+
686
+
687
+
688
+
689
+
690
+ <dl class="details">
691
+
692
+ <dt class="tag-description">Description:</dt>
693
+ <dd class="tag-description"><ul class="dummy"><li><p>The page's secondary headings (<code>h2</code> tags).</p></li></ul></dd>
694
+
695
+
696
+
697
+ <dt class="tag-source">Source:</dt>
698
+ <dd class="tag-source"><ul class="dummy"><li>
699
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line158">line 158</a>
700
+ </li></ul></dd>
701
+
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+
713
+
714
+
715
+
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+
724
+
725
+
726
+
727
+
728
+
729
+
730
+
731
+
732
+ </dl>
733
+
734
+
735
+
736
+
737
+
738
+ <div class="description usertext">
739
+ <p>The page's secondary headings (<code>h2</code> tags).</p>
740
+ </div>
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+
751
+ <h4 class="name" id="title"><span class="type-signature"></span>title<span class="type-signature"></span></h4>
752
+
753
+
754
+
755
+
756
+
757
+ <dl class="details">
758
+
759
+
760
+
761
+ <dt class="tag-source">Source:</dt>
762
+ <dd class="tag-source"><ul class="dummy"><li>
763
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line102">line 102</a>
764
+ </li></ul></dd>
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+
773
+
774
+
775
+
776
+
777
+
778
+
779
+
780
+
781
+
782
+
783
+
784
+
785
+
786
+
787
+
788
+
789
+
790
+
791
+
792
+
793
+
794
+
795
+
796
+ </dl>
797
+
798
+
799
+
800
+
801
+
802
+
803
+
804
+
805
+
806
+
807
+
808
+
809
+
810
+
811
+ <h4 class="name" id="title"><span class="type-signature"></span>title<span class="type-signature"></span></h4>
812
+
813
+
814
+
815
+
816
+
817
+ <dl class="details">
818
+
819
+
820
+
821
+ <dt class="tag-source">Source:</dt>
822
+ <dd class="tag-source"><ul class="dummy"><li>
823
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line109">line 109</a>
824
+ </li></ul></dd>
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+
840
+
841
+
842
+
843
+
844
+
845
+
846
+
847
+
848
+
849
+
850
+
851
+
852
+
853
+
854
+
855
+
856
+ </dl>
857
+
858
+
859
+
860
+
861
+
862
+
863
+
864
+
865
+
866
+
867
+
868
+
869
+
870
+
871
+ <h4 class="name" id="topLevelHeadings"><span class="type-signature"></span>topLevelHeadings<span class="type-signature"></span></h4>
872
+
873
+
874
+
875
+
876
+
877
+ <dl class="details">
878
+
879
+ <dt class="tag-description">Description:</dt>
880
+ <dd class="tag-description"><ul class="dummy"><li><p>The page's top-level headings (<code>h1</code> tags).</p></li></ul></dd>
881
+
882
+
883
+
884
+ <dt class="tag-source">Source:</dt>
885
+ <dd class="tag-source"><ul class="dummy"><li>
886
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line137">line 137</a>
887
+ </li></ul></dd>
888
+
889
+
890
+
891
+
892
+
893
+
894
+
895
+
896
+
897
+
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+ </dl>
920
+
921
+
922
+
923
+
924
+
925
+ <div class="description usertext">
926
+ <p>The page's top-level headings (<code>h1</code> tags).</p>
927
+ </div>
928
+
929
+
930
+
931
+
932
+
933
+
934
+
935
+
936
+
937
+
938
+ <h4 class="name" id="uri"><span class="type-signature"></span>uri<span class="type-signature"></span></h4>
939
+
940
+
941
+
942
+
943
+
944
+ <dl class="details">
945
+
946
+
947
+
948
+ <dt class="tag-source">Source:</dt>
949
+ <dd class="tag-source"><ul class="dummy"><li>
950
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line79">line 79</a>
951
+ </li></ul></dd>
952
+
953
+
954
+
955
+
956
+
957
+
958
+
959
+
960
+
961
+
962
+
963
+
964
+
965
+
966
+
967
+
968
+
969
+
970
+
971
+
972
+
973
+
974
+
975
+
976
+
977
+
978
+
979
+
980
+
981
+
982
+
983
+ </dl>
984
+
985
+
986
+
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+ <h4 class="name" id="url"><span class="type-signature"></span>url<span class="type-signature"></span></h4>
999
+
1000
+
1001
+
1002
+
1003
+
1004
+ <dl class="details">
1005
+
1006
+
1007
+
1008
+ <dt class="tag-source">Source:</dt>
1009
+ <dd class="tag-source"><ul class="dummy"><li>
1010
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line63">line 63</a>
1011
+ </li></ul></dd>
1012
+
1013
+
1014
+
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+
1033
+
1034
+
1035
+
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+
1043
+ </dl>
1044
+
1045
+
1046
+
1047
+
1048
+
1049
+
1050
+
1051
+
1052
+
1053
+
1054
+
1055
+
1056
+
1057
+
1058
+ <h4 class="name" id="url"><span class="type-signature"></span>url<span class="type-signature"></span></h4>
1059
+
1060
+
1061
+
1062
+
1063
+
1064
+ <dl class="details">
1065
+
1066
+
1067
+
1068
+ <dt class="tag-source">Source:</dt>
1069
+ <dd class="tag-source"><ul class="dummy"><li>
1070
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line72">line 72</a>
1071
+ </li></ul></dd>
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+
1078
+
1079
+
1080
+
1081
+
1082
+
1083
+
1084
+
1085
+
1086
+
1087
+
1088
+
1089
+
1090
+
1091
+
1092
+
1093
+
1094
+
1095
+
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+
1102
+
1103
+ </dl>
1104
+
1105
+
1106
+
1107
+
1108
+
1109
+
1110
+
1111
+
1112
+
1113
+
1114
+
1115
+
1116
+
1117
+
1118
+
1119
+
1120
+ <h3 class="subsection-title">Methods</h3>
1121
+
1122
+
1123
+
1124
+
1125
+
1126
+
1127
+ <h4 class="name" id="addSecondaryHeading"><span class="type-signature"></span>addSecondaryHeading<span class="signature">(h2Text)</span><span class="type-signature"> &rarr; {PageData}</span></h4>
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+ <dl class="details">
1135
+
1136
+ <dt class="tag-description">Description:</dt>
1137
+ <dd class="tag-description"><ul class="dummy"><li><p>Add a seconary heading.</p></li></ul></dd>
1138
+
1139
+
1140
+
1141
+ <dt class="tag-source">Source:</dt>
1142
+ <dd class="tag-source"><ul class="dummy"><li>
1143
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line212">line 212</a>
1144
+ </li></ul></dd>
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+
1153
+
1154
+
1155
+
1156
+
1157
+
1158
+
1159
+
1160
+
1161
+
1162
+
1163
+
1164
+
1165
+
1166
+
1167
+
1168
+
1169
+
1170
+
1171
+
1172
+
1173
+
1174
+
1175
+
1176
+ </dl>
1177
+
1178
+
1179
+
1180
+
1181
+
1182
+
1183
+
1184
+
1185
+
1186
+
1187
+
1188
+
1189
+
1190
+ <h5 class="h5-parameters">Parameters:</h5>
1191
+
1192
+
1193
+ <table class="params">
1194
+ <thead>
1195
+ <tr>
1196
+
1197
+ <th>Name</th>
1198
+
1199
+
1200
+ <th>Type</th>
1201
+
1202
+
1203
+
1204
+
1205
+
1206
+ <th class="last">Description</th>
1207
+ </tr>
1208
+ </thead>
1209
+
1210
+ <tbody>
1211
+
1212
+
1213
+ <tr>
1214
+
1215
+ <td class="name"><code>h2Text</code></td>
1216
+
1217
+
1218
+ <td class="type">
1219
+
1220
+
1221
+ <span class="param-type">string</span>
1222
+
1223
+
1224
+
1225
+
1226
+ </td>
1227
+
1228
+
1229
+
1230
+
1231
+
1232
+ <td class="description last"></td>
1233
+ </tr>
1234
+
1235
+
1236
+ </tbody>
1237
+ </table>
1238
+
1239
+
1240
+
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+
1247
+
1248
+
1249
+
1250
+
1251
+
1252
+
1253
+
1254
+ <h5 class="h5-returns">Returns:</h5>
1255
+
1256
+
1257
+ <div class="param-desc">
1258
+ <p>A reference to self to
1259
+ facilitate function chaning.</p>
1260
+ </div>
1261
+
1262
+
1263
+
1264
+ <dl class="param-type">
1265
+ <dt>
1266
+ Type
1267
+ </dt>
1268
+ <dd>
1269
+
1270
+ <span class="param-type">PageData</span>
1271
+
1272
+
1273
+
1274
+ </dd>
1275
+ </dl>
1276
+
1277
+
1278
+
1279
+
1280
+
1281
+
1282
+
1283
+
1284
+
1285
+
1286
+ <h4 class="name" id="addTopLevelHeading"><span class="type-signature"></span>addTopLevelHeading<span class="signature">(h1Text)</span><span class="type-signature"> &rarr; {PageData}</span></h4>
1287
+
1288
+
1289
+
1290
+
1291
+
1292
+
1293
+ <dl class="details">
1294
+
1295
+ <dt class="tag-description">Description:</dt>
1296
+ <dd class="tag-description"><ul class="dummy"><li><p>Add a top-level heading.</p></li></ul></dd>
1297
+
1298
+
1299
+
1300
+ <dt class="tag-source">Source:</dt>
1301
+ <dd class="tag-source"><ul class="dummy"><li>
1302
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line199">line 199</a>
1303
+ </li></ul></dd>
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+
1313
+
1314
+
1315
+
1316
+
1317
+
1318
+
1319
+
1320
+
1321
+
1322
+
1323
+
1324
+
1325
+
1326
+
1327
+
1328
+
1329
+
1330
+
1331
+
1332
+
1333
+
1334
+
1335
+ </dl>
1336
+
1337
+
1338
+
1339
+
1340
+
1341
+
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+ <h5 class="h5-parameters">Parameters:</h5>
1350
+
1351
+
1352
+ <table class="params">
1353
+ <thead>
1354
+ <tr>
1355
+
1356
+ <th>Name</th>
1357
+
1358
+
1359
+ <th>Type</th>
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+ <th class="last">Description</th>
1366
+ </tr>
1367
+ </thead>
1368
+
1369
+ <tbody>
1370
+
1371
+
1372
+ <tr>
1373
+
1374
+ <td class="name"><code>h1Text</code></td>
1375
+
1376
+
1377
+ <td class="type">
1378
+
1379
+
1380
+ <span class="param-type">string</span>
1381
+
1382
+
1383
+
1384
+
1385
+ </td>
1386
+
1387
+
1388
+
1389
+
1390
+
1391
+ <td class="description last"></td>
1392
+ </tr>
1393
+
1394
+
1395
+ </tbody>
1396
+ </table>
1397
+
1398
+
1399
+
1400
+
1401
+
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+ <h5 class="h5-returns">Returns:</h5>
1414
+
1415
+
1416
+ <div class="param-desc">
1417
+ <p>A reference to self to
1418
+ facilitate function chaning.</p>
1419
+ </div>
1420
+
1421
+
1422
+
1423
+ <dl class="param-type">
1424
+ <dt>
1425
+ Type
1426
+ </dt>
1427
+ <dd>
1428
+
1429
+ <span class="param-type">PageData</span>
1430
+
1431
+
1432
+
1433
+ </dd>
1434
+ </dl>
1435
+
1436
+
1437
+
1438
+
1439
+
1440
+
1441
+
1442
+
1443
+
1444
+
1445
+ <h4 class="name" id="asPlainObject"><span class="type-signature"></span>asPlainObject<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+
1452
+ <dl class="details">
1453
+
1454
+ <dt class="tag-description">Description:</dt>
1455
+ <dd class="tag-description"><ul class="dummy"><li><p>Get the page data as a plain object of the form:</p>
1456
+ <pre class="prettyprint source"><code>{
1457
+ url: 'http://www.bartificer.net/',
1458
+ title: 'the page title',
1459
+ topLevelHeadings: [ 'first h1', 'second h1' ],
1460
+ secondaryHeadings: [ 'first h2', 'second h2' ],
1461
+ mainHeading: 'first h1',
1462
+ uri: {
1463
+ hostname: 'www.bartificer.net',
1464
+ path: '/',
1465
+ hasPath: false
1466
+ }
1467
+ }
1468
+ </code></pre>
1469
+ <p>Note that the <code>uri</code> could contain more fields - it's initialised with
1470
+ output from the <code>URI.parse()</code> function from the <code>URI</code> module.</p></li></ul></dd>
1471
+
1472
+
1473
+
1474
+ <dt class="tag-source">Source:</dt>
1475
+ <dd class="tag-source"><ul class="dummy"><li>
1476
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line241">line 241</a>
1477
+ </li></ul></dd>
1478
+
1479
+
1480
+
1481
+
1482
+
1483
+
1484
+
1485
+
1486
+
1487
+
1488
+
1489
+
1490
+
1491
+
1492
+
1493
+
1494
+
1495
+
1496
+
1497
+
1498
+
1499
+
1500
+
1501
+
1502
+
1503
+
1504
+
1505
+
1506
+
1507
+ <dt class="tag-see">See:</dt>
1508
+ <dd class="tag-see">
1509
+ <ul>
1510
+ <li><a href="https://medialize.github.io/URI.js/docs.html#static-parse">https://medialize.github.io/URI.js/docs.html#static-parse</a></li>
1511
+ </ul>
1512
+ </dd>
1513
+
1514
+
1515
+
1516
+ </dl>
1517
+
1518
+
1519
+
1520
+
1521
+
1522
+
1523
+
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+
1530
+
1531
+
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+ <h5 class="h5-returns">Returns:</h5>
1545
+
1546
+
1547
+ <div class="param-desc">
1548
+ <p>A plain object containing the page data.</p>
1549
+ </div>
1550
+
1551
+
1552
+
1553
+ <dl class="param-type">
1554
+ <dt>
1555
+ Type
1556
+ </dt>
1557
+ <dd>
1558
+
1559
+ <span class="param-type">Object</span>
1560
+
1561
+
1562
+
1563
+ </dd>
1564
+ </dl>
1565
+
1566
+
1567
+
1568
+
1569
+
1570
+
1571
+
1572
+
1573
+
1574
+
1575
+ <h4 class="name" id="h1"><span class="type-signature"></span>h1<span class="signature">()</span><span class="type-signature"></span></h4>
1576
+
1577
+
1578
+
1579
+
1580
+
1581
+
1582
+ <dl class="details">
1583
+
1584
+ <dt class="tag-description">Description:</dt>
1585
+ <dd class="tag-description"><ul class="dummy"><li><p>A shortcut for <code>.addTopLevelHeading()</code>.</p></li></ul></dd>
1586
+
1587
+
1588
+
1589
+ <dt class="tag-source">Source:</dt>
1590
+ <dd class="tag-source"><ul class="dummy"><li>
1591
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line262">line 262</a>
1592
+ </li></ul></dd>
1593
+
1594
+
1595
+
1596
+
1597
+
1598
+
1599
+
1600
+
1601
+
1602
+
1603
+
1604
+
1605
+
1606
+
1607
+
1608
+
1609
+
1610
+
1611
+
1612
+
1613
+
1614
+
1615
+
1616
+
1617
+
1618
+
1619
+
1620
+
1621
+
1622
+ <dt class="tag-see">See:</dt>
1623
+ <dd class="tag-see">
1624
+ <ul>
1625
+ <li>PageData#addTopLevelHeading</li>
1626
+ </ul>
1627
+ </dd>
1628
+
1629
+
1630
+
1631
+ </dl>
1632
+
1633
+
1634
+
1635
+
1636
+
1637
+
1638
+
1639
+
1640
+
1641
+
1642
+
1643
+
1644
+
1645
+
1646
+
1647
+
1648
+
1649
+
1650
+
1651
+
1652
+
1653
+
1654
+
1655
+
1656
+
1657
+
1658
+
1659
+
1660
+
1661
+
1662
+
1663
+
1664
+
1665
+
1666
+
1667
+ <h4 class="name" id="h2"><span class="type-signature"></span>h2<span class="signature">()</span><span class="type-signature"></span></h4>
1668
+
1669
+
1670
+
1671
+
1672
+
1673
+
1674
+ <dl class="details">
1675
+
1676
+ <dt class="tag-description">Description:</dt>
1677
+ <dd class="tag-description"><ul class="dummy"><li><p>A shortcut for <code>.addSecondaryHeading()</code>.</p></li></ul></dd>
1678
+
1679
+
1680
+
1681
+ <dt class="tag-source">Source:</dt>
1682
+ <dd class="tag-source"><ul class="dummy"><li>
1683
+ <a href="PageData.class.mjs.html">PageData.class.mjs</a>, <a href="PageData.class.mjs.html#line271">line 271</a>
1684
+ </li></ul></dd>
1685
+
1686
+
1687
+
1688
+
1689
+
1690
+
1691
+
1692
+
1693
+
1694
+
1695
+
1696
+
1697
+
1698
+
1699
+
1700
+
1701
+
1702
+
1703
+
1704
+
1705
+
1706
+
1707
+
1708
+
1709
+
1710
+
1711
+
1712
+
1713
+
1714
+ <dt class="tag-see">See:</dt>
1715
+ <dd class="tag-see">
1716
+ <ul>
1717
+ <li>PageData#addSecondaryHeading</li>
1718
+ </ul>
1719
+ </dd>
1720
+
1721
+
1722
+
1723
+ </dl>
1724
+
1725
+
1726
+
1727
+
1728
+
1729
+
1730
+
1731
+
1732
+
1733
+
1734
+
1735
+
1736
+
1737
+
1738
+
1739
+
1740
+
1741
+
1742
+
1743
+
1744
+
1745
+
1746
+
1747
+
1748
+
1749
+
1750
+
1751
+
1752
+
1753
+
1754
+
1755
+
1756
+
1757
+
1758
+
1759
+
1760
+ </article>
1761
+
1762
+ </section>
1763
+
1764
+
1765
+
1766
+
1767
+
1768
+
1769
+ </div>
1770
+
1771
+ <br class="clear">
1772
+
1773
+ <footer>
1774
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Mon Apr 13 2026 16:45:07 GMT+0100 (Irish Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1775
+ </footer>
1776
+
1777
+ <script>prettyPrint();</script>
1778
+ <script src="scripts/polyfill.js"></script>
1779
+ <script src="scripts/linenumber.js"></script>
1780
+
1781
+ <script src="scripts/search.js" defer></script>
1782
+
1783
+
1784
+
1785
+ <link type="text/css" rel="stylesheet" href="./docdash-overrides.css">
1786
+
1787
+ </body>
1788
+ </html>