Skip to content

Commit 1e5208b

Browse files
committed
Update documents (#73)
1 parent 559ba80 commit 1e5208b

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

Diff for: docs/make.jl

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
using Documenter, ProfileSVG
22

3+
if :size_threshold in fieldnames(Documenter.HTML)
4+
size_th = (
5+
example_size_threshold = nothing,
6+
size_threshold = nothing,
7+
)
8+
else
9+
size_th = ()
10+
end
11+
312
makedocs(
413
clean = false,
514
modules=[ProfileSVG],
6-
format=Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true",
15+
format=Documenter.HTML(;prettyurls = get(ENV, "CI", nothing) == "true",
16+
size_th...,
717
assets = ["assets/profilesvg.css"]),
818
sitename="ProfileSVG",
919
pages=[

Diff for: docs/src/assets/profile_test.jl

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ using Base.StackTraces: StackFrame
33

44
function stackframe(func, file, line; C=false, inlined=false)
55
if func === :eval
6-
mi = first(Base.method_instances(eval, Tuple{Expr}))
6+
world = Base.get_world_counter()
7+
mi = first(Base.method_instances(eval, Tuple{Expr}, world))
78
mi.def.module = Core
89
else
910
mi = nothing
@@ -37,7 +38,9 @@ backtraces = UInt64[
3738
0, 8, 9, 41, 40, 1, 3, 23, 13,
3839
0, 8, 9, 41, 40, 1, 3, 23, 13,
3940
0]
40-
41+
if isdefined(Profile, :add_fake_meta)
42+
backtraces = Profile.add_fake_meta(backtraces)
43+
end
4144
lidict = Dict{UInt64,StackFrame}(
4245
1 => stackframe("#mapslices#115", ".\\abstractarray.jl", 2018),
4346
2 => stackframe("#mapslices#115", ".\\abstractarray.jl", 2029),

Diff for: docs/src/other-options.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ Note that the actual rendering results depend on the viewer.
8484
ProfileSVG.view(font="'Times New Roman', serif", fontsize=16)
8585
ProfileSVG.view(g, font="'Times New Roman', serif", fontsize=16) # hide
8686
```
87+
88+
!!! tip
89+
By setting `font` to `"system-ui"`, `"ui-serif"`, `"ui-sans-serif"`, etc.,
90+
the default user interface font may be used.
91+
8792
## `notext`
8893

8994
The `notext` option specifies the visibility of overlaid texts on the frames. If
@@ -145,7 +150,7 @@ You can specify the default values for options with
145150
You can also reset the settings with [`ProfileSVG.init`](@ref).
146151

147152
```@example ex
148-
ProfileSVG.set_default(StackFrameCategory(), roundradius=0, fontsize=8)
153+
ProfileSVG.set_default(StackFrameCategory(), roundradius=0, font="system-ui", fontsize=8)
149154
ProfileSVG.view(width=300)
150155
ProfileSVG.view(g, width=300) # hide
151156
```

0 commit comments

Comments
 (0)