Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft PR for fr818 #819

Closed
wants to merge 1 commit into from
Closed

draft PR for fr818 #819

wants to merge 1 commit into from

Conversation

tlienart
Copy link
Owner

No description provided.

@kescobo
Copy link
Contributor

kescobo commented May 20, 2021

This is super helpful, thanks for getting me started!

@kescobo
Copy link
Contributor

kescobo commented May 20, 2021

@tlienart Is there a straightforward way to isolate and test resolve_code_block()?

I tried

julia> replcode = """
       ```julia
       foo = 2+2
       bar = foo + 3
       ```"""
"```julia\nfoo = 2+2\nbar = foo + 3\n```"

julia> Franklin.resolve_code_block(SubString(replcode), repl=true)
"<pre><code class=\"language-julia\">foo &#61; 2&#43;2\nbar &#61; foo &#43; 3</code></pre>"

but this hits isnothing(rpath) && return html_code(code, lang) and returns. Putting a block into an existing site and using serve() to throw the error is a bit challenging.

@tlienart
Copy link
Owner Author

Set shortcut=true, repl would never be true without shortcut being as well

@kescobo
Copy link
Contributor

kescobo commented May 24, 2021

shortcut = true throws TypeError from lang = locvar(:lang)::String...

@tlienart
Copy link
Owner Author

tlienart commented May 25, 2021

use Franklin.set_var!(Franklin.LOCAL_VARS, "lang", "julia") before so that locvar(:lang) returns 'Julia'. Either that or discard this and rewrite your own function which will likely be faster for now.,

@tlienart
Copy link
Owner Author

tlienart commented Jun 9, 2021

hello @kescobo do you need any help with this?

@kescobo
Copy link
Contributor

kescobo commented Jun 9, 2021

@tlienart I haven't had much opportunity to work on it in the past couple of weeks, sorry 😐. I got stuck trying to test a function, but haven't had time to try your latest suggestion - hoping to return to it next week, but if it's a quick fix on your end, I won't be bothered of you take it over.

@tlienart
Copy link
Owner Author

tlienart commented Jun 9, 2021

no worries, I'm keen for external users to try stuff for feature requests like this one and was just offering to unblock you if you had time to push this, there's no rush in any case :)

@kescobo
Copy link
Contributor

kescobo commented Aug 24, 2021

Sorry this has languished so long. I am still planning to work on this - but I don't want to be a cookie licker... If you or someone else wants this, totally fine with me to take it.

@tlienart
Copy link
Owner Author

No worries @kescobo, you're the only person who's asked for this and while I support the idea and will help you push it through, I don't think someone else will :-)

@tlienart tlienart closed this Jan 31, 2022
@tlienart
Copy link
Owner Author

tlienart commented Feb 12, 2022

Just a note and a ref that Shashi Gowda had a go at it: JuliaSymbolics/Symbolics.jl#527 and it's looking great!

Reopening to keep track of this for now

@tlienart tlienart reopened this Feb 12, 2022
@gdalle
Copy link

gdalle commented Jul 9, 2023

Bumping to say that I strongly support this idea, it's very useful for introductory Julia blog posts like the one I'm writing

@tlienart
Copy link
Owner Author

tlienart commented Jul 9, 2023

finally had a stab at this, see #1035 ; kindly try it there, if it seems to work well for you I'll merge it and add it as a patch release (even though it's kind of a new feature but I had told myself I wouldn't do a minor release until the upcoming big one so this would be a bit of an exception)

@tlienart tlienart closed this Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants