Code Monkey home page Code Monkey logo

Comments (5)

Canop avatar Canop commented on July 18, 2024 1

@sevenuz Yes, your question makes sense.

On the surface, the reason you can't just derive Serialize is that you need the inner properties to implement Serialize too.

But it doesn't mean I can't implement Serialize, it's just that I didn't initially see the need and then I forgot this issue. I'm putting it in my TODO list now.

from termimad.

Canop avatar Canop commented on July 18, 2024

This is a good question.

While I considered having a library or feature for the (de)serialization of a whole madskin, which is a quite complex problem in reality as you typically want to deal with several of them and you also want to deal with your hadcoded ones (hence the StyleMap! macro in broot), I didn't think about making it easier to deal with your own madskin-like types by first offering (de)serialization at the compund_style level.

It should be noted that termimad's CompoundStyle is nothing more than a Crossterm ContentStyle. Rather than putting this (de)serialization utility in termimad, it could be offered in an independant library which would be available to crossterm users without forcing them to use termimad. I don't know how many users would be interested but the initial effort seems quite low (pinging Timon).

from termimad.

Canop avatar Canop commented on July 18, 2024

Reading this again, I think I should just add the "serde" feature and derive (de)serialize when the feature is active.
Not so easy, crossterm's StyledContent<char> doesn't derive Serialize and Deserialize so there's more work to do.

from termimad.

sevenuz avatar sevenuz commented on July 18, 2024

Hallo, I am also interested in a serialized form of the skin. Why is it possible to deserialize it, as it is done in your example skin-file, but not possible to derive serialize?
Sorry I am quite new to Rust and not sure, if this question makes sense :D

from termimad.

sevenuz avatar sevenuz commented on July 18, 2024

Okey, that sounds promising. As a workaround I will use the a default skin to serialize, then the user can edit manually and I can deserialize as it is done in your example, so this has no priority :D

from termimad.

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.