Skip to content

Can't hide portion of a file with {{#playground}} #1294

Open
@FabienTregan

Description

@FabienTregan

I have the following content in a .md file that produces the expected result:

```rust
{{#include main_with_anchor.rs:justthis}}
```

If I try to use {{#playground}} instead:

{{#playground main_with_anchor.rs:justthis}}

mdbook complains:

D:\code\rust\trying_to_learn_rust>mdbook serve
2020-08-06 12:22:36 [INFO] (mdbook::book): Book building has started
2020-08-06 12:22:36 [ERROR] (mdbook::preprocess::links): Error updating "{{#playground main_with_anchor.rs:justthis}}", Could not read file for link {{#playground main_with_anchor.rs:justthis}} (D:\code\rust\trying_to_learn_rust\src\main_with_anchor.rs:justthis)
2020-08-06 12:22:36 [WARN] (mdbook::preprocess::links): Caused By: Le fichier spécifié est introuvable. (os error 2)

(tested under windows, same error with a cmd prompt or a git bash)
("Le fichier spécifié est introuvable. " translates to "unable to find file")

Same result with install from crates.io and github, installed as this a few minutes ago:

cargo install mdbook --force
cargo install --git https://github.com/rust-lang/mdBook.git mdbook

Using line numbers instead of anchors gives the same error.

{{#playground main_with_anchor.rs}} works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions