{"id":13598608,"url":"https://github.com/deathau/cm-editor-syntax-highlight-obsidian","last_synced_at":"2025-04-04T19:15:08.785Z","repository":{"id":45903278,"uuid":"309347092","full_name":"deathau/cm-editor-syntax-highlight-obsidian","owner":"deathau","description":"A plugin for [Obsidian](https://obsidian.md) which allows syntax highlighting for code blocks in the editor.","archived":false,"fork":false,"pushed_at":"2024-03-25T00:42:32.000Z","size":1583,"stargazers_count":525,"open_issues_count":64,"forks_count":39,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-28T18:16:04.378Z","etag":null,"topics":["obsidian-md","obsidian-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deathau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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,"publiccode":null,"codemeta":null},"funding":{"github":"deathau","custom":["https://www.paypal.me/deathau"]}},"created_at":"2020-11-02T11:17:37.000Z","updated_at":"2025-03-23T16:48:03.000Z","dependencies_parsed_at":"2024-01-14T04:43:12.080Z","dependency_job_id":"46f420a7-4326-44db-b0ce-8fb9515d3306","html_url":"https://github.com/deathau/cm-editor-syntax-highlight-obsidian","commit_stats":{"total_commits":31,"total_committers":6,"mean_commits":5.166666666666667,"dds":"0.25806451612903225","last_synced_commit":"fb9a1a08a19491ceada0ebabad2ed5087885cb3b"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathau%2Fcm-editor-syntax-highlight-obsidian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathau%2Fcm-editor-syntax-highlight-obsidian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathau%2Fcm-editor-syntax-highlight-obsidian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deathau%2Fcm-editor-syntax-highlight-obsidian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deathau","download_url":"https://codeload.github.com/deathau/cm-editor-syntax-highlight-obsidian/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234923,"owners_count":20905854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["obsidian-md","obsidian-plugin"],"created_at":"2024-08-01T17:00:54.222Z","updated_at":"2025-04-04T19:15:08.758Z","avatar_url":"https://github.com/deathau.png","language":"JavaScript","funding_links":["https://github.com/sponsors/deathau","https://www.paypal.me/deathau","https://paypal.me/deathau"],"categories":["HarmonyOS","JavaScript","obsidian-plugin","Uncategorized"],"sub_categories":["Windows Manager","Uncategorized"],"readme":"# Editor Syntax Highlight Obsidian Plugin\nA plugin for [Obsidian](https://obsidian.md) which allows syntax highlighting for code blocks in the editor.\n\n![Screenshot](https://github.com/deathau/cm-editor-syntax-highlight-obsidian/raw/main/screenshot.png)\n\nImports code from [CodeMirror](https://github.com/codemirror/CodeMirror/)\n\n### Compatibility\n\nCustom plugins are only available for Obsidian v0.9.7+.\n\nThe current API of this repo targets Obsidian **v0.9.7**. \n\n### Notes\nThis is all very expermental at the moment, so parts might not work, etc.\n\nThis imports a bunch of [syntax highlighting modes from CodeMirror](https://github.com/codemirror/CodeMirror/tree/5.58.2/mode), as well as the [yonce](https://github.com/codemirror/CodeMirror/blob/5.58.2/theme/yonce.css) theme for dark mode.\n\n## Installation\n\n### From within Obsidian\nFrom Obsidian v0.9.8, you can activate this plugin within Obsidian by doing the following:\n- Open Settings \u003e Third-party plugin\n- Make sure Safe mode is **off**\n- Click Browse community plugins\n- Search for \"Syntax Highlight\"\n- Click Install\n- Once installed, close the community plugins window and activate the newly installed plugin\n#### Updates\nYou can follow the same procedure to update the plugin\n\n### From GitHub\n- Download the [Latest release](https://github.com/deathau/cm-editor-syntax-highlight-obsidian/releases/latest)\n- Extract the `cm-editor-syntax-highlight-obsidian` folder from the zip to your vault's plugins folder: `\u003cvault\u003e/.obsidian/plugins/`  \nNote: On some machines the `.obsidian` folder may be hidden. On MacOS you should be able to press `Command+Shift+Dot` to show the folder in Finder.\n- Reload Obsidian\n- If prompted about Safe Mode, you can disable safe mode and enable the plugin.\nOtherwise head to Settings, third-party plugins, make sure safe mode is off and\nenable the plugin from there.\n\n## Development\n\nThis project uses Typescript to provide type checking and documentation.  \nThe repo depends on the latest [plugin API](https://github.com/obsidianmd/obsidian-api) in Typescript Definition format, which contains TSDoc comments describing what it does.\n\n**Note:** The Obsidian API is still in early alpha and is subject to change at any time!\n\nIf you want to contribute to development and/or just customize it with your own\ntweaks, you can do the following:\n- Clone this repo.\n- `npm i` or `yarn` to install dependencies\n- `npm run build` to compile.\n- Copy `manifest.json`, `main.js` and `styles.css` to a subfolder of your plugins\nfolder (e.g, `\u003cvault\u003e/.obsidian/plugins/cm-editor-syntax-highlight-obsidian/`)\n- Reload obsidian to see changes\n\nAlternately, you can clone the repo directly into your plugins folder and once\ndependencies are installed use `npm run dev` to start compilation in watch mode.  \nYou may have to reload obsidian (`ctrl+R`) to see changes.\n\n## Pricing\nHuh? This is an open-source plugin I made *for fun*. It's completely free.\nHowever, if you absolutely *have* to send me money because you like it that\nmuch, feel free to throw some coins in my hat via\n[PayPal](https://paypal.me/deathau) or sponsor me via\n[GitHub Sponsors](https://github.com/sponsors/deathau)\n\n# Version History\n## 0.1.3\n- Fixed elixir mode (sorry this took me so long to release, it was fixed AAAGES ago...)\n- Added javascript syntax highlighting for `dataviewjs` blocks (thanks @dbarenholz)\n- Added YAML syntax highlighting for `dataview` and `tracker` blocks (thanks @KjellConnelly)\n\n## 0.1.2\n- Added elixir mode (thanks to James Dalton)\n\n## 0.1.1\n- Apply codemirror theme to latex math also\n\n## 0.1.0\n- Adjusted the dark codemirror theme to also apply to frontmatter\n- Reload the editor modes on load, so syntax highlighting is shown on enable\n- Delete editor modes on unload, so syntax highlighting is hidden on disable\n\n## v0.0.1\nInitial Release.  \nCopy-pasted and imported editor modes from [CodeMirror 5.58.2](https://github.com/codemirror/CodeMirror/tree/5.58.2/mode). Got compiler errors importing `markdown` and `gfm`, so those aren't available for now.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeathau%2Fcm-editor-syntax-highlight-obsidian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeathau%2Fcm-editor-syntax-highlight-obsidian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeathau%2Fcm-editor-syntax-highlight-obsidian/lists"}