-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathutils.jl
More file actions
40 lines (35 loc) · 796 Bytes
/
utils.jl
File metadata and controls
40 lines (35 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function hfun_bar(vname)
val = Meta.parse(vname[1])
return round(sqrt(val), digits=2)
end
function hfun_m1fill(vname)
var = vname[1]
return pagevar("index", var)
end
function lx_baz(com, _)
# keep this first line
brace_content = Franklin.content(com.braces[1]) # input string
# do whatever you want here
return uppercase(brace_content)
end
function lx_defaultoutput(com, _)
raw"""
```julia:write_helper
# hideall
output_dir = @OUTPUT
function write_svg(name, p)
fig_path = joinpath(output_dir, "$name.svg")
StatsPlots.savefig(fig_path)
end;
```
\output{write_helper}
```julia:plot
using StatsPlots
write_svg("chns", # hide
StatsPlots.plot(chns)
) # hide
```
\output{plot}
\fig{chns.svg}
"""
end