{"id":13597136,"url":"https://github.com/Acylation/obsidian-chem","last_synced_at":"2025-04-10T00:31:40.262Z","repository":{"id":158646016,"uuid":"632483618","full_name":"Acylation/obsidian-chem","owner":"Acylation","description":"Chemistry support for Obsidian. Rendering SMILES strings into chemistry structures.","archived":false,"fork":false,"pushed_at":"2024-04-27T07:02:07.000Z","size":289,"stargazers_count":95,"open_issues_count":19,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T02:34:17.307Z","etag":null,"topics":["cheminformatics","chemistry","obsidian","obsidian-community","obsidian-md","obsidian-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Acylation.png","metadata":{"files":{"readme":"README-ZH.md","changelog":null,"contributing":"docs/CONTRIBUTING-ZH.md","funding":".github/FUNDING.yml","license":"LICENSE","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":null,"patreon":null,"open_collective":null,"ko_fi":"acylation","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-04-25T13:55:41.000Z","updated_at":"2025-03-24T08:44:59.000Z","dependencies_parsed_at":"2023-09-24T05:33:33.115Z","dependency_job_id":"97da8747-aab4-44ed-b50b-5038dbefa893","html_url":"https://github.com/Acylation/obsidian-chem","commit_stats":{"total_commits":83,"total_committers":2,"mean_commits":41.5,"dds":"0.048192771084337394","last_synced_commit":"2799e880168bcf26d82d70a3354b5d1382e7cb08"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acylation%2Fobsidian-chem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acylation%2Fobsidian-chem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acylation%2Fobsidian-chem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acylation%2Fobsidian-chem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Acylation","download_url":"https://codeload.github.com/Acylation/obsidian-chem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248135255,"owners_count":21053644,"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":["cheminformatics","chemistry","obsidian","obsidian-community","obsidian-md","obsidian-plugin"],"created_at":"2024-08-01T17:00:21.861Z","updated_at":"2025-04-10T00:31:39.776Z","avatar_url":"https://github.com/Acylation.png","language":"TypeScript","funding_links":["https://ko-fi.com/acylation"],"categories":["原生中文插件，欢迎支持"],"sub_categories":["专业领域"],"readme":"# Obsidian Chem\n\n![Obsidian Downloads](https://img.shields.io/badge/dynamic/json?logo=obsidian\u0026color=%23483699\u0026label=downloads\u0026query=%24%5B%22chem%22%5D.downloads\u0026url=https%3A%2F%2Fraw.githubusercontent.com%2Fobsidianmd%2Fobsidian-releases%2Fmaster%2Fcommunity-plugin-stats.json) ![Powered by RDKit](https://img.shields.io/badge/Powered%20by-RDKit-3838ff.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEXc3NwUFP8UPP9kZP+MjP+0tP////9ZXZotAAAAAXRSTlMAQObYZgAAAAFiS0dEBmFmuH0AAAAHdElNRQfmAwsPGi+MyC9RAAAAQElEQVQI12NgQABGQUEBMENISUkRLKBsbGwEEhIyBgJFsICLC0iIUdnExcUZwnANQWfApKCK4doRBsKtQFgKAQC5Ww1JEHSEkAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wMy0xMVQxNToyNjo0NyswMDowMDzr2J4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDMtMTFUMTU6MjY6NDcrMDA6MDBNtmAiAAAAAElFTkSuQmCC)\n\n[English](README.md) | [简体中文](README-ZH.md)\n\n**Chem** 是一个旨在提升化学相关笔记记录体验的 [Obsidian.md](https://obsidian.md/) 插件。目前，本插件能够将您笔记中的SMILES字符串渲染为化学结构式。（基于 [Smiles Drawer](https://github.com/reymond-group/smilesDrawer) 与 [RDKit.js](https://github.com/rdkit/rdkit-js)）\n\n\u003e [!Note]\n\u003e 最新插件版本: 0.4.1  \n\u003e 文档版本: 0.4.1  \n\n## 功能介绍\n\n### 将 SMILES 字符串渲染为化学结构式\n\n#### 代码块渲染\n\n如图所示，本插件能够识别语言被标记为 `smiles` 的代码块，并将其中的 SMILES 字符串逐行转化为化学结构式。得益于 SMILES 的纯文本特性，数据能够持久保存，该功能将得到稳定支持；此外，由于 SMILES 是一个通用标准，即使本插件换用了其他化学信息学工具包，SMILES 字符串仍能够被正确解析和渲染\n\n![渲染 SMILES 字符串](https://github.com/Acylation/obsidian-chem/assets/73122375/a9f9a440-dc66-4689-ab1a-1ef265242778)\n\n#### 行内渲染\n\n行内渲染功能可以在插件设置页中启用。具有特定前缀的代码行将被 Chem 插件识别、解析。默认的语法格式是 `$smiles=C1=CC=CC=C1`，前缀同样可以在插件设置页中调整\n\n#### 设置结构图像大小和样式主题\n\n您可以在插件设置页面调整化学结构式的尺寸比例，或指定图像大小，并分别调整浅色模式/深色模式下对应的结构式颜色主题。插件设置发生更改，或浅色/深色模式切换后，图像样式会自动更新\n\n![设置大小和样式主题](https://github.com/Acylation/obsidian-chem/assets/73122375/fde8d0a4-2c9c-458c-b357-78952480b755)\n\n#### 复制、导出图像\n\n复制功能位于结构图像的右键菜单。图像均以 `png` 格式导出，并能直接粘贴到笔记中，作为文件保存入附件文件夹，也可以以图片形式粘贴到微信、PowerPoint 等其他软件中。导出比例、透明/有背景色、颜色主题等可以灵活配置。\n\n#### 在代码块中调用 Dataview\n\n在插件设置中启用`解析 Dataview`功能后，`smiles` 代码块将逐行被 Dataview 解析，解析结果用于渲染结构图像。内联 Dataview 查询式 (Queries) 和内联 DataviewJS 的启用、前缀等设置与 Dataview 插件本体保持一致。\n\n![在 SMILES 代码块中编写内联 Dataview](https://github-production-user-asset-6210df.s3.amazonaws.com/73122375/292734194-d227fdb8-9c8f-4c87-965a-73c0f2445993.png)\n\n\u003e [!Warning]\n\u003e 本功能依赖 Dataview 插件本体，若要使用本功能，请确保您已安装并启用 Dataview 插件\n\u003e\n\u003e 运行 DataviewJS 需要调用 `eval()` 函数，具有一定的风险。请确保您输入/粘贴的代码是受信任的\n\u003e\n\u003e 若您希望在启用 Dataview 查询式 (Queries) 时禁用 DataviewJS，请在 Dataview 插件设置中禁用 `Enable JavaScript Queries` 或 `Enable Inline JavaScript Queries` 选项  \n\n## SMILES 介绍\n\n### SMILES 是什么？\n\n简化分子线性输入规范，Simplified Molecular-Input Line-Entry System，简称 SMILES，是一种用线性 ASCII 字符串描述化学结构的规范。您可以参阅[官方网站](http://opensmiles.org/opensmiles.html)或[维基百科](https://zh.wikipedia.org/wiki/%E7%AE%80%E5%8C%96%E5%88%86%E5%AD%90%E7%BA%BF%E6%80%A7%E8%BE%93%E5%85%A5%E8%A7%84%E8%8C%83)以了解更多内容\n\n### 为什么使用 SMILES？\n\nSMILES 使用 ASCII 字符串表示化学结构的特性与 Obsidian 的纯文本编辑器的定位十分契合。作为一种通用规范，SMILES 得到了许多专业化学工具的支持，相比于 mhchem 和 chemfig 等 LaTeX 包，使用起来更加方便；而与其他通用化学结构规范相比，SMILES 的语义明晰，可读性更强\n\n### 如何生成 SMILES 字符串？\n\n对于简单结构，您在初步学习 SMILES 知识后即可手动输入。对于复杂结构，您可以使用 ChemDraw，[ChemDrawJS](https://chemdrawdirect.perkinelmer.cloud/js/sample/index.html#)，[MarvinJS](https://marvinjs-demo.chemaxon.com/latest/index.html) 或 [Ketcher](https://lifescience.opensource.epam.com/KetcherDemoSA/index.html) 等**结构编辑器**先行绘制，再导出 SMILES 字符串。您可以使用 [Obsidian Ketcher](https://github.com/yuleicul/obsidian-ketcher) 插件在 Obsidian 中直接绘制化学结构，并导出 SMILES 字符串。\n\n您也可以使用 [Open Babel](https://openbabel.org/)，[JOELib](https://sourceforge.net/projects/joelib/) 或 [Chemical Translation Service](https://cts.fiehnlab.ucdavis.edu/) 等**化学语言转换工具**/**化学数据库**，将化合物名称、CAS 号、`*.mol` 文件等转化为 SMILES 格式\n\n## 安装步骤\n\n\u003e [!Note]\n\u003e 确保您已在设置→第三方插件中禁用**安全模式**\n\n本插件可以在官方插件市场中找到。在`设置→第三方插件→浏览`中，搜索 `Chem` 插件，点击安装并启用\n\n由于网络问题无法浏览插件市场时，请按照以下步骤手动安装\n\n1. 在本仓库的最新 [release](https://github.com/Acylation/obsidian-chem/releases/latest) 页面中下载 `main.js`，`style.css` 和 `manifest.json` 三个文件，或者下载压缩包后解压\n2. 将上述文件复制到您本地的笔记库的插件路径，如 `[yourvault]/.obsidian/plugins/chem/`。您可能需要自行新建 `chem` 这个文件夹\n3. 打开/重启 Obsidian 或刷新插件列表，您将看到 `Chem` 插件，点击启用，安装完成！\n\n\u003e [!Note]\n\u003e 若您希望使用 `RDKit.js` 作为渲染器，插件会访问 [release](https://github.com/Acylation/obsidian-chem/releases/latest) 页面，尝试下载 `RDKit_minimal` 和 `RDKit_minimal.wasm` 两个文件。若您无法连接到 GitHub，请在 [release](https://github.com/Acylation/obsidian-chem/releases/latest) 页面中手动下载它们，并放在 `[yourvault]/.obsidian/plugins/chem/rdkit/` 路径下，以供插件识别、加载\n\n## 插件定位\n\n我希望本插件能够提升化学相关笔记的记录体验。例如，您可能希望在电子实验记录中记下您今天合成的化合物的结构式，或者您想创建有机化学反应的 Anki 卡片等等。下面是一些我认为本插件可以提供的功能：\n\n- 显示化学式、结构式\n- 从剪切板或常用化学文件导入分子结构\n- 在分子结构旁添加化合物信息，如精确质量等，能够帮到质谱用户和化学初学者\n- 支持以内坐标表示的分子结构，优化计算化学工作流\n- 物理化学LaTeX公式模板，拯救您的物理化学课笔记\n- ......\n\n你们的意见对这个插件的迭代、建设有着很大的帮助。本插件的首个功能——将 SMILES 字符串渲染为结构式，就是在社区用户的呼唤下开发的。我十分感谢用户们的有益讨论 （参见 [acknowledgment](https://github.com/Acylation/obsidian-chem#acknowledgment) 部分），也欢迎各位的任何反馈和建议\n\n## 贡献指南\n\n首先感谢您考虑为本项目添砖加瓦！本插件欢迎任何错误报告（bug report）、功能请求（feature request）和合并请求（pull request）。更多细节请参见[贡献指南](docs/CONTRIBUTING-ZH.md)\n\n\u003e [!Note]  \n\u003e 您可以直接使用中文提交内容。能力允许时，还希望您能够附上对应的英文关键词/标题，以便潜在的国际用户和开发者检索和阅读。您使用中文提交的内容将由我翻译\n\n## 开发进展\n\n本项目使用 GitHub Projects 记录[开发进展](https://github.com/users/Acylation/projects/6)\n\n## 同类插件推荐\n\n`Chem` 插件目前专注于将文本渲染为化学结构。如果您希望在 Obsidian 中从头**绘制**复杂的化学结构，[Ketcher](https://github.com/yuleicul/obsidian-ketcher) 插件集成了一个强大的结构编辑器。\n\n[Chemical Structure Renderer](https://github.com/xaya1001/obsidian-Chemical-Structure-Renderer) 与本插件功能类似。不同于本插件的本机解析、渲染，`Chemical Structure Renderer` 是由 [Ketcher](https://github.com/epam/ketcher)、[Indigo](https://github.com/epam/Indigo) 等在线服务驱动的。\n\n## 致谢\n\n本插件依赖 [Smiles Drawer](https://github.com/reymond-group/smilesDrawer) 和 [RDKit.js](https://github.com/rdkit/rdkit-js) 实现 SMILES 字符串的解析以及结构式绘制的功能。[Mathpix](https://github.com/Mathpix/mathpix-markdown-it) 展示了导入 Smiles Drawer 包以及使用代码块语法的实例。向这些杰出的工作表示感谢!\n\n在整个开发过程中，官方[开发者文档](https://docs.obsidian.md/Plugins/Getting+started/Build+a+plugin)提供了非常详细的指引，感谢 [@marcusolsson](https://github.com/marcusolsson) 的早期非官方文档，以及对官方开发者文档整理工作的领导!\n\n本插件是在关于“在笔记中包含化学结构式”的论坛讨论的驱动下产生的，感谢论坛成员的启发性讨论！\n\n- \u003chttps://forum.obsidian.md/t/smiles-in-obsidian/35974\u003e\n- \u003chttps://forum.obsidian.md/t/structural-formulas-for-chemistry/29366\u003e\n- \u003chttps://forum.obsidian.md/t/chemistry-formulas-in-obsidian/25772\u003e\n- \u003chttps://forum.obsidian.md/t/obsidian-for-chemistry/33491\u003e\n- \u003chttps://forum.obsidian.md/t/how-to-write-chemical-formulas/12249\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAcylation%2Fobsidian-chem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAcylation%2Fobsidian-chem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAcylation%2Fobsidian-chem/lists"}