Giter Club home page Giter Club logo

Comments (4)

andymeneely avatar andymeneely commented on August 27, 2024

After playing around with this, I'm not sure I like it. I would rather run the layout.yml through ERB so we can do stuff like:

title:
  x: <%=@width-75%>

from squib.

scraimer avatar scraimer commented on August 27, 2024

Ooh, ERB for layouts would be awesome! It would move much of my positioning code out of the deck.rb and into the layout, where it belongs!

For example, If I want to draw a circle around some text. I could easily use ruby expressions to offset the circle so that its origin is positioned correctly to make the circle go around the text.

SomeText:
   x: 50
   y: 50
   width: 150
   height: 150

SomeTextCircle:
    x: <%=@x - 20%>
    y: <%=@y - 20%>

from squib.

andymeneely avatar andymeneely commented on August 27, 2024

Actually, you don't need ERB for that situation - use extends:

SomeText:
  x: 50
  y: 50
SomeTextCircle:
  extends: SomeText
  x: -= 20 # in yaml this is a string, but it gets processed as a part of processing "extends"
  y: -= 20

http://andymeneely.github.io/squib/doc/file.README.html#Special_key__extends

But... there are other situations where ERB would be helpful. The issue I created for that is #36.

from squib.

scraimer avatar scraimer commented on August 27, 2024

Good point!

from squib.

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.