Skip to content

Commit

Permalink
Convert markup generation to a function (#43236)
Browse files Browse the repository at this point in the history
Using a function to generate markup ensures that its temporary variables (e.g. `str`) are not visible any more later on, avoiding compiler warnings.

Co-authored-by: woclass <[email protected]>
  • Loading branch information
eschnett and inkydragon authored Apr 29, 2022
1 parent e780e5a commit 6026b5f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions doc/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,20 @@ end
const render_pdf = "pdf" in ARGS

# Generate a suitable markdown file from NEWS.md and put it in src
str = read(joinpath(@__DIR__, "..", "NEWS.md"), String)
splitted = split(str, "<!--- generated by NEWS-update.jl: -->")
@assert length(splitted) == 2
replaced_links = replace(splitted[1], r"\[\#([0-9]*?)\]" => s"[#\g<1>](https://github.com/JuliaLang/julia/issues/\g<1>)")
write(
joinpath(@__DIR__, "src", "NEWS.md"),
"""
```@meta
EditURL = "https://github.com/JuliaLang/julia/blob/master/NEWS.md"
```
""" * replaced_links)
function generate_markdown(basename)
str = read(joinpath(@__DIR__, "..", "$basename.md"), String)
splitted = split(str, "<!--- generated by $basename-update.jl: -->")
@assert length(splitted) == 2
replaced_links = replace(splitted[1], r"\[\#([0-9]*?)\]" => s"[#\g<1>](https://github.com/JuliaLang/julia/issues/\g<1>)")
write(
joinpath(@__DIR__, "src", "$basename.md"),
"""
```@meta
EditURL = "https://github.com/JuliaLang/julia/blob/master/$basename.md"
```
""" * replaced_links)
end
generate_markdown("NEWS")

Manual = [
"manual/getting-started.md",
Expand Down

4 comments on commit 6026b5f

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible issues were detected. A full report can be found here.

Please sign in to comment.