arnau / obsidian-metatable Goto Github PK
View Code? Open in Web Editor NEWAn Obsidian plugin to display the frontmatter section as a fully expanded table.
License: MIT License
An Obsidian plugin to display the frontmatter section as a fully expanded table.
License: MIT License
Hi! I woul like to report that the plugin isn't working.
This is the console error:
So, I play around whit it and found that the plugin doesn't show numeric values whithin the frontmatter i.e:
aliases: [ ]
tags: literature
author: Chomsky
year: 2020
URL: https://www.something.com
page: 123
---
The plugin works whit the frontmatter like so though:
aliases: [ ]
tags: literature
author: Chomsky
year: "2020"
URL: https://www.something.com
page: "123"
---
The numeric values are rendered correctly when you put them around ""
or ''
.
In this sense, I like to ask if you can make readable those values whitout the quatation marks?
And thanks in advance.
Apologies if this is answered in the documentation - I have Cognitive Impairment so, despite reading through all the documentation, I may have missed it.
If, for example, I have the Aliases key in my YAML, currently all values show as a single string with spaces between each value:
aliases: all values run together
When I would like them to look like
aliases: all, values, dont, run, together
I've tried looking at the CSS myself but since it's outputs as <span class="leaf string" part="leaf string">all values run together</span>
, I can't target each individual value.
Thanks!
Hi,
while obsidan will give you a "Invalid YAML" warning, when you enable Metatable the obisdian warning will not show and Metatable will not create the table without any error message.
You can reproduce this by putting
title: [this will break yaml] didn't I tell you
into the frontmatter.
Hi, Thanks for the great plugin. Seems like it will improve the quality of using Obsidian a great deal.
I'm getting the following error message on one of my notes:
Nested mappings are not allowed in compact mappings at line 4, column 9:
author: qBittorrent Development Team: https://github.com/qbittorrent
^
... from the following frontmatter:
created: 2023-06-30 - 19:50
tags:
url: https://www.qbittorrent.org/
author: qBittorrent Development Team: https://github.com/qbittorrent
The ^
seems to be pointing the letter number 9 q
in the author
attribute but I don't think that's the issue.
The problem seem to go away when I remove the colon in Team:
, but I see the the colon is used no problem in other attributes.
Is this a bug or am I missing something?
Thanks
Two issues regarding Markdown links (not wiki) when the link format is set to Relative path to file. (Not sure if they apply to other link formats as well.)
Obsidian automatically inserts %20
for spaces in file names, which is needed for Markdown links not wrapped with ""
. In the YAML, however, the link is necessarily wrapped already and because %20
is inserted the link will not work when clicked on, you get: Folder does not exist (i.e., the file doesn’t).
Would it be possible to prevent obsidian from doing this?
This one occurs when there are several files with the same name on different levels in the folder hierarchy. For example, I have ReadMe.md files in every folder:
/ReadMe
/a/ReadMe
/a/b/ReadMe
/a/b/c/File #Linking to /a/b/ReadMe
When clicking on the link in the YAML of File, /ReadMe at the root is opened. If I rename it to something that doesn’t match the link, then /a/ReadMe is opened instead. Only after I also rename this file, the expected file is opened.
So it seems like the plugin is ignoring the ../
in the link and just searches the folder path from the root down and returns the first match.
There is a https://github.com/onlyafly/number-headings-obsidian plugin, which makes a frontmatter key by the name of number headings
.
I just can't find a way to put it in your plugin's "Filter keys" list to be ignored. I tried inserting quotes, changing the order, add comma at the end - nothing worked.
Is this a bug or am I doing something wrong?
This is a potential enhancement area for the plugin, which I'll demonstrate through my own attempt/struggle. I wanted, rather than a table, to see my note's metadata in a purely textual presentation, like the below, which I'm happy with:
It keeps the expand/collapse behavior of the table:
And the individual key/value pairs:
I used Metatable to get a table, then a mile of CSS to get the above presentation to work. I'm absolutely no CSS expert nor fan, but for anyone else's to repurpose, here's how I accomplished the above:
I have the following frontmatter:
---
Alias: [About, About Me]
Tags: [meta, design]
Progress: [initial]
Confidence: [highly likely]
Importance: [2]
Previous: [%Home%]
Next: []
---
And this CSS, which again probably has some issues:
/*
* PLUGIN:
* Metatable
*/
/* * EXPAND/COLLAPSE * */
/* Get the detail/summary wrapper to work right: */
/* Closed: */
.obsidian-metatable details:not([open]) summary {
font-size: 0;
}
.obsidian-metatable details:not([open]) summary::marker {
font-size: 0.9rem;
color: var(--text-muted);
}
.obsidian-metatable details:not([open]) summary:hover::marker {
color: var(--text-accent-hover);
}
.obsidian-metatable details:not([open]) summary::after {
content: "Metadata";
color: var(--text-muted);
font-size: 0.9rem;
}
/* Opened: */
.obsidian-metatable details[open] > summary {
position: relative;
left: calc(-1rem - 2px);
padding-right: 1rem;
font-size: 0;
}
.obsidian-metatable details[open] > summary::marker {
font-size: 14px;
color: transparent;
}
.obsidian-metatable details[open] summary:hover::marker {
color: var(--collapse-icon-color);
}
.obsidian-metatable details[open] > table {
position: relative !important;
top: -1.5rem;
}
/* Expand/collapse works only on certain elements within the metatable: */
.obsidian-metatable details[open] th.toggle[part~="collapsed"] + td {
font-size: 0;
color: transparent;
}
.obsidian-metatable details[open] th.toggle[part~="collapsed"] + td * {
display: none;
}
.obsidian-metatable details[open] th.toggle[part~="collapsed"] + td::after {
content: "...";
display: contents;
font-size: 0.9rem;
color: var(--text-muted);
}
/* * THE METATABLE: TEXT FORMATTING * */
/* Text is slightly smaller than the document style. */
.obsidian-metatable details > table :not(.tag):not(.link) {
font-size: 0.9rem;
color: var(--text-normal);
line-height: calc(1ex / 0.27);
margin: 0;
padding: 0;
}
/* No fancy links. They're just broken. Idk. */
.markdown-preview-view .obsidian-metatable details a.internal-link {
color: var(--text-accent);
margin: 0;
padding: 0;
}
.obsidian-metatable details a::before {
display: none !important;
}
.obsidian-metatable details a::after {
content: none;
margin: 0;
padding: 0;
}
/* Tags get a slight resize. */
.obsidian-metatable details table .tag {
font-size: 0.88rem;
padding: 0.4ex 1ch 0.7ex 1ch;
}
/* Headers are lowercase and have an interpunct. */
.obsidian-metatable details table th {
text-transform: lowercase;
}
.obsidian-metatable details table th::after {
content: ":";
font-weight: 600;
padding-right: 0.8ch;
}
/* Values are italicized; interpunct handled later. */
.obsidian-metatable details table td {
font-style: italic;
}
/* Numbers are highlighted, tabular. */
.obsidian-metatable details table .value .number {
font-variant-numeric: tabular-nums;
font-weight: 600;
/* color: var(--color-green); */
}
/* * THE METATABLE: TABLES AND LISTS * */
/* In general, we are trying to use flexbox with a contents fit: */
.obsidian-metatable details > table {
display: flex;
align-items: flex-start;
flex-direction: row;
flex-wrap: wrap;
min-width: none;
max-width: 100%;
}
.obsidian-metatable details > table * {
min-width: unset !important;
max-width: unset !important;
display: contents;
}
/* Table main rows -> one endlessly wrapping row */
.obsidian-metatable details > table > tr {
display: contents;
align-items: stretch;
}
.obsidian-metatable details > table > tr > * {
display: contents;
}
.obsidian-metatable details > table > tr:not(:first-of-type)::before {
content: " · ";
font-weight: bold;
white-space: pre;
}
/* Lists w/o table entries, w/o key-value pairs: */
.obsidian-metatable details li {
display: inline;
align-items: flex-start;
flex-wrap: wrap;
}
.obsidian-metatable details li:not(:first-of-type)::before {
content: ",";
padding-left: 1px;
padding-right: 1ch;
display: inline-block;
}
/* Lists of tables -> endlessly wrapping rows, inside parenthesis: */
.obsidian-metatable details li:first-of-type:not(:last-of-type) table::before {
content: "(";
}
.obsidian-metatable details li:last-of-type:not(:first-of-type) table::after {
content: ")";
}
/* Empty list items really ruin the overall look: */
.obsidian-metatable details li table:empty::after {
content: "—";
color: var(--table-header-color);
}
/* * EXCEPTIONS * */
/* (1) Tags has no header. Todo: they should be on their own line, also. */
/* (2) Progress has no header. */
.obsidian-metatable
details
> table
> tr
> th:is([title="Tags"], [title="Progress"]) {
display: none;
}
/* * NOTE FORMAT FIX * */
/* The first heading is pushed way down, now. So: */
.markdown-preview-section > div:nth-child(2):not([class]) + div + div.el-h1 h1,
.markdown-preview-section > div:nth-child(2).el-pre + div.el-h1 h1 {
margin-top: 0px !important;
}
.obsidian-metatable details:not([open]) {
margin-bottom: calc(1rem / (1 - 0.24));
}
This is functioning for me in Obsidian v1.0.3 and Metatable 0.14.3. Hope this might help someone else, who may be able to contribute as well.
Hi
when I have a picture in my markdown, the metatable is not displayed in the pdf ; whereas the metatable appears correctly in "reader view" in Obsidian. If I remove the picture from the markdown file, the pdf is correct with the metatable displayed at the top. I tried to force metatable with "metatable: false" in frontmatter but it does not change.
Step to reproduce : add a picture
![](attachments/test.png)
metatable: 0.11.0
obsdian: 0.13.33
in nord theme, metatable is a little hard to identify, I always think of it as part of the text
In addition, I hope to be able to adapt to the new live mode, to be able to directly edit the meatadata
thx
Hello ! This plugin is great (Looks like a notion frontmatter 👀 ) but sometimes I use the YAML frontmatter to create my cover page (export with pandoc). So, I obviously don't want to show the metadata on the preview!
It will be great to have an option to not show the metadata.
Some idea :
Thank you for your hard work!
If a filter key contains a word that is already set as filter keys the first value is automatically deleted.
e.g.
Add 'test' to Filter keys
Add 'test test'
Close the settings and open it back, now 'test' filter is gone.
Hello! nice work there!
The problem : I have md files created by a lot of different means, (different browser clippers, copied markdown, clear-mark, manually created) so the frontmatter syntax/keywords are not uniform i.e especially with tags. and each syntax gives different result.
Result: only one clickable tag called "osx docs bash"
Result: not clickable tags
Result: each tag separated, working correctly (this is the expected result with any syntax capitalization combination)
Result: Bullet List with no clickable items.
Thanks in advance.
When file have two tags:剧情 喜剧
Metatable treat it as one: tag:#%E5%89%A7%E6%83%85%20%E5%96%9C%E5%89%A7
In this issue you added possibility to add wiki-link to another page: #3
But this links don't create backlink for linked page.
Is it possible to fix it?
I know you can indicate the frontmatter fields you with to exclude from metatable, but I'd like a way to do the other way : exclude all by default and list the ones you want to exclude.
90% of my fields should be excluded as they are just metadata about the file and I don't want them showing up in presentation, only a few should show up (like a source field). Since I always add new types of fields, this requires me to constantly update the list of excluded fields which is not viable in the long term.
The ability to exclude all by default and specify which ones to whitelist would be great for that purpose 👌
Hi! I was wonder if you can add the posibility of make clickables obsidian Links on metadata. I think this is not possible but it would be a pretty cool feature.
---
tags: #literature
author: [[Noam Chomsky]]
---
Right now the keys to filter are a single comma separated list. As soon as you have more than a couple, it's pretty difficult to manage. The input field is pretty small. It would be awesome to have them in a table or similar to be able to see them at a glance and add/remove them.
Core obsidian shows an invalid metadata. I think you should show invalid metadata in red or something to be more obvious not to remove it. It is always bad to happens and user should be alerted
Thanks
Other than .obsidian-metatable class, can we customize other css class like .set or .member?
I tried to change them in CSS snippets, but failed!
Thanks!
Pretty much what it says in the title, I keep my metadata in "Collapse All" state, which is great, but when I click to see my keys they are all collapsed as well, I'd love to have an option to have keys collapsed by default but when opened to be fully expanded.
Thank you! :)
I like your plugin and I use it instead of Obsidian's native widget, because native one doesn't support attributes other than tags and aliases. I tried to do it using style snippets but it was impossible to do without modifying the actual plugin code. This is my version in theme Atom:
However this modification works only in this theme and likely to break if you update your source code, so it would be cool if there is an option to make it similar to Obsidian's metadata.
As a step further to #43, it would be awesome if an integration with Chronology could be set: by clicking on the date, the user could open it in a chronology context, by opening the Chronology plugin’s calendar at the clicked date.
All of my notes contain creation and modification date in the front matter. Such dates are handled automatically by other plugins, and they are written in ISO 8601 / RFC 3339 date & time format.
---
# example
date: 2021-12-27T02:20:03+01:00
updated: 2023-01-04T16:46:56+01:00
---
It would be awesome if metatable could show them in a nicer, more human-readable format (without changing the source date, of course)
Dataview's inline meta fields have become a popular method of inserting metadata within the content of a note. Unfortunately, it doesn't appear that these fields are recognized by the plugin. I think it would be useful for many users if support was added for this, particularly those who would like to be able to see a comprehensive table of meta fields at the top of their notes without having to copy relevant attributes found within the body to the frontmatter.
It could be that I'm wrong, but as far as my testing went, it currently is not possible to use a custom link title with the frontmatter links similarly to the wikilinks outside of the frontmatter. It would be very great for readability if it were possible tho.
Example: %000 index|Index%
would link to the note "000 Index" but the link would only show "Index".
Would it be possible to give td
and th
elements a part="metatable-td"
or part="metatable-th"
attribute so we can have control over their styling via ::part? I wanted to change some things at the level of td
and th
, like for example setting overflow: hidden
for long URLs (to avoid the scrollbar) and also centering the values (they seem a bit skewed towards the top, not centered, but this may be caused by something else).
This could also apply to other intermediate elements, but I didn't have a use case for it. Is there a technical constraint here somewhere? I tried doing this in developer tools and it worked
Awesome plugin btw, it removes the need for some dataview weird syntax, and makes obsidian closer to some notion functionalities I was used to :)
The README talks about settings but I can't find the plugin settings when I install the plugin
Hi,
Is there a way to use shortened links in YAML frontmatter ?
e.g. :
[LINK](URL)
Hi! First of all thank you for this plugin. I would like to know if there is a possibility to make the metadata interactive links. For example in my notes I like to have the URL of a news or paper, in this sense, it would be very useful to be able to click directly on the metadata and take you to the link.
Can the link form of the original markdown syntax be quoted in double quotes to implement URI links without showing the link length.
Just like this
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
"[🦅] (eagle://item/KXA1DFAZOATRW)"
Show only 🦅 to jump other APP.
Inside the function "Link" urls are encoded and this encoding breaks any wikilinks that contain spaces. For wikilinks the below line setting the localUrl should be the equal to the url variable.
const localUrl = encodeURI((0, import_obsidian2.getLinkpath)(url));
I use tags in the form of emojis to organize my Obsidian notes. Metatable used to display my emoji tags but for some reason the emojis no longer appear.
Here is the text in edit mode.
Here is the text in preview mode.
I did notice that when separating two emoji tags with a comma, this error appears:
This error does not appear when the emoji tags are separated with a space bar.
When Metatable is turned off, the emoji tags become visible again in preview mode. Here is a picture of a note with two emoji tags:
Would it be possible to restore Metatable's ability to show emoji tags? I would hate to re-tag every single note of mine with non-emoji tags.
I hope that metatable can be shown after the first h1 line, which usually serves as title of a document. Thus, when the page is embedded in another file, metatable can be treated as an information table. Is there any way I can adjust the position of metatable? Better can be defined per file in metadata.
As the title says, it would be nice to display URLs as clickable links on the metadata table.
I'm using Obsidian to document some software setups and it would be nice to be able to click the URL directly from the metadata table.
I couldn't figure out a way to target the member
element since it doesn't have a part
— is there another way to do so? I would like to change the grid-gap
value.
Elements that cannot be targeted:
summary
and marker
for the folding of the main "Metadata" title.set
on the table
element.member
on the tr
elementWhen i fold front matter and switch to reading mode and coming back to live-preview it forgets the folding. This only happens when your plugin be active.
Would be great to have Obsidian Metatable (Plugin) also working with Obsidian Canvas (Internal Function)
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.