{"id":40017807,"url":"https://github.com/voostindie/obsidian-md-filter","last_synced_at":"2026-01-19T03:06:22.021Z","repository":{"id":152337823,"uuid":"355657219","full_name":"voostindie/obsidian-md-filter","owner":"voostindie","description":"Obsidian Markdown filter for Marked 2.","archived":false,"fork":false,"pushed_at":"2024-04-20T17:40:01.000Z","size":451,"stargazers_count":6,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-20T18:48:04.873Z","etag":null,"topics":["markdown","marked2","obsidian","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voostindie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-04-07T19:15:43.000Z","updated_at":"2024-04-20T17:28:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0891da1-8066-4511-8920-79410fe61cd9","html_url":"https://github.com/voostindie/obsidian-md-filter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/voostindie/obsidian-md-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voostindie%2Fobsidian-md-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voostindie%2Fobsidian-md-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voostindie%2Fobsidian-md-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voostindie%2Fobsidian-md-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voostindie","download_url":"https://codeload.github.com/voostindie/obsidian-md-filter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voostindie%2Fobsidian-md-filter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28559382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T00:46:33.223Z","status":"online","status_checked_at":"2026-01-19T02:00:08.049Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","marked2","obsidian","ruby"],"created_at":"2026-01-19T03:06:21.954Z","updated_at":"2026-01-19T03:06:22.015Z","avatar_url":"https://github.com/voostindie.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Obsidian Markdown Filter\n\n## Introduction\n\nTakes an [Obsidian](https://obsidian.md) Markdown file and processes it for viewing in [Marked 2](https://marked2app.com). Set this script as a custom preprocessor in Marked 2 to make it work:\n\n![Marked 2 App Settings](marked2-settings-screenshot.png)\n\n## Overview\n\nWhat does the filter do? The main idea is that the output of the filter is a document that can live on its own, outside of an Obsidian vault. To achieve that, it: \n\n- Adds the filename as a level 1 title at the top, if enabled (see Settings below).\n- Strips any YAML front matter (I can never get it to work reliably in Marked 2 itself)\n- Strips HTML comments\n- Replaces internal Obsidian links with just the text of the link, or with Obsidian links, based on settings.\n    - If `obsidian_links` is set to `true`\n        - `[[Link to other page|Alias]]` becomes `[Alias](obsidian url to other page)`\n        - `[[Link to other page]]` becomes `[Link to other page](obsidian url to other page)`\n        - `[[Link to other page#Reference]]` becomes `[Link to other page \u003e Reference](obsidian url to \"other page\" with anchor)`\n        - `[[#Reference]]` becomes `[Reference](#reference)`. This will only work if the Processor in Marked is set to Discount (GFM).\n    - If `obsidian_links` is false or not set\n        - `[[Link to other page|Alias]]` becomes `Alias`\n        - `[[Link to other page]]` becomes `Link to other page`\n        - `[[Link to other page#Reference]]` becomes `Link to other page \u003e Reference`\n        - `[[#Reference]]` becomes `Reference`\n- `#tag` gets styled as a tag in Marked Preview\n- Replaces transclusions with IA Writer block syntax\n    - `![[File to include]]` becomes `/path/to/File to include.extension`\n- Strips block IDs from the content\n    - `Text ending with ^block-id` becomes `Text ending with`\n- Strips emojis from the content, if enabled (see Settings below)\n    - `👨🏻‍💻 Foo bar` becomes `Foo bar`\n    \nIn case the document being previewed is not in an Obsidian vault, this processor does nothing.\n\n## Transclusions\n\n- A transclusion only works if the instruction is on a single line, all by itself. Obsidian is more flexible, but Marked 2 is not. I don't want to rewrite the source content too much.\n- Transclusions don't work if the referenced file doesn't exist or has multiple matches in the Obsidian vault.\n- Transcluded files are not processed themselves. So, nested transclusion don't work. According to the Marked 2 documentation it should work, but that's not my experience. I haven't looked into it further.\n- I chose to use the IA Writer block syntax for three reasons:\n    1. It has the cleanest syntax in my opinion.\n    2. It works for many different file types.\n    3. I use iA Writer myself, next to Obsidian, so I'm familiar with it.\n\n## Obsidian vaults\n\nThis filter looks for the vault the file being processed is in by locating the `.obsidian` directory in the directory structure, going upward from the current file. If this directory can't be found, the file being processed is considered not to be in a vault, in which case the filter does nothing.\n\n## Resolving internal links\n\nThe way the filter resolves references in `[[internal links]]` is by globbing for `**/internal links*`, starting from the root of the vault. This is **not** the same as what Obsidian does, but it works perfectly for me, because every one of my files has a name that is unique across the entire vault, allowing me to move files around within the vault without breaking anything.\n\nYour mileage may vary though.\n\n## Settings\n\nThe filter can be configured per-vault by putting a file `.obsidian-md-filter` in the root of the vault. This must be a YAML file. Currently it supports the following settings:\n\n```yaml\nstrip_emojis: true\nadd_title: true\nconvert_tags: true\nobsidian_links: true\nconvert_markdown_links: true\nmarked_processor: discount\n```\n\n- `strip_emojis`: remove emojis in the preview\n- `add_title`: include the title of the note as an H1 in the preview \n- `convert_tags`: convert `#tags` to styled tags in preview\n- `obsidian_links`: if true, links in the document are converted to `obsidian://` urls and will open the linked notes in Obsidian\n- `convert_markdown_links`: if true, links created in the \"portable\" format (`[label](link)`) will be converted to `obsidian://` links. Only use this if you don't have `[[wikilinks]]` as your default link type\n- `marked_processor`: can be set to `mmd` or `multimarkdown` to remove spaces from the slug (#My anchor =\u003e Myanchor), which is compatible with the way MultiMarkdown creates anchors from headlines. Any other value will generate anchors as hyphenated slugs (#My anchor =\u003e my-anchor).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoostindie%2Fobsidian-md-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoostindie%2Fobsidian-md-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoostindie%2Fobsidian-md-filter/lists"}