Open iago-lito opened 2 years ago
hmm this might be related to https://github.com/MichaelHatherly/CommonMark.jl/issues/43
I'm sorry @domluna I'm not sure I understand why you think it would be related. Can you elaborate?
My understanding is that JuliaFormatter.jl
is responsible for the splitting/splicing of julia/markdown parts. And that it then hands the markdown parts out to CommonMark.jl
.
As a consequence, the decision how to format the markdown parts is up to CommonMark.jl
, but the decision whether or not to format the markdown parts is only up to JuliaFormatter.jl
, is it not?
Hmmm that might be right. I'm not entirely sure it can be decoupled like that though. Because even if I do
formatted = markdown(
enable!(
Parser(),
[
# AdmonitionRule(),
# FootnoteRule(),
# MathRule(),
# TableRule(),
# FrontMatterRule(),
FormatRule(style, state.opts),
],
)(
deindented_string,
),
)
it still produces the output above. But there might be a way not alter the markdown at all.
Any movement on this by chance? I would love to be able to have automatic formatting on save for julia markdown files stored in jupyterbook/myst
i think this is blocked by commonmark atm
On Mon, Jul 10, 2023 at 2:30 PM Jesse Perla @.***> wrote:
Any movement on this by chance? I would love to be able to have automatic formatting on save for julia markdown files stored in jupyterbook/myst
— Reply to this email directly, view it on GitHub https://github.com/domluna/JuliaFormatter.jl/issues/638#issuecomment-1629487311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAORUF7IRDGA225LHIJ72KLXPRC3ZANCNFSM6AAAAAAQKOIHLQ . You are receiving this because you were mentioned.Message ID: @.***>
Thanks @domluna
Is another way to do this just to more manually scan through the file and manually format selections? I don't want the formatter to touch the non-julia code at all. It might not even fulfill commonmark.
I am very happy that
JuliaFormatter.jl
crawls within my*md
files to correctly format chuks of julia code found there. But I wish it would leave the rest of the document alone. Or that I at least could configure what it does within it. Do I have any option to control formatting of the markdown parts? For instance, I wished that: