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

mdstrings support #880

Closed
luraess opened this issue Sep 10, 2021 · 0 comments · Fixed by #881
Closed

mdstrings support #880

luraess opened this issue Sep 10, 2021 · 0 comments · Fixed by #881
Labels

Comments

@luraess
Copy link
Contributor

luraess commented Sep 10, 2021

Trying to add support for mdstrings (introduced in Literate 2.9), I get following warning

julia> serve(clear=true)
  Activating environment at `~/Documents/git/github_vaw/course-101-0250-00/website/Project.toml`
→ Initial full pass...
→ evaluating code [ex2] in (lecture1.md)                                                                              
┌ Franklin Warning: in <lecture1.md>
│ There was an error of type 'ErrorException' when running a code block.
│ Checking the output files '/Users/ludovic/Documents/git/github_vaw/course-101-0250-00/website/__site/assets/lecture1/code/output/ex2.(out|res)'
│ might be helpful to understand and solve the issue.
│ 
│ Relevant pointers:
│ - evaluation of Julia code blocks: https://franklinjl.org/code/
│ 
│ Details:
│ syntax: incomplete: invalid string syntax
│ Stacktrace:
└
→ evaluating code [ex3] in (lecture1.md)                                                                              
┌ Franklin Warning: in <lecture1.md>
│ There was an error of type 'ErrorException' when running a code block.
│ Checking the output files '/Users/ludovic/Documents/git/github_vaw/course-101-0250-00/website/__site/assets/lecture1/code/output/ex3.(out|res)'
│ might be helpful to understand and solve the issue.
│ 
│ Relevant pointers:
│ - evaluation of Julia code blocks: https://franklinjl.org/code/
│ 
│ Details:
│ syntax: incomplete: invalid string syntax
│ Stacktrace:
└
→ Starting the server...
✓ LiveServer listening on http://localhost:8000/ ...
  (use CTRL+C to shut down)

upon non-successful evaluation of a script provided as input to Franklin's \literate{/_literate/test_1.jl} command.

This is coherent with the "wrong" generated script and markdown files before evaluation (see test_1.zip for the input script and the output .jl, .md files).

I tried modifying Literate.markdown() call in src/eval/literate.jl adding mdstrings=true.

It also does not work trying following:

  1. add a global page variable literate_md_string in utils/vars with default false
  2. in the function literate_to_franklin in eval/literate, get it with mdstr = locvar(:literate_md_string)::Bool`
  3. feed it in the Literate.markdown call passing mdstrings=mdstr
  4. add @def literate_md_string = true in the page script where \literate{/_literate/test_1.jl} is used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants