How to remove Snippet Section indent? #1913
-
I have a following piece of code in file public class DynamoDbEnhancedClientTests {
@Test
void createsClient() {
// --8<-- [start:func]
DynamoDbClient ddb = DynamoDbClient.builder()
.region(Region.US_EAST_1)
.build();
// --8<-- [end:func]
}
} Now when I import --8<-- "DynamoDbEnhancedClientTests.java:func" It gets rendered with exactly the same indentation as in the source file: Is there an option to reduce the indentation (by the length of the indent in the first line) in each line so that the code is rendered like this: Any help appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There is not currently a way to do so. Snippets is a fairly simple approach to injecting content from one file into another. Constant requests to make it a little more advanced have led us to sections 🙂. Sections are a fairly new feature. We could potentially consider adding some sort of dedent functionality, but at this time, I'm not quite sure what the syntax would even look like to make that happen...under the hood, it would be fairly easy to do so. Now, snippets can be complex and even have nested snippets. If I were to add any kind of dedent functionality, I don't imagine I want to get too complicated and try to consider nested snippet context when dedenting, but if we are talking about a simple trigger to make a snippet get dedented, then I may be open to it. |
Beta Was this translation helpful? Give feedback.
-
I need this feature too. I just migrated to Material for MkDocs from Asciidoctor and docsify. They both support the dedent functionality. For now, I have to do some workaround. |
Beta Was this translation helpful? Give feedback.
There is not currently a way to do so. Snippets is a fairly simple approach to injecting content from one file into another. Constant requests to make it a little more advanced have led us to sections 🙂. Sections are a fairly new feature. We could potentially consider adding some sort of dedent functionality, but at this time, I'm not quite sure what the syntax would even look like to make that happen...under the hood, it would be fairly easy to do so.
Now, snippets can be complex and even have nested snippets. If I were to add any kind of dedent functionality, I don't imagine I want to get too complicated and try to consider nested snippet context when dedenting, but if we are talking ab…