Coder Social home page Coder Social logo

Look at mdbook-keeper about comprehensive-rust HOT 7 OPEN

google avatar google commented on July 23, 2024
Look at mdbook-keeper

from comprehensive-rust.

Comments (7)

mgeisler avatar mgeisler commented on July 23, 2024

This is of course a bit of an open ended issue 🙂 What I hope for is that someone will look at what mdbook keeper can do for us:

  • can it run our current tests?
  • can we use it to run tests with more dependencies?

The goal would be remove the compile_fail from our code blocks.

If you can get this working locally, then we can work on a updating the GitHub action which runs the tests for us on every PR.

from comprehensive-rust.

mauvealerts avatar mauvealerts commented on July 23, 2024

I started looking into this. Some issues/notes so far:

  • Tests in sub-chapters aren't run (tfpk/mdbook-keeper#2)
  • It doesn't seem to understand {{#include some/file.rs}}
  • Output doesn't appear incrementally
  • The tests block progress on mdbook build and mdbook serve

On my machine, it takes ~3min to run the tests which is pretty rough when I just want to mdbook serve. I think there's hope, potentially using:

I intend to work on this some more. In case my work stalls out, or anyone's curious, my keeper branch has the WIP.

from comprehensive-rust.

mgeisler avatar mgeisler commented on July 23, 2024

Thanks @mauvealerts! That's already a very valuable analysis! For example, I had not realized that you run the tests all the time... so we would definitely only enable it on demand like we do for the mdbook-xgettext renderer.

from comprehensive-rust.

mauvealerts avatar mauvealerts commented on July 23, 2024

I have something that I'm fairly happy with, when combined with all of these changes to mdbook-keeper

I have things running comparable to mdbook test. IMO the steps necessary to make a mergable PR are:

  • Decide where the skeleton project should go (currently mdbook-keeper-deps)
  • Don't run tests by default for mdbook serve
  • mdbook-keeper has released a version with the changes
  • Prove out the usefulness by testing some snippets

from comprehensive-rust.

mgeisler avatar mgeisler commented on July 23, 2024

Thanks for pushing this!

  • Decide where the skeleton project should go (currently mdbook-keeper-deps)

I think this should be the root of the repository, or perhaps the src/ folder. We already have a Cargo workspace setup so that cargo check does something useful for the code in our exercises. I hope we can build on this for the book itself: perhaps we can move up the src/exercises/Cargo.toml file to src/ and then use its dependencies across the examples?

from comprehensive-rust.

mauvealerts avatar mauvealerts commented on July 23, 2024

I didn't think it was possible to have both a [workspace] and (e.g.) a lib in the same Cargo.toml, but apparently it is. I've updated my branch to just use Cargo.toml in the root directory, at least for now. I've also locked mdbook-keeper to the markdown output format, so it doesn't slow down mdbook serve

I started updating some examples, but ran into link errors (tfpk/mdbook-keeper#9). In particular, not being able to use tokio on Windows makes me hesitant to migrate the async examples (which was most of what I planned to do).

from comprehensive-rust.

mgeisler avatar mgeisler commented on July 23, 2024

I've also locked mdbook-keeper to the markdown output format, so it doesn't slow down mdbook serve

Ah, that's a clever work-around 😄 However, it almost suggests that mdbook-keeper should be a renderer instead of a preprocessor. @tfpk, have you considered that approach?

I started updating some examples, but ran into link errors (tfpk/mdbook-keeper#9). In particular, not being able to use tokio on Windows makes me hesitant to migrate the async examples (which was most of what I planned to do).

Oh, I see... I agree that it would be important to have test coverage for all the small code snippets involving Tokio and that was also my main reason to look at mdbook-keeper 🙂

from comprehensive-rust.

Related Issues (20)

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.