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

Add {{#shiftinclude}} command #2333

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions guide/src/format/mdbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,24 @@ This is the full file.

Lines containing anchor patterns inside the included anchor are ignored.

## Including a file but changing its indentation

Sometimes it is useful to include a file or part of a file but with the indentation shifted,
using the following syntax:

```hbs
\{{#shiftinclude -2:file.rs}}
```

A positive number for the shift will prepend spaces to all lines; a negative number will remove
the corresponding number of characters from the beginning of each line.

The special `auto` value will remove common initial whitespace from all lines.

```hbs
\{{#shiftinclude auto:file.rs:indentedanchor}}
```

## Including a file but initially hiding all except specified lines

The `rustdoc_include` helper is for including code from external Rust files that contain complete
Expand Down
Loading
Loading