Code Monkey home page Code Monkey logo

Comments (3)

AMS003010 avatar AMS003010 commented on July 1, 2024

+1 to this. Love the idea. That would actually make the application more flexible on the client side.

from glance.

svilenmarkov avatar svilenmarkov commented on July 1, 2024

Hey, thanks for the idea and for supporting the project!

This would be difficult as the YAML spec doesn't have a standardized way of importing files which leaves me with figuring out a way of specifying which things should be inherited and which should get overwritten.

For example, if you had this inside your base glance.yml:

pages:
  - name: Home
    columns:
      - size: full
        widgets:
          - type: reddit

And this inside your user configuration which extends the base:

pages:
  - name: Home
    columns:
      - size: full
        widgets:
          - type: reddit
            sort-by: new

What should happen? Should you end up with two Reddit widgets? Should the existing one inherit the new properties? What if you want to be able to do both in different scenarios, how would you achieve that?

from glance.

AMS003010 avatar AMS003010 commented on July 1, 2024

Suppose we are trying to extend/overwrite the properties of a widget, we could have an extra field called overwrite under each type field.


In the below case of user-specific configurations file glance.yaml , the rss widget properties' will be overwritten by the user glance.yaml file

widgets:
          - type: calendar

          - type: rss
            overwrite: true
            limit: 10
            collapse-after: 3
            cache: 3h
            feeds:
              - url: https://ciechanow.ski/atom.xml
              - url: https://www.joshwcomeau.com/rss.xml
                title: Josh Comeau
              - url: https://samwho.dev/rss.xml
              - url: https://awesomekling.github.io/feed.xml
              - url: https://ishadeed.com/feed.xml
                title: Ahmad Shadeed





In the below case of user-specific configurations file glance.yaml , the rss widget will inherit the system-wide configuration file glance.yaml, but can extend any new properties in the user glance.yaml file

widgets:
          - type: calendar

          - type: rss
            overwrite: false
            limit: 10
            collapse-after: 3
            cache: 3h
            feeds:
              - url: https://ciechanow.ski/atom.xml
              - url: https://www.joshwcomeau.com/rss.xml
                title: Josh Comeau
              - url: https://samwho.dev/rss.xml
              - url: https://awesomekling.github.io/feed.xml
              - url: https://ishadeed.com/feed.xml
                title: Ahmad Shadeed

from glance.

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.