Open chezwicker opened 3 years ago
I just realized there is another issue: code_block=false
gets evaluated after file extensions, so it seems it's not possible to use real file extensions if one wants to just import plain text. Could the condition be moved up? If not, maybe the second option would be better, allowing to always import plain text regardless of the file extension!
Introduction
I have a somewhat weird setup where I have to mix TEX into my markdown files in order to finally generate specifically formatted PDF.
Problem
When I use
@import
to include code snippets in a code block, the indentation is not preserved, which has two disadvantages:@import
statement so indent is not only applied to the first line of the imported fileEven weirder is that the indentation seems to be applied in the first
@import
, but not in the subsequent ones.Example
First Attempt
This results in the following output:
Second Attempt
This results in the following output:
Request
What I would really like is to be able to write code like in "First Attempt" and get the following result:
In other word, indent in the original should be applied to every line of the imported file. In my example, four spaces would be prefixed to every line of the imported file.
In order to not break existing setups, I would suggest one of two options:
indent=true
, withfalse
the default, resulting in today's behaviorplain
, which would result in the behavior requested.I believe the first option would have the least impact and could just be added to https://github.com/shd101wyy/mume/blob/master/src/transformer.ts#L939 using the (I assume) existing indenter.
Thanks
Thank you for your work and for considering this!