Skip to content

Support for inline dataview fields#196

Merged
lazyguru merged 2 commits intopyrochlore:masterfrom
Laharah:inlineDv
Nov 17, 2023
Merged

Support for inline dataview fields#196
lazyguru merged 2 commits intopyrochlore:masterfrom
Laharah:inlineDv

Conversation

@Laharah
Copy link
Copy Markdown
Contributor

@Laharah Laharah commented Jan 31, 2023

Add a collectDataFromInlineDvField.

I was originally going to just add the bracket/paren matching to the original regex, but it got nasty quickly. Anyone who's got good regex-fu is welcome to try it themselves. Either way this code now matches both [inline::style] and (hiddenKey::style) dataview metas.

@tcpsyn
Copy link
Copy Markdown

tcpsyn commented Apr 6, 2023

Thanks for that.

@solpyro
Copy link
Copy Markdown

solpyro commented Jun 11, 2023

Looking at the regex here #108 it seems like we could get away with just modifying the original regex in collectDataFromDvField, rather than having to run two near identical searches across the search space.

Had you tried this approach?

-------vvv   Allows for a pipe to start the match, in case of a closely wrapped table

(^| |\t|\|)(\[|\()?\*{0,2}dvTarget\*{0,2}(::[ |\t]*(?<value>[\d\.\/\-\w,@; \t:]*)(\]|\))?)

-----------^^^^^^^^------   Allows for optional [ or ( and closing ) or ]   -----^^^^^^^^

regex101 shows that this search matches everything from my test set at least

@lazyguru
Copy link
Copy Markdown
Collaborator

lazyguru commented Nov 8, 2023

Hi, I now have write access and have been going through all open PRs to get them merged. This is the last of the "overdue" PRs for processing. I see some comments with feedback on the changes here. Are there any updates to be made here?

@Laharah
Copy link
Copy Markdown
Contributor Author

Laharah commented Nov 9, 2023

It works as is, but as @solpyro pointed out, it's not very efficient. I'm going to do some testing on his solution in the next couple of days, so I'd consider this PR open until I can take a look.

@Laharah
Copy link
Copy Markdown
Contributor Author

Laharah commented Nov 9, 2023

Okay, rebased on master, updated the regex, and implemented some tests in the example vault. This PR is ready to go!

@lazyguru
Copy link
Copy Markdown
Collaborator

I haven't forgotten about this. I just need to run through a bit of testing before merging and publishing. Give me a few more days

@lazyguru lazyguru merged commit e1ffed2 into pyrochlore:master Nov 17, 2023
@lazyguru
Copy link
Copy Markdown
Collaborator

Thank you for your contribution!

@Laharah Laharah deleted the inlineDv branch November 19, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants