tlienart / Franklin.jl

(yet another) static site generator. Simple, customisable, fast, maths with KaTeX, code evaluation, optional pre-rendering, in Julia.
https://franklinjl.org
MIT License
953 stars 112 forks source link

New REPL help mode display is broken by macros #1040

Open gdalle opened 1 year ago

gdalle commented 1 year ago

Try the following in a Franklin page:

```?
@show

Some text


The text appears as a link
tlienart commented 1 year ago

Hmm

julia> fd2html("""
       ```?
       @show
   some text
   """);

julia> println(ans)

help?> @show
@show exs...

Prints one or more expressions, and their results, to stdout, and returns the last result.

See also: show, @info, println.

Examples

julia> x = @show 1+2
1 + 2 = 3
3

julia> @show x^2 x/2;
x ^ 2 = 9
x / 2 = 1.5

some text



Could you share the full markdown of the page in which this appears?
tlienart commented 1 year ago

@gdalle did you guys figure this one and can I close it? or is it still causing troubles?

gdalle commented 1 year ago

My friends can reproduce this. So you're most definitely not my friend 🤣

gdalle commented 1 year ago

Let me cook up an MWE

gdalle commented 1 year ago

For me it works even with this simple page

@def title = "MWE"

```?
@show

Some text


If it helps, the link "Some text" points to <http://localhost:8000/pages/mwe/@ref%20man-logging>
gdalle commented 1 year ago

MWE.txt This is really an HTML page but GitHub didn't like the format, so rename it before opening

tlienart commented 1 year ago

could you please try the latest commit on master and report if it fixed the issue? (basically the docstring has its own markdown and references which Franklin has to dance around and ignore, here it looks like a regex needed to be a bit more general)

gdalle commented 1 year ago

sure, would you prefer if I switched to Xranklin for good? We had discussed it but I never did it

tlienart commented 1 year ago

you could but you'd be one of the early users and shifting from what you have will take some adjustments (for instance @def ... will work but are now deprecated in favour of +++ ... +++ blocks)

one advantage would be to have the ability to have per-page project which may be useful in your case.

tlienart commented 1 year ago

(I would certainly appreciate your feedback and you battle testing it though!)

gdalle commented 1 year ago

per-page projects would be nice! I'll do that in a bit