hdoc-tools 0.8.10 → 0.8.12

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.
@@ -1,14 +1,15 @@
1
1
  /* put htl styles here */
2
2
 
3
3
  /* LAYOUT */
4
- .hb-container-vertical,
5
- .hb-container-horizontal{
4
+ .hb-container-vertical{
6
5
  height: 100%;
7
6
  display: flex;
8
7
  flex-direction: column;
9
8
  }
10
9
  .hb-container-horizontal{
10
+ display: flex;
11
11
  flex-direction: row;
12
+ width: 100%;
12
13
  }
13
14
  .hb-container-vertical > *,
14
15
  .hb-container-horizontal > *{
@@ -82,6 +83,19 @@
82
83
  padding: 0px 20px;
83
84
  }
84
85
 
86
+ .toolbar-action
87
+ {
88
+ cursor:pointer;
89
+ text-decoration : none;
90
+ padding: 4px;
91
+ }
92
+ .toolbar-action:hover
93
+ {
94
+ background-color: var(--htl-c-blue-dimm-2);
95
+ }
96
+
97
+
98
+
85
99
 
86
100
  /* toolbar title and desc */
87
101
  .toolbar-layout .title
@@ -141,6 +155,16 @@
141
155
  text-decoration: underline;
142
156
  }
143
157
 
158
+ .nav-bar-nav-list.noeffects .nav-bar-item:hover {
159
+ text-decoration: none;
160
+ cursor: default;
161
+ }
162
+
163
+ .nav-bar-nav-list.noeffects .nav-bar-item.active {
164
+ text-decoration: none;
165
+ }
166
+
167
+
144
168
  /* panel headers */
145
169
  .panel-header
146
170
  {
@@ -242,3 +266,4 @@ input:checked + .slider:before {
242
266
  .slider.round:before {
243
267
  border-radius: 50%;
244
268
  }
269
+
package/ui/index.html CHANGED
@@ -13,11 +13,13 @@
13
13
  <meta name="viewport" content="width=device-width,initial-scale=1">
14
14
  <meta name="description" content="Internal documentation for the Hornbill ESP Platform">
15
15
 
16
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
17
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
16
18
  <script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
19
+ <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
20
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
17
21
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
18
22
 
19
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
20
-
21
23
  <style>
22
24
  .hb-hidden
23
25
  {
@@ -182,10 +184,65 @@
182
184
  <div class="HTL-doc content-wrapper hb-container-expand">
183
185
  <div class="injected-document-container hb-container-horizontal">
184
186
 
185
- <div class="injected-document-content"></div>
187
+ <div class="injected-document-content">
188
+ <div class="document-header">
189
+
190
+ <!-- breadcrumb-->
191
+ <div class="hb-container-horizontal">
192
+ <div class="hb-center-v hb-container-expand">
193
+ <ul class="ps-0 nav-bar-nav-list noeffects after-fslash overflow-ellipsis">
194
+ <li class="mt-0 nav-bar-item" v-for="(crumb,$index) in docApp.bookBreadCrumb">
195
+ <a class="ps-0 pe-0 text-decoration-none" v-bind:href="crumb.link">{{crumb.title}}</a>
196
+ </li>
197
+ </ul>
198
+ </div>
199
+ <div class="toolbar-right hb-center-v">
200
+
201
+ <a class="toolbar-action" v-bind:href="docApp.documentGithubUrl" target="_blank">
202
+ <i class="bi bi-pencil"></i>
203
+ </a>
204
+
205
+ <a class="toolbar-action">
206
+ <i class="bi bi-three-dots-vertical"></i>
207
+ </a>
208
+ </div>
209
+ </div>
210
+
211
+ <div class="document-title"></div>
212
+
213
+ <!-- doc frontmatter info -->
214
+ <div class="hb-container-horizontal">
215
+ <div class="hb-center-v hb-container-expand">
216
+ <ul class="ps-0 nav-bar-nav-list noeffects after-bullets overflow-ellipsis text-light-2">
217
+ <li class="ps-0 mt-0 nav-bar-item">
218
+ Article
219
+ </li>
220
+ <li class="ps-0 mt-0 nav-bar-item">
221
+ 2023-01-17
222
+ </li>
223
+ <li class="ps-0 mt-0 nav-bar-item">
224
+ 8 minutes to read
225
+ </li>
226
+ <li class="ps-0 mt-0 nav-bar-item">
227
+ <a class="link c-pointer">3 contributers</a>
228
+ </li>
229
+ </ul>
230
+ </div>
231
+ <div class="toolbar-right hb-center-v">
232
+ </div>
233
+ </div>
234
+
235
+ </div>
236
+ <div class="document-body"></div>
237
+
238
+ </div>
239
+
240
+
241
+
242
+
186
243
 
187
244
  <!-- table of contents -->
188
- <div v-if="docApp.keepTocLayout" class="injected-document-toc">
245
+ <div v-if="docApp.keepTocLayout" class="injected-document-toc">
189
246
  <div v-if="docApp.tableOfContents.length" class="panel-header">
190
247
  <span class="icon">
191
248
  <i class="bi bi-list-ul"></i>
@@ -193,11 +250,12 @@
193
250
  <span class="title">In This Document</span>
194
251
  </div>
195
252
  <div v-if="docApp.tableOfContents.length" class="panel-content">
196
- <div v-for="tocItem in docApp.tableOfContents" :class="tocItem.tagName">
253
+ <div v-for="tocItem in docApp.tableOfContents">
197
254
  <a :href="tocItem.href">{{tocItem.eleText}}</a>
198
255
  </div>
199
256
  </div>
200
257
  </div>
258
+
201
259
  </div>
202
260
 
203
261
  </div>
@@ -3,6 +3,7 @@
3
3
  //-- loaded in index.html
4
4
 
5
5
  var jqContentContainer = null;
6
+ var jqDocumentHeader = null;
6
7
  var jqLeftNav = null;
7
8
  var global = {stateParams:{},lastLayoutClass:""};
8
9
 
@@ -332,6 +333,14 @@ function loadContentUrl(linkRef,fromPageRefresh,fromPopState)
332
333
 
333
334
  highlightJsBadge(options);
334
335
 
336
+ //-- get first H1 and put it into our header section header
337
+ let docHeader = jqContentContainer.find("H1").eq(0)
338
+ jqDocumentHeader.find(".document-title").append( docHeader );
339
+
340
+
341
+ setGitHubBookUrl(linkRef);
342
+
343
+
335
344
  //-- make sure selected link parents are set to .expand=true
336
345
  if(expandNavParentSectionBySelectedLinkHref(linkRef))
337
346
  {
@@ -355,6 +364,15 @@ function loadContentUrl(linkRef,fromPageRefresh,fromPopState)
355
364
  });
356
365
  }
357
366
 
367
+ function setGitHubBookUrl(linkRef)
368
+ {
369
+ let bookRef = linkRef.split(siteBaseLocation);
370
+ bookRef = (bookRef[1])?bookRef[1]:bookRef[0];
371
+ let bookId = bookRef.split("/")[0];
372
+ view.docApp.documentGithubUrl = "https://github.com/Hornbill-Docs/" + bookId + "/blob/main/" + bookRef + ".md";
373
+ //--https://github.com/Hornbill-Docs/hdoc-guide/blob/main/hdoc-guide/overview.md
374
+ }
375
+
358
376
  function loadBookDefaultLink()
359
377
  {
360
378
  $(".DocLink.link").first().click();
@@ -391,6 +409,40 @@ function findFirstClickableBookLink(findByLinkRef,currentNavSection)
391
409
  }
392
410
 
393
411
  function expandNavParentSectionBySelectedLinkHref(findByLinkRef, currentNavSection)
412
+ {
413
+ findByLinkRef = findByLinkRef.split("#")[0];
414
+ if(currentNavSection === undefined)
415
+ {
416
+ view.docApp.bookBreadCrumb = []; //-- reset bread crumb
417
+ currentNavSection = view.docApp.navSections;
418
+ }
419
+
420
+ for(let x=0;x<currentNavSection.length;x++)
421
+ {
422
+ if(currentNavSection[x].items)
423
+ {
424
+ let res = expandNavParentSectionBySelectedLinkHref(findByLinkRef,currentNavSection[x].items);
425
+ if(res)
426
+ {
427
+ currentNavSection[x].expand=true;
428
+ view.docApp.bookBreadCrumb.unshift({title:currentNavSection[x].text,link:currentNavSection[x].items[0].link});
429
+ return res;
430
+ }
431
+ }
432
+ else
433
+ {
434
+ //-- check item to see if it matches url
435
+ if(removeStartingSlash(removeTrailingSlash(currentNavSection[x].link)) == findByLinkRef)
436
+ {
437
+ return true;
438
+ }
439
+ }
440
+ }
441
+
442
+ }
443
+
444
+
445
+ function old_expandNavParentSectionBySelectedLinkHref(findByLinkRef, currentNavSection)
394
446
  {
395
447
  findByLinkRef = findByLinkRef.split("#")[0];
396
448
  if(currentNavSection === undefined)
@@ -475,7 +527,7 @@ async function fetchJsonFile(strFilePath)
475
527
  //-- THE INIT APP CALLED FROM index.html
476
528
  var view = new Vue({
477
529
  el: '#vDocDevApp',
478
- data: {updateCounter:0,bookId:"", docApp:{keepTocLayout:false,book:{},navSections:[],tableOfContents:[]}},
530
+ data: {updateCounter:0,bookId:"", docApp:{keepTocLayout:false,book:{},navSections:[],tableOfContents:[],bookBreadCrumb:[]}},
479
531
  methods:docAppMethods,
480
532
  directives: {
481
533
  somedirectivename: {
@@ -509,7 +561,9 @@ async function intialiseApp() {
509
561
  // set theme switch
510
562
  $(".theme-switch-checkbox").prop('checked', (ThemePreference === 'dark'));
511
563
 
512
- jqContentContainer = $(".injected-document-content");
564
+ jqDocumentHeader = $(".injected-document-content .document-header");
565
+ jqContentContainer = $(".injected-document-content .document-body");
566
+ //jqContentContainer = $(".injected-document-content");
513
567
  jqLeftNav = $("#DocSidebarNav");
514
568
 
515
569
  await fetchJsonFile("_books/library.json").then(function(data){