driusan/lmt

indented code blocks don't tangle

dabrahams opened this issue · 2 comments

Tangling doesn't happen on a code block that is indented, e.g. into a list:

(source)

1. item 1 is like this
    ```txt stuff.txt
    first line
    ```

2. item 2
    ```txt stuff.txt +=
    first line
    ```

(rendered)

  1. item 1 is like this

    first line
  2. item 2

    first line

(lmt output)
No files generated.

What would the expected output be in stuff.txt?

first line
first line

or

    first line
    first line

?

The former. The code block as rendered has no indentation before the f's.

One could argue for a desire to be able to add arbitrary indentation so you could describe, say, the body of a method without the leading indentation, but this isn't the way to get control of that because it depends on a particular markdown structure.

I am pretty bullish on the current KISS approach taken by lmt, BTW. I wrote a much more complicated literate programming system for ReStructuredText many years ago, but I don't think it pulled it's own weight. So I'm not asking for that feature!