Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: inline expression display #5

Open
jwhitley opened this issue Nov 8, 2022 · 4 comments
Open

Feature request: inline expression display #5

jwhitley opened this issue Nov 8, 2022 · 4 comments
Labels
enhancement New feature or request roadmap Planned feature on the roadmap

Comments

@jwhitley
Copy link
Contributor

jwhitley commented Nov 8, 2022

Concept

Allow inline blocks with simple expressions. These might be variable references ala `mathexpr: length` (referring the variable length from a ```math block in the same note) or other expressions like `mathexpr: 3*4`. These would be rendered as an evaluated result in the place of the inline math expression.

Caveats

I'd done very quick triage of this for the math plugin I was contemplating, and noted that the two block styles are processed separately by the Obsidian API. I hadn't gotten to the point of sorting out feasibility and/or what would be required to ensure that the inline blocks as above were processed after the code blocks. It didn't appear feasible to ensure that the two styles could be processed in sequential order down a note, so a simplifying assumption I made was that the inline style is only ever used for displaying results (i.e. can be processed strictly after the code blocks) and never defines variables, functions, etc.

@gtg922r gtg922r added the enhancement New feature or request label Nov 9, 2022
@gtg922r
Copy link
Owner

gtg922r commented Nov 9, 2022

This is definitely something I want to look in to. Dataview has it figured out so I'll have to see how they did it.

Almost certainly this will be addressed after the initial release though as I want to focus on getting code block rendering out the door.

@gtg922r gtg922r added the roadmap Planned feature on the roadmap label Nov 9, 2022
@jwhitley
Copy link
Contributor Author

jwhitley commented Nov 9, 2022

Sounds good. And I completely agree with keeping releases tidy. Nothing urgent here relative to just getting it out the door.

I’m definitely happy to pitch in with some PRs, esp. since I was ready to roll my own plugin anyhow. I’ll start digging into the codebase here, and Dataview as well.

@technodrome
Copy link

Any progress on this one? Many would find this very handy.

@gtg922r
Copy link
Owner

gtg922r commented Oct 24, 2023

Yeah, to be honest this is my personal top feature request. However, as far as I can tell it requires implementing a new renderer in a whole different section of a API that is not as easily interfaced with as the code blocks. So might be a bit before I have the time to dig in to it.

In the interim, keep in mind that dataview can handle easy math cases with their inline rendering. If you turn on inline rendering =1+1 will render to 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request roadmap Planned feature on the roadmap
Projects
None yet
Development

No branches or pull requests

3 participants