Skip to content

Commit

Permalink
add aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Nov 20, 2022
1 parent 566585a commit 80b8078
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ using PlotDocs, PlotThemes, Plots, RecipesBase, RecipesPipeline
using Documenter, DemoCards, Literate
import StatsPlots

# monkey patch `Documenter` for duplicate gallery search results - see github.com/JuliaPlots/Plots.jl/issues/4157
# note that this could break on minor `Documenter` releases
# monkey patch `Documenter` - note that this could break on minor `Documenter` releases
@eval Documenter.Writers.HTMLWriter domify(ctx, navnode) = begin
# github.com/JuliaDocs/Documenter.jl/blob/327d155f992ec7c63e35fa2cb08f7f7c2d33409a/src/Writers/HTMLWriter.jl#L1448-L1455
page = getpage(ctx, navnode)
Expand All @@ -12,12 +11,12 @@ import StatsPlots
############################################################
# begin addition
add_to_index = if (m = match(r"gallery/(\w+)/", lowercase(rec.src))) !== nothing
first(m.captures) == "gr" # only add `GR` gallery pages to `search_index`
first(m.captures) == "gr" # only add `GR` gallery pages to `search_index` (github.com/JuliaPlots/Plots.jl/issues/4157)
else
true
end
if (m = match(r"generated/attributes_(\w+).html", lowercase(rec.src))) !== nothing
# fix attributes search terms (:Series, :Plot, :Subplot, :Axis)
# fix attributes search terms: `Series`, `Plot`, `Subplot` and `Axis` (github.com/JuliaPlots/Plots.jl/issues/2337)
rec = SearchRecord(
rec.src, rec.page, rec.fragment, rec.category, rec.title, rec.page_title,
$(ATTRIBUTE_SEARCH)[first(m.captures)]
Expand Down
2 changes: 1 addition & 1 deletion src/PlotDocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function generate_attr_markdown(c)
md = open(joinpath(GENDIR, "attributes_$cstr.md"), "w")

df = make_attr_df(c, ATTRIBUTE_DEFAULTS[c])
ATTRIBUTE_SEARCH[cstr] = attr_text * ' ' * join(df.Attribute, ' ')
ATTRIBUTE_SEARCH[cstr] = attr_text * ' ' * join(df.Attribute, ' ') * join(df.Aliases, ' ')

write(md, """
```@meta
Expand Down

0 comments on commit 80b8078

Please sign in to comment.