Code Monkey home page Code Monkey logo

embed-doc-image's People

Contributors

andlon avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

therustmonk

embed-doc-image's Issues

Remove `syn` dependency by relying only on `doc = embed_image!` functionality.

Currently, syn is only necessary for the embed_doc_image attribute. Although the #[embed_doc_image] also works on older Rust versions, it seems like a reasonable trade-off to only be able to generate docs for Rust > 1.54. Then we can remove #[embed_doc_image] as well as syn. The remaining dependencies are hopefully lightweight enough that most users won't need to disable them during non-doc compilation.

We should also simplify documentation to focus on the case when Rust >= 1.54 - in which case using embed-doc-image is easy, and put less emphasis on all the workarounds for making code compile on Rust < 1.54 (although still discuss them).

Additionally, as suggested by @GuillaumeGomez here, we can use cfg(doc) to ensure that embed_image! evaluates to a no-op when not compiling docs.

Finally, we should also provide an enabled feature that, when not enabled, makes the whole crate a no-op with no dependencies. This way it's possible for users to only embed doc images when a feature, and otherwise pay no price whatsoever when the feature is not enabled.

Question about performance impact on builds

Does the macro get expanded when doing a standard cargo build? That would be a lot of processing for something that will be thrown away when producing a binary. Or, better, does it just run when using cargo doc?

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.