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

Allow and/or automatically replace indented code blocks #207

Closed
tlienart opened this issue Sep 4, 2019 · 1 comment
Closed

Allow and/or automatically replace indented code blocks #207

tlienart opened this issue Sep 4, 2019 · 1 comment
Milestone

Comments

@tlienart
Copy link
Owner

tlienart commented Sep 4, 2019

In Jekyll and elsewhere it seems that people like the 4-space or 1-tab indented stuff like

    this is some
    code

which would appear as such. At the moment JuDoc only takes blocks that are fenced with ``` as code blocks (and this should be encouraged anyway to be compatible with the code execution thing)

@tlienart tlienart added the wip label Sep 6, 2019
@tlienart tlienart added this to the 0.3+ milestone Sep 6, 2019
@tlienart
Copy link
Owner Author

tlienart commented Sep 8, 2019

actually this is going to be a lot easier than initially thought given that Julia's Markdown parser properly finds these things:

julia> a = """
blah `single` and

    1+1
    2+2

end
"""

julia> c = Markdown.parse(a).content
Markdown.Paragraph(Any["blah ", Markdown.Code("", "single"), " and"])
Markdown.Code("", "1+1\n2+2")                                        
Markdown.Paragraph(Any["end"])

julia> c[2].language = "julia";

julia> Markdown.html.(c)
3-element Array{String,1}:
 "<p>blah <code>single</code> and</p>"                              
 "<pre><code class=\"language-julia\">1&#43;1\n2&#43;2</code></pre>"
 "<p>end</p>"

So I think what remains to do is:

  • allow the user to use a @def for the default-language to be applied on indented code blocks (which by default would be julia)
  • in the md2html, update the pipeline so that Markdown.Code blocks are interpreted and appropriately modified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant