Literate.jl icon indicating copy to clipboard operation
Literate.jl copied to clipboard

Multiline string and `#`

Open mauro3 opened this issue 3 years ago • 3 comments

In a multiline string a # shouldn't do anything. E.g. this errors:

"""
A fn

# Example

An ex.
"""
f(x) = 1

with ERROR: LoadError: LoadError: syntax: incomplete: invalid string syntax in expression starting at string:1

Work-around

"""
A fn

## Example

An ex.
"""
f(x) = 1

Note, this is not tied to doc-strings but in general multi-line strings.

mauro3 avatar Nov 09 '21 12:11 mauro3

I don't think this can be easily fixed without a Julia parser...

fredrikekre avatar Nov 09 '21 12:11 fredrikekre

I see, no worries.

mauro3 avatar Nov 09 '21 12:11 mauro3

I was considering asking this in a separate issue, but it kind of resonates with this one.

I'm curious why Literate chose to overload Julia comments for documentation text rather than using top level Markdown strings?

Might this be changed in a furure major relase, or maybe become controlable through a global flag?

MarkNahabedian avatar Feb 11 '24 17:02 MarkNahabedian