Comments (5)
Aha, good find. I’ll probably end up making a new class for this (ListItemRoller) and allow the ability to specify a block id like for Table Rolling as well.
from dice-roller.
Thanks for the protip, this has been added in 6.5.1.
from dice-roller.
Someone else mentioned this, so I’m not sure it’s actually possible unfortunately.
Once I’m back at my computer I’ll look and see if these are exposed
from dice-roller.
I think it should be possible - there's a separate cache for list items:
https://github.com/obsidianmd/obsidian-api/blob/5af3ef982328a2dd0a2f5242f3c74e2f45e07896/obsidian.d.ts#L378
from dice-roller.
Maybe something like:
async getOptions() {
this.cache = this.plugin.app.metadataCache.getFileCache(this.file);
console.log(this.cache);
if (!this.cache || !this.cache.sections) {
throw new Error("Could not read file cache.");
}
this.content = await this.plugin.app.vault.cachedRead(this.file);
this.options = this.cache.sections.filter(({ type }) =>
this.types
? this.types.includes(type)
: !["yaml", "thematicBreak"].includes(type)
);
// ** Add this **
if (this.types.includes("listItem")) {
this.options.push(...this.cache.listItems);
}
this.loaded = true;
this.trigger("loaded");
}
In the SectionRoller class. And you'll have to fix up the types to accept both SectionCache and ListItemCache
from dice-roller.
Related Issues (20)
- 🐞 Dice-Mod folder suggester does not display HOT 1
- 🐞 Section Roller omit first two rows and adds an empty row
- Dice View not calculating dice rolls.
- ✨ FR - choose the dice rolled to get data from a table HOT 1
- Dice Roller stops working after it encountered a parsing error in a formula
- Bold text HOT 1
- 🐞 Inline rolls don't work on canvas cards
- 🐞 Min/Max rolls result in only min or max Value HOT 1
- 🐞 Inline dice rolls using keep/drop formatting returns sum that includes all dice HOT 1
- 🐞 Dice rolls with disadvantage are ignored when a modifier is present HOT 3
- 🐞 `dice: d20` rolls 100 d20s HOT 1
- 🐞 Error creating WebGL context - not show options menu HOT 1
- 🐞 Dice tray roll button only erases the formula and doesn't roll HOT 2
- 🐞 is-min and is-max are incorrectly applied with kl and kh
- Table roller doesn't query note per roll
- 🐞 Individual dice results cannot be seen in the mobile version of the plugin.
- 🧩 Pass min /max parameters to Lookup Table rollers
- 🧩 Static dice roller button (to the left of the result)
- 🧩 Refactor lexical parser to accept front matter fields in dice contexts
- 🐞 Not able to enable on ios
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 dice-roller.