2
2
< html xmlns ="http://www.w3.org/1999/xhtml " lang ="en " xml:lang ="en "> < head >
3
3
4
4
< meta charset ="utf-8 ">
5
- < meta name ="generator " content ="quarto-1.3.450 ">
5
+ < meta name ="generator " content ="quarto-1.4.549 ">
6
6
7
7
< meta name ="viewport " content ="width=device-width, initial-scale=1.0, user-scalable=yes ">
8
8
9
9
10
- < title > Pharmaverse Blog – readme </ title >
10
+ < title > Pharmaverse Blog</ title >
11
11
< style >
12
12
code {white-space : pre-wrap;}
13
13
span .smallcaps {font-variant : small-caps;}
47
47
"collapse-after" : 3 ,
48
48
"panel-placement" : "end" ,
49
49
"type" : "overlay" ,
50
- "limit" : 20 ,
50
+ "limit" : 50 ,
51
+ "keyboard-shortcut" : [
52
+ "f" ,
53
+ "/" ,
54
+ "s"
55
+ ] ,
56
+ "show-item-context" : false ,
51
57
"language" : {
52
58
"search-no-results-text" : "No results" ,
53
59
"search-matching-documents-text" : "matching documents" ,
56
62
"search-more-match-text" : "more match in this document" ,
57
63
"search-more-matches-text" : "more matches in this document" ,
58
64
"search-clear-button-title" : "Clear" ,
65
+ "search-text-placeholder" : "" ,
59
66
"search-detached-cancel-button-title" : "Cancel" ,
60
67
"search-submit-button-title" : "Submit" ,
61
68
"search-label" : "Search"
64
71
65
72
66
73
< link rel ="stylesheet " href ="../styles.css ">
74
+ < meta property ="og:title " content ="Pharmaverse Blog ">
75
+ < meta property ="og:description " content ="">
76
+ < meta property ="og:site_name " content ="Pharmaverse Blog ">
67
77
</ head >
68
78
69
79
< body class ="nav-fixed fullcontent ">
70
80
71
81
< div id ="quarto-search-results "> </ div >
72
82
< header id ="quarto-header " class ="headroom fixed-top ">
73
- < nav class ="navbar navbar-expand-lg navbar- dark ">
83
+ < nav class ="navbar navbar-expand-lg " data-bs-theme =" dark ">
74
84
< div class ="navbar-container container-fluid ">
75
- < div class ="navbar-brand-container ">
85
+ < div class ="navbar-brand-container mx-auto ">
76
86
< a class ="navbar-brand " href ="../index.html ">
77
87
< span class ="navbar-title "> Pharmaverse Blog</ span >
78
88
</ a >
84
94
< div class ="collapse navbar-collapse " id ="navbarCollapse ">
85
95
< ul class ="navbar-nav navbar-nav-scroll ms-auto ">
86
96
< li class ="nav-item compact ">
87
- < a class ="nav-link " href ="https://github.com/pharmaverse/blog " rel ="" target ="" > < i class ="bi bi-github " role ="img " aria-label ="github ">
97
+ < a class ="nav-link " href ="https://github.com/pharmaverse/blog "> < i class ="bi bi-github " role ="img " aria-label ="github ">
88
98
</ i >
89
- < span class ="menu-text "> </ span > </ a >
99
+ < span class ="menu-text "> </ span > </ a >
90
100
</ li >
91
101
</ ul >
92
- < div class ="quarto-navbar-tools ">
102
+ </ div > <!-- /navcollapse -->
103
+ < div class ="quarto-navbar-tools ">
93
104
< a href ="" class ="quarto-color-scheme-toggle quarto-navigation-tool px-1 " onclick ="window.quartoToggleColorScheme(); return false; " title ="Toggle dark mode "> < i class ="bi "> </ i > </ a >
94
105
</ div >
95
- </ div > <!-- /navcollapse -->
96
106
</ div > <!-- /container-fluid -->
97
107
</ nav >
98
108
</ header >
106
116
107
117
108
118
119
+
109
120
< section id ="files-in-this-folder " class ="level1 ">
110
121
< h1 > Files in this folder</ h1 >
111
122
< p > Some of these files help in creating/developing blog-posts, others are used by our CICD pipeline.</ p >
@@ -168,6 +179,33 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
168
179
}
169
180
}
170
181
}
182
+ const toggleGiscusIfUsed = ( isAlternate , darkModeDefault ) => {
183
+ const baseTheme = document . querySelector ( '#giscus-base-theme' ) ?. value ?? 'light' ;
184
+ const alternateTheme = document . querySelector ( '#giscus-alt-theme' ) ?. value ?? 'dark' ;
185
+ let newTheme = '' ;
186
+ if ( darkModeDefault ) {
187
+ newTheme = isAlternate ? baseTheme : alternateTheme ;
188
+ } else {
189
+ newTheme = isAlternate ? alternateTheme : baseTheme ;
190
+ }
191
+ const changeGiscusTheme = ( ) => {
192
+ // From: https://github.com/giscus/giscus/issues/336
193
+ const sendMessage = ( message ) => {
194
+ const iframe = document . querySelector ( 'iframe.giscus-frame' ) ;
195
+ if ( ! iframe ) return ;
196
+ iframe . contentWindow . postMessage ( { giscus : message } , 'https://giscus.app' ) ;
197
+ }
198
+ sendMessage ( {
199
+ setConfig : {
200
+ theme : newTheme
201
+ }
202
+ } ) ;
203
+ }
204
+ const isGiscussLoaded = window . document . querySelector ( 'iframe.giscus-frame' ) !== null ;
205
+ if ( isGiscussLoaded ) {
206
+ changeGiscusTheme ( ) ;
207
+ }
208
+ }
171
209
const toggleColorMode = ( alternate ) => {
172
210
// Switch the stylesheets
173
211
const alternateStylesheets = window . document . querySelectorAll ( 'link.quarto-color-scheme.quarto-color-alternate' ) ;
@@ -234,13 +272,15 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
234
272
return localAlternateSentinel ;
235
273
}
236
274
}
237
- let localAlternateSentinel = 'default' ;
275
+ const darkModeDefault = false ;
276
+ let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default' ;
238
277
// Dark / light mode switch
239
278
window . quartoToggleColorScheme = ( ) => {
240
279
// Read the current dark / light value
241
280
let toAlternate = ! hasAlternateSentinel ( ) ;
242
281
toggleColorMode ( toAlternate ) ;
243
282
setStyleSentinel ( toAlternate ) ;
283
+ toggleGiscusIfUsed ( toAlternate , darkModeDefault ) ;
244
284
} ;
245
285
// Ensure there is a toggle, if there isn't float one in the top right
246
286
if ( window . document . querySelector ( '.quarto-color-scheme-toggle' ) === null ) {
@@ -319,10 +359,9 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
319
359
// clear code selection
320
360
e . clearSelection ( ) ;
321
361
} ) ;
322
- function tippyHover ( el , contentFn ) {
362
+ function tippyHover ( el , contentFn , onTriggerFn , onUntriggerFn ) {
323
363
const config = {
324
364
allowHTML : true ,
325
- content : contentFn ,
326
365
maxWidth : 500 ,
327
366
delay : 100 ,
328
367
arrow : false ,
@@ -332,8 +371,17 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
332
371
interactive : true ,
333
372
interactiveBorder : 10 ,
334
373
theme : 'quarto' ,
335
- placement : 'bottom-start'
374
+ placement : 'bottom-start' ,
336
375
} ;
376
+ if ( contentFn ) {
377
+ config . content = contentFn ;
378
+ }
379
+ if ( onTriggerFn ) {
380
+ config . onTrigger = onTriggerFn ;
381
+ }
382
+ if ( onUntriggerFn ) {
383
+ config . onUntrigger = onUntriggerFn ;
384
+ }
337
385
window . tippy ( el , config ) ;
338
386
}
339
387
const noterefs = window . document . querySelectorAll ( 'a[role="doc-noteref"]' ) ;
@@ -347,6 +395,125 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
347
395
const note = window . document . getElementById ( id ) ;
348
396
return note . innerHTML ;
349
397
} ) ;
398
+ }
399
+ const xrefs = window . document . querySelectorAll ( 'a.quarto-xref' ) ;
400
+ const processXRef = ( id , note ) => {
401
+ // Strip column container classes
402
+ const stripColumnClz = ( el ) => {
403
+ el . classList . remove ( "page-full" , "page-columns" ) ;
404
+ if ( el . children ) {
405
+ for ( const child of el . children ) {
406
+ stripColumnClz ( child ) ;
407
+ }
408
+ }
409
+ }
410
+ stripColumnClz ( note )
411
+ if ( id === null || id . startsWith ( 'sec-' ) ) {
412
+ // Special case sections, only their first couple elements
413
+ const container = document . createElement ( "div" ) ;
414
+ if ( note . children && note . children . length > 2 ) {
415
+ container . appendChild ( note . children [ 0 ] . cloneNode ( true ) ) ;
416
+ for ( let i = 1 ; i < note . children . length ; i ++ ) {
417
+ const child = note . children [ i ] ;
418
+ if ( child . tagName === "P" && child . innerText === "" ) {
419
+ continue ;
420
+ } else {
421
+ container . appendChild ( child . cloneNode ( true ) ) ;
422
+ break ;
423
+ }
424
+ }
425
+ if ( window . Quarto ?. typesetMath ) {
426
+ window . Quarto . typesetMath ( container ) ;
427
+ }
428
+ return container . innerHTML
429
+ } else {
430
+ if ( window . Quarto ?. typesetMath ) {
431
+ window . Quarto . typesetMath ( note ) ;
432
+ }
433
+ return note . innerHTML ;
434
+ }
435
+ } else {
436
+ // Remove any anchor links if they are present
437
+ const anchorLink = note . querySelector ( 'a.anchorjs-link' ) ;
438
+ if ( anchorLink ) {
439
+ anchorLink . remove ( ) ;
440
+ }
441
+ if ( window . Quarto ?. typesetMath ) {
442
+ window . Quarto . typesetMath ( note ) ;
443
+ }
444
+ // TODO in 1.5, we should make sure this works without a callout special case
445
+ if ( note . classList . contains ( "callout" ) ) {
446
+ return note . outerHTML ;
447
+ } else {
448
+ return note . innerHTML ;
449
+ }
450
+ }
451
+ }
452
+ for ( var i = 0 ; i < xrefs . length ; i ++ ) {
453
+ const xref = xrefs [ i ] ;
454
+ tippyHover ( xref , undefined , function ( instance ) {
455
+ instance . disable ( ) ;
456
+ let url = xref . getAttribute ( 'href' ) ;
457
+ let hash = undefined ;
458
+ if ( url . startsWith ( '#' ) ) {
459
+ hash = url ;
460
+ } else {
461
+ try { hash = new URL ( url ) . hash ; } catch { }
462
+ }
463
+ if ( hash ) {
464
+ const id = hash . replace ( / ^ # \/ ? / , "" ) ;
465
+ const note = window . document . getElementById ( id ) ;
466
+ if ( note !== null ) {
467
+ try {
468
+ const html = processXRef ( id , note . cloneNode ( true ) ) ;
469
+ instance . setContent ( html ) ;
470
+ } finally {
471
+ instance . enable ( ) ;
472
+ instance . show ( ) ;
473
+ }
474
+ } else {
475
+ // See if we can fetch this
476
+ fetch ( url . split ( '#' ) [ 0 ] )
477
+ . then ( res => res . text ( ) )
478
+ . then ( html => {
479
+ const parser = new DOMParser ( ) ;
480
+ const htmlDoc = parser . parseFromString ( html , "text/html" ) ;
481
+ const note = htmlDoc . getElementById ( id ) ;
482
+ if ( note !== null ) {
483
+ const html = processXRef ( id , note ) ;
484
+ instance . setContent ( html ) ;
485
+ }
486
+ } ) . finally ( ( ) => {
487
+ instance . enable ( ) ;
488
+ instance . show ( ) ;
489
+ } ) ;
490
+ }
491
+ } else {
492
+ // See if we can fetch a full url (with no hash to target)
493
+ // This is a special case and we should probably do some content thinning / targeting
494
+ fetch ( url )
495
+ . then ( res => res . text ( ) )
496
+ . then ( html => {
497
+ const parser = new DOMParser ( ) ;
498
+ const htmlDoc = parser . parseFromString ( html , "text/html" ) ;
499
+ const note = htmlDoc . querySelector ( 'main.content' ) ;
500
+ if ( note !== null ) {
501
+ // This should only happen for chapter cross references
502
+ // (since there is no id in the URL)
503
+ // remove the first header
504
+ if ( note . children . length > 0 && note . children [ 0 ] . tagName === "HEADER" ) {
505
+ note . children [ 0 ] . remove ( ) ;
506
+ }
507
+ const html = processXRef ( null , note ) ;
508
+ instance . setContent ( html ) ;
509
+ }
510
+ } ) . finally ( ( ) => {
511
+ instance . enable ( ) ;
512
+ instance . show ( ) ;
513
+ } ) ;
514
+ }
515
+ } , function ( instance ) {
516
+ } ) ;
350
517
}
351
518
let selectedAnnoteEl ;
352
519
const selectorForAnnotation = ( cell , annotation ) => {
@@ -389,6 +556,7 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
389
556
}
390
557
div . style . top = top - 2 + "px" ;
391
558
div . style . height = height + 4 + "px" ;
559
+ div . style . left = 0 ;
392
560
let gutterDiv = window . document . getElementById ( "code-annotation-line-highlight-gutter" ) ;
393
561
if ( gutterDiv === null ) {
394
562
gutterDiv = window . document . createElement ( "div" ) ;
@@ -414,6 +582,32 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
414
582
} ) ;
415
583
selectedAnnoteEl = undefined ;
416
584
} ;
585
+ // Handle positioning of the toggle
586
+ window . addEventListener (
587
+ "resize" ,
588
+ throttle ( ( ) => {
589
+ elRect = undefined ;
590
+ if ( selectedAnnoteEl ) {
591
+ selectCodeLines ( selectedAnnoteEl ) ;
592
+ }
593
+ } , 10 )
594
+ ) ;
595
+ function throttle ( fn , ms ) {
596
+ let throttle = false ;
597
+ let timer ;
598
+ return ( ...args ) => {
599
+ if ( ! throttle ) { // first call gets through
600
+ fn . apply ( this , args ) ;
601
+ throttle = true ;
602
+ } else { // all the others get throttled
603
+ if ( timer ) clearTimeout ( timer ) ; // cancel #2
604
+ timer = setTimeout ( ( ) => {
605
+ fn . apply ( this , args ) ;
606
+ timer = throttle = false ;
607
+ } , ms ) ;
608
+ }
609
+ } ;
610
+ }
417
611
// Attach click handler to the DT
418
612
const annoteDls = window . document . querySelectorAll ( 'dt[data-target-cell]' ) ;
419
613
for ( const annoteDlNode of annoteDls ) {
@@ -477,4 +671,5 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
477
671
478
672
479
673
674
+
480
675
</ body > </ html >
0 commit comments