peanball / logseq-dynamic-lookup Goto Github PK
View Code? Open in Web Editor NEWA Logseq plugin to dynamically look up another page's property values and place them where you need. Great with macros.
License: MIT License
A Logseq plugin to dynamically look up another page's property values and place them where you need. Great with macros.
License: MIT License
My case #1
: I want to check if a property exists, without using fallbackTemplate
.
With a mustache-like template language it can looks like:
{{renderer :lookup, page, :alias:description, "{{#alias}} ({{alias}}){{/alias}}: {{description}}"}}
And specifing list of properties now looks unnecessary:
{{renderer :lookup, page, "{{#alias}} ({{alias}}){{/alias}}: {{description}}"}}
My case #2
: Use page name
With a template language we can save a page meta-info as a default context:
{{renderer :lookup, page, "[[{{ page.name }}]] {{#page.props.alias}} ({{page.props.alias}}){{/page.props.alias}}: {{page.props.description}}"}}
Proposal:
{{renderer :lookup, PAGE, prop1:prop2:prop3, <a href="$prop1">$prop2</a>, $prop3}}
instead of just putting the property value as $value
.
I think it could be useful to look for properties and content of blocks too.
In particular I'm referring to:
An use case for 1. could be:
You are in a page/block about an Author and you want to use a "New Book" template to create a Book that has page title/block content as the value of author:: property:
- Name Surname
- Title of the book created with a template
author:: Name Surname
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.