1
+ <!-- Giscus -->
2
+ <!-- https://squidfunk.github.io/mkdocs-material/setup/adding-a-comment-system/#giscus-integration -->
3
+ < div id ="feedback " style ="display: none; ">
4
+ < h2 id ="__comments "> Feedback</ h2 >
5
+ < script src ="https://giscus.app/client.js "
6
+ data-repo ="mkdocstrings/typescript "
7
+ data-repo-id ="R_kgDOKutohQ "
8
+ data-category ="Documentation "
9
+ data-category-id ="DIC_kwDOKutohc4Chq2T "
10
+ data-mapping ="pathname "
11
+ data-strict ="1 "
12
+ data-reactions-enabled ="0 "
13
+ data-emit-metadata ="0 "
14
+ data-input-position ="top "
15
+ data-theme ="preferred_color_scheme "
16
+ data-lang ="en "
17
+ data-loading ="lazy "
18
+ crossorigin ="anonymous "
19
+ async >
20
+ </ script >
21
+
22
+ <!-- Synchronize Giscus theme with palette -->
23
+ < script >
24
+ var giscus = document . querySelector ( "script[src*=giscus]" )
25
+
26
+ // Set palette on initial load
27
+ var palette = __md_get ( "__palette" )
28
+ if ( palette && typeof palette . color === "object" ) {
29
+ var theme = palette . color . scheme === "slate"
30
+ ? "transparent_dark"
31
+ : "light"
32
+
33
+ // Instruct Giscus to set theme
34
+ giscus . setAttribute ( "data-theme" , theme )
35
+ }
36
+
37
+ // Register event handlers after documented loaded
38
+ document . addEventListener ( "DOMContentLoaded" , function ( ) {
39
+ var ref = document . querySelector ( "[data-md-component=palette]" )
40
+ ref . addEventListener ( "change" , function ( ) {
41
+ var palette = __md_get ( "__palette" )
42
+ if ( palette && typeof palette . color === "object" ) {
43
+ var theme = palette . color . scheme === "slate"
44
+ ? "transparent_dark"
45
+ : "light"
46
+
47
+ // Instruct Giscus to change theme
48
+ var frame = document . querySelector ( ".giscus-frame" )
49
+ frame . contentWindow . postMessage (
50
+ { giscus : { setConfig : { theme } } } ,
51
+ "https://giscus.app"
52
+ )
53
+ }
54
+ } )
55
+ } )
56
+ </ script >
57
+ </ div >
0 commit comments