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

escape --- in code blocks? #23

Open
nikonakoneko opened this issue Aug 12, 2022 · 4 comments
Open

escape --- in code blocks? #23

nikonakoneko opened this issue Aug 12, 2022 · 4 comments

Comments

@nikonakoneko
Copy link

I was trying to produce a lit file from a lit file. But I don't find how to escape the code block inside the code block like the following example

# Recursive literate

Consider the following:

--- /example.lit
the following should generate `test.lua` when processing `example.lit`:
--- /test.lua
--- this is a valid lua comment…
print("Hello, Lua!")
---
---
@justinmeiners
Copy link
Owner

Thanks for the feedback. I currently don't have an escape, but if you add a space so that the --- isn't exactly at he start of the line, I believe that will work. Does that solve your use case, or should we come up with something better?

@atweiden
Copy link

I imagine escaping comments will be something people want. Perhaps the srcweave syntax would be conducive to using Lua style comment escapes:

# Recursive literate

Consider the following:

---[==[ /example.lit
the following should generate `test.lua` when processing `example.lit`:
---[=[ /test.lua
--- this is a valid lua comment…
print("Hello, Lua!")
---]=]
---]==]

@nikonakoneko
Copy link
Author

@justinmeiners I guess that adding a space would also "escape" it in the generated lit file. What I'd like here is a lit file that produce another lit file with functional code block that can further generate another source file. I'm not dying for that feature, but I wanted to illustrate a basic exemple of writing literate file using literate file. And I ran in that issue that I can't have codeblocks containing codeblocks of the source to generate.

@justinmeiners
Copy link
Owner

@soratobukuroneko understood. I will give this some thought.

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

3 participants