Skip to content

Commit

Permalink
only replace .jl at the end of the input file
Browse files Browse the repository at this point in the history
- Package names could contain `.jl`
  • Loading branch information
maltezfaria committed Oct 14, 2024
1 parent 363f711 commit a97e90b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function generate_plaintext(
return join(cell_strings, "\n\n")
end

function generate_md(input; output = replace(input, ".jl" => ".md"))
function generate_md(input; output = replace(input, r"\.jl$" => ".md"))
fname = basename(input)
notebook = Pluto.load_notebook(input)
header =
Expand All @@ -84,6 +84,7 @@ function generate_md(input; output = replace(input, ".jl" => ".md"))
end
textcomment(text) = string("<!-- ", text, " -->")
str = generate_plaintext(notebook, "md"; header, codewrapper, textcomment)

open(output, "w") do io
return write(io, str)
end
Expand Down

0 comments on commit a97e90b

Please sign in to comment.