justinmeiners / srcweave

A literate programming system for any language.
https://www.jmeiners.com/literate-programming/
GNU General Public License v2.0
85 stars 4 forks source link

UNIX file path support could be better #4

Closed justinmeiners closed 2 years ago

justinmeiners commented 2 years ago

folder names shouldn't need / attached to them, etc.

atweiden commented 2 years ago

Back when I was trying to riff on Literate, I went with a leading / to differentiate file paths from code blocks, e.g.


--- /cities/WA.md
Washington
==========

---

In the above snippet, the contents of the Sectional Block `/cities/WA.md`
will be written to `$PROJECT_ROOT/cities/WA.md`.

I can see how it might be handled with a CLI argument or config file, though.

Just my 2c, but built-in syntax makes the prosé more self-contained, and it could also facilitate some degree of universal syntax highlighting to differentiate named code blocks from files.

(I haven’t perused much of your code, but it looks like you’re currently differentiating files by requiring files have an extension.)

justinmeiners commented 2 years ago

This is great feedback.

You are correct, I am using file extensions.

As you hinted at, your suggestion would solve an additional problem, which is manually specifying the code type of a block. Adding an extension to a block would help identify the type, without creating af ile.