Skip to content

Commit

Permalink
Update documents (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimikage authored Mar 18, 2024
1 parent 1c02f38 commit 5a5a6e0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
12 changes: 11 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
using Documenter, ProfileSVG

if :size_threshold in fieldnames(Documenter.HTML)
size_th = (
example_size_threshold = nothing,
size_threshold = nothing,
)
else
size_th = ()
end

makedocs(
clean = false,
modules=[ProfileSVG],
format=Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true",
format=Documenter.HTML(;prettyurls = get(ENV, "CI", nothing) == "true",
size_th...,
assets = ["assets/profilesvg.css"]),
sitename="ProfileSVG",
pages=[
Expand Down
7 changes: 5 additions & 2 deletions docs/src/assets/profile_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ using Base.StackTraces: StackFrame

function stackframe(func, file, line; C=false, inlined=false)
if func === :eval
mi = first(Base.method_instances(eval, Tuple{Expr}))
world = Base.get_world_counter()
mi = first(Base.method_instances(eval, Tuple{Expr}, world))
mi.def.module = Core
else
mi = nothing
Expand Down Expand Up @@ -37,7 +38,9 @@ backtraces = UInt64[
0, 8, 9, 41, 40, 1, 3, 23, 13,
0, 8, 9, 41, 40, 1, 3, 23, 13,
0]

if isdefined(Profile, :add_fake_meta)
backtraces = Profile.add_fake_meta(backtraces)
end
lidict = Dict{UInt64,StackFrame}(
1 => stackframe("#mapslices#115", ".\\abstractarray.jl", 2018),
2 => stackframe("#mapslices#115", ".\\abstractarray.jl", 2029),
Expand Down
7 changes: 6 additions & 1 deletion docs/src/other-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ Note that the actual rendering results depend on the viewer.
ProfileSVG.view(font="'Times New Roman', serif", fontsize=16)
ProfileSVG.view(g, font="'Times New Roman', serif", fontsize=16) # hide
```

!!! tip
By setting `font` to `"system-ui"`, `"ui-serif"`, `"ui-sans-serif"`, etc.,
the default user interface font may be used.

## `notext`

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

```@example ex
ProfileSVG.set_default(StackFrameCategory(), roundradius=0, fontsize=8)
ProfileSVG.set_default(StackFrameCategory(), roundradius=0, font="system-ui", fontsize=8)
ProfileSVG.view(width=300)
ProfileSVG.view(g, width=300) # hide
```

0 comments on commit 5a5a6e0

Please sign in to comment.