File tree Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,5 @@ src/**/*.tex
29
29
30
30
# For the Mac (Finder metatdata files)
31
31
* .DS_Store
32
+
33
+ .luarc.json
Original file line number Diff line number Diff line change 4
4
-- This is combined with the output of the gen_index.py script
5
5
-- to create a clickable index of all the functions in the documentation
6
6
7
+
8
+ index = quarto .utils .resolve_path (" ./functions-reference/functions_index.qmd" )
9
+ indexText = io.open (index ):read (" *a" )
10
+
7
11
function extractIndexEntry (elementText )
8
12
if elementText :find (" %; %-%-%>$" ) ~= nil then
9
13
return " index-entry-" .. tostring (pandoc .sha1 (elementText ))
10
14
end
11
15
return nil
12
16
end
13
17
14
- if FORMAT == " latex" then
15
- return {} -- latex uses mkindex, not this
16
- else
18
+ function escape (text )
19
+ return text :gsub (" \\ " , " \\\\ " ):gsub (" *" , " \\ *" )
20
+ end
21
+
22
+ if quarto .doc .is_format (" html" ) then -- latex uses mkindex, not this
17
23
return {
18
24
RawBlock = function (el )
19
25
if el .format == " html" then
23
29
end
24
30
end
25
31
return nil -- no change
32
+ end ,
33
+ Strong = function (el2 )
34
+ return pandoc .walk_inline (el2 , {
35
+ Code = function (el3 )
36
+ if el3 .text ~= nil then
37
+ -- only create a link if this appears in the index
38
+ local escaped = escape (el3 .text )
39
+ if indexText :find (escaped , 1 , true ) ~= nil then
40
+ return pandoc .Link (el3 , " ./functions_index.qmd#" .. escaped ,
41
+ " Jump to index entry" , {class = " unlink" })
42
+ end
43
+ end
44
+ return nil
45
+ end
46
+ })
26
47
end
27
48
}
49
+
28
50
end
Original file line number Diff line number Diff line change 18
18
}
19
19
}
20
20
21
+ html {
22
+ scroll-padding-top : 70px ; /* height of header */
23
+ }
21
24
22
25
@media (min-width : 991.98px ) {
23
26
# quarto-header {
@@ -308,6 +311,11 @@ a.nav-link.active { color: var(--stan-secondary);}
308
311
a .sidebar-item-text .sidebar-link .active { color : var (--stan-secondary ); }
309
312
.sidebar .a .active { color : var (--stan-secondary ); }
310
313
314
+ a .unlink {
315
+ color : inherit;
316
+ text-decoration : none;
317
+ }
318
+
311
319
312
320
div [data-bs-target ^= "#quarto-sidebar-section" ] {
313
321
font-weight : bold;
You can’t perform that action at this time.
0 commit comments