Comments (4)
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.
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.
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.
Good point!
from squib.
Related Issues (20)
- undefined method "render_cairo"
- Shadow in text or images HOT 1
- CLI: in `squib new` choose advanced via menu or CLI option
- CLI: `squib add` to add a new deck
- Change config.yml to squib.yml
- Squib can't install on an MacBook M1 HOT 8
- Unable to install gem because of dependency HOT 6
- Release v0.19.0
- Document Notion integration
- Unable to load variants with fonts
- Default save_pdf location is incorrect HOT 3
- Squib post-installation with Gem on M1 Macbook error: dyld[xxxx] missing symbol called 'new' HOT 1
- squib error on Ubuntu 22.04 "undefined symbol: g_bookmark_file_get_type" HOT 3
- Add drop shadow support when using hand HOT 1
- SVGs are all lower than they should be HOT 1
- Can't install Squib on macOS. "ruby/config.h" not found
- The Squib Way documentation skips over the `squib new` command
- the Layouts Are Squib’s Best Feature documention has some broken links
- It'd be nice if the built-in layouts were specified a little differently in the code
- Extent with a decimal in the font size brings an error, not with an integer font size.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from squib.