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

Is it possible to get comments inside a code block while converting to markdown? #217

Closed
sathvikbhagavan opened this issue Jul 9, 2023 · 2 comments

Comments

@sathvikbhagavan
Copy link

MWE:

test.jl:

begin
    # this is comment in code
    x = 1
end

If I run

Literate.markdown("test.jl", ".")

I get the following output:

````@example test
begin
````

this is comment in code

````@example test
    x = 1
end
````

instead I want

````@example test
begin
	 # this is comment in code
    x = 1
end
````

Is this a limitation of Literate.jl or am I doing it incorrectly?

@fredrikekre
Copy link
Owner

fredrikekre commented Jul 9, 2023

Use double hash for comments

begin
    ## this is comment in code
    x = 1
end

see https://fredrikekre.github.io/Literate.jl/v2/fileformat/#Syntax

@sathvikbhagavan
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants