JuliaDocs/Documenter.jl

Generalize the at-example line hiding

Open

#2,025 opened on Jan 25, 2023

View on GitHub
 (0 comments) (2 reactions) (0 assignees)Julia (513 forks)batch import
Type: Enhancementhelp wanted

Repository metrics

Stars
 (910 stars)
PR merge metrics
 (Avg merge 16d 9h) (3 merged PRs in 30d)

Description

Currently, you can only hide lines that end with # hide. We could generalize it by allowing the user to pass a hide option to the block which should be a regex (or an array of regexes) that we then occursin against the lines.Potential use cases:

  • Hiding JuliaFormatter #! format: off with e.g. a r"^#! format:" regex.
  • Filtering out comments with r"^#
```@example my-block; hide = r"^#! format:"
#! format: off
weirdly_formatted_code_that_I_want_to_keep_that_way(...)
#! format: on
```

X-ref: https://discourse.julialang.org/t/interaction-between-logging-jl-juliaformatter-jl-and-documenter-jl/93504

Contributor guide