Giter VIP home page Giter VIP logo

Comments (4)

Andlon avatar Andlon commented on June 9, 2024 2

My personal opinion is that the README might contain one or two motivating examples, but further examples should rather reside in a dedicated location. The examples folder is a pretty solid place for this, I believe. Although one can also make the case for including examples in doc tests. In fact, you could do both: I think you could do (just sketching out)

#[doc = include_str!("../examples/hex.rs")]
mod examples {}

whether or not this is a good idea, I don't know, but thought I'd throw it out there.

from vtkio.

elrnv avatar elrnv commented on June 9, 2024

I second that we should keep the readme concise, with a few select (definitely non-exhaustive) examples for how to use this lib (e.g. import/export examples, and how to build meshes). We can simply link to the examples directory (or a readme there that will summarize the what examples we have).

I am not opposed to including the examples in docs. This way folks can get most of the usage info without leaving docs.rs, and most importantly without digging through the code. However I think I would prefer a dedicated module solely for documenting these examples to which we can link from lib.rs.

I suspect many of the cell types can be grouped together into a single example.

from vtkio.

JHenneberg avatar JHenneberg commented on June 9, 2024

I am not opposed to including the examples in docs. This way folks can get most of the usage info without leaving docs.rs, and most importantly without digging through the code. However I think I would prefer a dedicated module solely for documenting these examples to which we can link from lib.rs.

Coud you elaborate this more in detail? You are not talking about rustdoc, no or yes?

My personal opinion is that the README might contain one or two motivating examples, but further examples should rather reside in a dedicated location. The examples folder is a pretty solid place for this, I believe. Although one can also make the case for including examples in doc tests. In fact, you could do both: I think you could do (just sketching out)

#[doc = include_str!("../examples/hex.rs")]
mod examples {}

whether or not this is a good idea, I don't know, but thought I'd throw it out there.

Have a look at #19 . So you mean in vertex.rs should be addional a doctest example?

from vtkio.

elrnv avatar elrnv commented on June 9, 2024

Coud you elaborate this more in detail? You are not talking about rustdoc, no or yes?

Yes exactly! I'm referring to rustdoc, which can be generated with cargo doc, which is served by docs.rs for free for all published crates on crates.io.

Have a look at #19 . So you mean in vertex.rs should be addional a doctest example?

I'd love to have @Andlon weigh in on this, but my preference is to keep the "examples" directory for complete use-case type of examples. For instance an example of how one might use vtkio to do something specific like load a vtk file, change it or render it with a third party library, or simply create a vtk file of a complex mesh for some purpose. I expect the examples for building all the different kinds of cell types to be short, so I would just put in an examples module like you did, but just use //! in examples/mod.rs and add a short description for each cell type.

Adding the example code as

#[doc = include_str!("../examples/hex.rs")]
mod examples {}

will not be formatted correctly as code and will be missing the ability to add formatted descriptions around the examples, so I would suggest to avoid that method altogether.

These are just suggestions, I would be happy to accept a PR with examples in whatever format you think is most appropriate so long as they are clear and concise.

from vtkio.

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.