Code Monkey home page Code Monkey logo

mdbook-tera's People

Contributors

avitex avatar dependabot-preview[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mdbook-tera's Issues

mdBook version 0.4.10 breaks

[ERROR] (mdbook::utils): Error: Unable to parse the preprocessed book from "tera" processor
[ERROR] (mdbook::utils):    Caused By: missing field `__non_exhaustive` at line 1 column 1594502

I believe a field __non_exhaustive has been added to mdBook...

Working from src/dir?

Hello James (?) @avitex ,

thank you for the great tool "mdbook-tera".

Unfortunately it worked only if I call it from ./src/file.md.
When I call it from ./src/DIR/file.md, the variables are not replaced.

Am I doing something wrong or is this a limitation of the tool?

Many greetings
rufus42

PS: Please excuse me for abusing this "channel" for my question, I didn't find any forum or similar.

Binary releases

Would be nice to have built binaries so one does not have to spend cycles compiling

Build failure following tera 1.14.0 release

Hello, and thank you for making mdbook-tera, it is really powerful to be able to combine mdbook with tera.

While cargo install mdbook-tera, I encountered the following errors reported at the end of this message. It appears to be caused by the new update of Tera (released Nov 1 2021) that changes the definition of the Context struct to add a type parameter, which AFAICT is a breaking change.

The issue has also been raised upstream.

That being said, I see the following options:

  1. Wait for the issue to be resolved upstream (by yanking 1.14 and releasing a 2.0.0)
  2. Change the Cargo.toml to specify an exact version of tera, rather than a compatible one. ("=1.12.0" should work)
  3. Modify the code to be compatible with release 1.14 (future 2.0).

Optionally, once the issue is resolved, we could add Cargo.lock into git, so that the build remains fully reproductible in the future, as is recommended for binary applications in the cargo book

Thank you again for mdbook-tera!

   Compiling mdbook-tera v0.4.0
error[E0107]: missing generics for struct `tera::Context`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-tera-0.4.0/src/lib.rs:89:66
   |
89 | fn render_book_items(book: &mut Book, tera: &mut Tera, context: &Context) -> Result<(), Error> {
   |                                                                  ^^^^^^^ expected 1 generic argument
   |
note: struct defined here, with 1 generic parameter: `S`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/tera-1.14.0/src/context.rs:57:12
   |
57 | pub struct Context<S: ContextSafety> {
   |            ^^^^^^^ -
help: add missing generic argument
   |
89 | fn render_book_items(book: &mut Book, tera: &mut Tera, context: &Context<S>) -> Result<(), Error> {
   |                                                                  ^^^^^^^^^^

error[E0107]: missing generics for struct `tera::Context`
   --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-tera-0.4.0/src/lib.rs:122:15
    |
122 |     context: &Context,
    |               ^^^^^^^ expected 1 generic argument
    |
note: struct defined here, with 1 generic parameter: `S`
   --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/tera-1.14.0/src/context.rs:57:12
    |
57  | pub struct Context<S: ContextSafety> {
    |            ^^^^^^^ -
help: add missing generic argument
    |
122 |     context: &Context<S>,
    |               ^^^^^^^^^^

error[E0107]: missing generics for struct `tera::Context`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-tera-0.4.0/src/context.rs:20:14
   |
20 |     context: Context,
   |              ^^^^^^^ expected 1 generic argument
   |
note: struct defined here, with 1 generic parameter: `S`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/tera-1.14.0/src/context.rs:57:12
   |
57 | pub struct Context<S: ContextSafety> {
   |            ^^^^^^^ -
help: add missing generic argument
   |
20 |     context: Context<S>,
   |              ^^^^^^^^^^

error[E0107]: missing generics for struct `tera::Context`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-tera-0.4.0/src/context.rs:14:26
   |
14 |     fn context(&self) -> Context;
   |                          ^^^^^^^ expected 1 generic argument
   |
note: struct defined here, with 1 generic parameter: `S`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/tera-1.14.0/src/context.rs:57:12
   |
57 | pub struct Context<S: ContextSafety> {
   |            ^^^^^^^ -
help: add missing generic argument
   |
14 |     fn context(&self) -> Context<S>;
   |                          ^^^^^^^^^^

error[E0107]: missing generics for struct `tera::Context`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-tera-0.4.0/src/context.rs:24:26
   |
24 |     fn context(&self) -> Context {
   |                          ^^^^^^^ expected 1 generic argument
   |
note: struct defined here, with 1 generic parameter: `S`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/tera-1.14.0/src/context.rs:57:12
   |
57 | pub struct Context<S: ContextSafety> {
   |            ^^^^^^^ -
help: add missing generic argument
   |
24 |     fn context(&self) -> Context<S> {
   |                          ^^^^^^^^^^

error[E0107]: missing generics for struct `tera::Context`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-tera-0.4.0/src/context.rs:31:25
   |
31 |     pub fn new(context: Context) -> Self {
   |                         ^^^^^^^ expected 1 generic argument
   |
note: struct defined here, with 1 generic parameter: `S`
  --> /home/tetrane/.cargo/registry/src/github.com-1ecc6299db9ec823/tera-1.14.0/src/context.rs:57:12
   |
57 | pub struct Context<S: ContextSafety> {
   |            ^^^^^^^ -
help: add missing generic argument
   |
31 |     pub fn new(context: Context<S>) -> Self {
   |                         ^^^^^^^^^^

For more information about this error, try `rustc --explain E0107`.
error: could not compile `mdbook-tera` due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `mdbook-tera v0.4.0`, intermediate artifacts can be found at `/tmp/cargo-installvyhKA6`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.