/
utils.jl
48 lines (44 loc) · 1.4 KB
/
utils.jl
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
41
42
43
44
45
46
47
48
function hfun_plutonotebookpage(params)
path = params[1]
path_to_index = if endswith(path, ".jl")
splitext(path)[begin]
else
path
end
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy#directives
return """
<style>
.content {
max-width: 100%;
margin-right: 0px;
padding: 0px;
overflow-y: hidden;
height: 100vh;
}
.franklin-content {
padding: 0px;
}
.page-foot {
display: none;
}
.plutopage {
height: 100vh;
}
.smallscreenlink {
display: none;
}
@media (max-width: 768px) {
.franklin-content {
padding: 0px;
}
}
</style>
<iframe width="100%" height="100%"
src="$(path_to_index)"
class="plutopage"
frameborder="0"
allow="accelerometer; ambient-light-sensor; autoplay; battery; camera; display-capture; document-domain; encrypted-media; execution-while-not-rendered; execution-while-out-of-viewport; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; navigation-override; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; wake-lock; screen-wake-lock; vr; web-share; xr-spatial-tracking"
allowfullscreen></iframe>
<a class="smallscreenlink" href="$(path_to_index)"></a>
"""
end