Git Product home page Git Product logo

obsidian-metatable's Introduction

Obsidian Metatable


DEPRECATION NOTICE: This Obsidan plugin is no longer actively maintained. New developments in Obsidian itself have made clear I'm no longer interested in the tool nor maintaining a plugin for it.


A plugin for Obsidian to display the full frontmatter block instead of just the list of tags.

screenshot

Changelog

  • 0.14.7
    • Warn users of this plugin that Obsidian 1.4 broke it.
  • 0.14.6
    • Fix mobile rendering (#45). This was due a webkit bug that forced the removal of customisations for the root summary.
    • Fix relative links (#47).
  • 0.14.5
    • Handle aliases as a special case (#49).
  • 0.14.4
    • Upgrade to Obsidian 1.1
    • Upgrade dependencies due to CVE-2022-46175
  • 0.14.3
    • Fix (#37) local URLs should not be encoded as URIs.
    • Fix tag parts should not be encoded as URIs.
  • 0.14.2
    • Fix (#38) tag URLs should not be encoded as URIs.
  • 0.14.1
    • Fix (#36) tag normalisation when tags are separated by spaces.
  • 0.14.0
    • (breaking) Restructure markup and use Solid.js instead of plain DOM.
    • (breaking) Normalise custom properties. See customising colours and symbols for the full list.
    • Add parts for leaf types (number, boolean, null, ISO date).
    • Add new documentation. It works as an Obsidian vault.
    • Add sidebar view.
    • Add experimental "tight" boundary to change styles when the container is smaller than 260px. If and when Obsidian has a web renderer with support for CSS Container Queries this will be reverted.
    • Add Markdown autolinks.

See the changelog for the full list of version. Or check the decision log for the main design choices.

Configuration

By enabling the plugin in the “Community plugins” section you'll be all set. To see the effects you'll need to open a new document or restart the vault.

Check the documentation for a getting started, customisation strategies, examples and more.

Installation

From Obsidian:

  • Ensure Community Plugins are enabled.
  • Browse community plugins searching for metatable.
  • Click install.
  • Enable plugin in the “Community Plugins” Settings section.
  • Open a file (notice that previously opened files won't get the effects of the plugin until reopened or changed).

From release:

  • Download the obsidian-metatable-{version}.zip file from the chosen release, for example the latest release.
  • Ensure “Community Plugins” are enabled in Settings.
  • Ensure the .obsidian/plugins/ directory exists in your vault directory.
  • Expand the zip file into the .obsidian/plugins/ directory such that an obsidian-metatable directory is a direct child of plugins.
  • Enable plugin in the “Community Plugins” Settings section.
  • Open a file (notice that previously opened files won't get the effects of the plugin until reopened or changed).

From source:

  • Clone the source repository.
  • Run npm install.
  • Run npm run build.
  • Create an obsidian-metatable directory under your vault's .obsidian/plugins/ directory.
  • Copy over main.js, versions.json and manifest.json.
  • Enable plugin in the “Community Plugins” Settings section.
  • Open a file (notice that previously opened files won't get the effects of the plugin until reopened or changed).

Licence

Arnau Siches under the MIT License

obsidian-metatable's People

Contributors

arnau avatar clockoon avatar maro-hmi avatar mrmodest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

obsidian-metatable's Issues

Show tags metadata the same way as it shows by default

Hello, thanks for the plugin.

I want to ask to reuse default obsidian render for tags frontmatter as it provides best visuals, they are clickable and might be customized by themes.

For example:

without metatable plugin:
image

with metatable plugin:
image

Feature Request: Support for Inline Meta Fields

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.

Metatable fails silenty on wrong syntax in frontmatter

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.

[Feature] When Collapse All is opened have all keys be Fully Expanded

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! :)

Feature Request: Cutom link title

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".

Support URLs

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.

Feature Request: add possibility to style td and th

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 :)

MetaTable installed, but nothing happenes

Hi there,

I installed the plugin, enabled it, nothin happenes.
The metadata is still displayed like this:
image

Tried in a different vault, same effect (none).

What may I be missing?

Make metatable appearance the similar to Obsidian's default metadata widget or add option to do that

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:
image
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.

Chinese Support

When file have two tags:剧情 喜剧 Metatable treat it as one: tag:#%E5%89%A7%E6%83%85%20%E5%96%9C%E5%89%A7

Message: "Nested mappings are not allowed"

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

Request: A better experience for filtering keys

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.

Can I adjust the position where the metatable shows?

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.

Use markdown link form.

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.

[Feature Request] Add an option to not show the metadata

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 :

  • Add an "exclude files" in the option of the plugin.
  • Add a special YAML option (true/false) to not show.
  • Add an option to don't show the frontmatter unless you specified with a YAML option or maybe tag... (so, by default, table doesn't appear if you activate this option).

Thank you for your hard work!

Not Showing invalid metadata

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

Inconsistent tag behavior

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.


tags: osx docs bash

Result: only one clickable tag called "osx docs bash"


Tags: osx docs bash

Result: not clickable tags


tags: [osx, docs, bash]

Result: each tag separated, working correctly (this is the expected result with any syntax capitalization combination)


Tags: [osx, docs, bash]

Result: Bullet List with no clickable items.

Thanks in advance.

Bad rendering in mobile

Hi! I use mobile app (iOS 16.2), app version 1.4.1 (83)

And for some reason the plugin gives me error and renders badly:(

FAC97A92-8E6C-498D-BB33-078802CC5495

Relative Markdown links not working

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.)

1. File Not Found

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?

2. Clicking Jumps to Wrong File

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.

Clicking on dates opens Chronology plugin

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.

Some elements cannot be targeted via CSS

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 element

Inconsistent line height

Since the tags field shows the tags in a pill shaped container, the overall line height for that row is higher than other lines, resulting in an off-center text.

image

Is it possible to have comma separated values?

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!

Feature Request: Exclude all fields except specific ones

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 👌

Feature Request: Obsidian links on metadata.

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]]
---

Bug in Filter keys setting

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.

Bug: The plugin doesn't work whitout quotation marks on numbers.

Hi! I woul like to report that the plugin isn't working.
This is the console error:

image

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.

metatable not working

Hello,
Thanks for developing such a great plugin, after just updating obsidian plugins metatable is not shown in preview mode:
for example I have this:
metatable1

it becomes:
metatable2

Tags with emojis do not appear with Metatable (in Preview mode)

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.
image

Here is the text in preview mode.
image

I did notice that when separating two emoji tags with a comma, this error appears:
image

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:
image

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.

Textual presentation

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:

image

It keeps the expand/collapse behavior of the table:

image

And the individual key/value pairs:

image


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.

Bug when exporting pdf with pictures

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

Settings?

The README talks about settings but I can't find the plugin settings when I install the plugin

Too small width for key in mobile version (in portrait mode)

My Phone:
OnePlus 7
Android 11
Display: 6.41" 1920x1080 (FullHD)

Keys badly cut in Portrait mode. Please can you fix it?

Examples on screenshot: aliases, and long_member

First bad because of icon. Second bad because of length of field key.

Portrait mode:

image

Landscape mode:

image

Format dates that appear in ugly RFC/ISO format

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)

Clickable URL And Metadata Bug

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.