Export relations data in Markdown as YAML frontmatter

WHAT DO YOU RECOMMEND

Markdown export currently does not include any data about an object’s relations. This data should be included as YAML frontmatter.

HOW COULD IT BE DONE

E.g. If a Document object has a “Location” text relation and a “Tags” tag relation, prepend a YAML block to the Markdown document that looks like:

anytype_type: "Document"
anytype_relations:
  - name: "Location"
    type: "text"
    content: "N St., Some City"
  - name: "Tags"
    type: "tag"
    content:
      - "Medical sciences"
      - "Career"

Expressing relations as a list instead of a key-value avoids any issues with name clashes when two relations have the same name.

By default, export all relations associated with the object.

If the relation is an object relation, simply including the name and type of the target object should be enough.

REAL WORLD USE CASES

Lock-in is a major issue. One of the most important data when moving between tools is the relationships between each document, but these relationships are often destroyed during import/export. (E.g. exporting from Joplin will result in relative file links between MD files, but importing these directly into Anytype will conclude in thousands of broken links.)

The problem of broken links aside, plenty of important info is entered into relations as if they were form fields, so they’re not just metadata; they are part of the main body of data.

Having a basic YAML representation that Anytype itself understands will also make it possible to import relational data via Markdown, allowing users to pre-process their Markdown documents to fit Anytype’s model and import in a way that makes those documents immediately useful inside Anytype.

RECOMMENDED ALTERNATIVES

A JSON mapping between document titles and their associated titles? Terrible alternative, really. Most people and apps in the Markdown space already recognize YAML as the go-to structured data format.

I also considered translating tags into their #hashtag equivalents and embedding that into the Markdown content itself, but people might use multiple tag-type relations as a sort of “separation of concerns,” which will be lost if you just flatly convert everything into #plain_tags.

I agree with this entirely.

I’ve been looking in the forum to see if its being worked on to see if I should invest in Anytype or not. I think this might be the same issue that perhaps this request should be merged with?

I’ll comment more on that other thread, maybe you’d like to add your weight there too.

Totally agree!!

And I would add that I find it difficult to use the tags feature without the ability to just write a # in the body.

I’m coming from Obsidian, and the way you can link files and tags as you type makes the whole flow so useable, as opposed to needing to insert and select from a menu with a / command.

I use @ to link files in Anytype because using the / takes me out of my train of thought, and if I could do the same with tags, I would feel like I could use that feature as heavily and helpfully as I do in Obsidian.

(And moving from Obsidian, Anytype has so many features that are fantastic and I love!)

Seems we are on the same wavelength right now @eark :slight_smile:

I just posted on this post, before reading your reply here… you might want to jump there and add your weight too given your comment! I agree wholeheartedly. Loving the potential of this product, if it had these couple of features, it eats the PKM market alive imo.

From Reddit: I’m building an open source tool to convert your Anyblock to Markdown with your relations

it would be nice if relations and properties could be included in frontmatter.

currently this missing feature has also consequences for built in types like bookmarks. it’s not possible to do a reasonable markdown export at the moment.

this is how standard notes does it:

there we have an explanation that some elements don’t translate 1:1 (but the content at least gets carried over).

and there is an option for including frontmatter which results in this:

---
title: Montag, 5. Mai 2025 at 16:21
created_at: 2025-05-05T14:21:53.848Z
updated_at: 2025-05-05T14:21:55.224Z
uuid: sklaudfgaeior7fgaisdugf
---

the anytype export could additionally export every relation this object has as text.

users should not rely on third party tools to export their data to a standardized format.

I think this one is done now, as of the recent v47.6

Wow, really? I was looking for this on the roadmap and forum but didn’t find any info about it.

This update was shared via the release notes for version 0.47.4.

I’m happy for any step in the right direction, but the announcement was premature. While the markdown is certainly neater than json, it’s not quite there yet. Most importantly, any properties (née relations) created by users aren’t exported at all. Hopefully this will be resolved with a future update.

you should try the latest beta, it should be in there already

Anytype is beta. I’m using the latest beta (0.47.6), which behaves as I described

latest beta is 0.47.40-beta and it exports properties in fromtmatter for me