Skip to content

Commit

Permalink
Update doc (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Acylation authored Feb 2, 2024
1 parent 85a07c4 commit 99cdbe9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
14 changes: 8 additions & 6 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@

![渲染 SMILES 字符串](https://github.com/Acylation/obsidian-chem/assets/73122375/a9f9a440-dc66-4689-ab1a-1ef265242778)

### 设置结构图像大小和样式主题
#### 设置结构图像大小和样式主题

您可以在插件设置页面调整化学结构式的尺寸比例,或指定图像大小,并分别调整浅色模式/深色模式下对应的结构式颜色主题。插件设置发生更改,或浅色/深色模式切换后,图像样式会自动更新

![设置大小和样式主题](https://github.com/Acylation/obsidian-chem/assets/73122375/fde8d0a4-2c9c-458c-b357-78952480b755)

### 复制、导出图像
#### 复制、导出图像

复制功能位于结构图像的右键菜单。图像均以 `png` 格式导出,并能直接粘贴到笔记中,作为文件保存入附件文件夹,也可以以图片形式粘贴到微信、PowerPoint 等其他软件中。导出比例、透明/有背景色、颜色主题等可以灵活配置。

### 在代码块中调用 Dataview
#### 在代码块中调用 Dataview

在插件设置中启用`解析 Dataview`功能后,`smiles` 代码块将逐行被 Dataview 解析,解析结果用于渲染结构图像。内联 Dataview 查询式 (Queries) 和内联 DataviewJS 的启用、前缀等设置与 Dataview 插件本体保持一致。

![在 SMILES 代码块中编写内联 Dataview](https://github-production-user-asset-6210df.s3.amazonaws.com/73122375/292734194-d227fdb8-9c8f-4c87-965a-73c0f2445993.png)

> [!Warning]
> 本功能依赖 Dataview 插件本体,若要使用本功能,请确保您已安装并启用 Dataview 插件
>
>
> 运行 DataviewJS 需要调用 `eval()` 函数,具有一定的风险。请确保您输入/粘贴的代码是受信任的
>
>
> 若您希望在启用 Dataview 查询式 (Queries) 时禁用 DataviewJS,请在 Dataview 插件设置中禁用 `Enable JavaScript Queries``Enable Inline JavaScript Queries` 选项
## SMILES 介绍
Expand All @@ -53,7 +53,9 @@ SMILES 使用 ASCII 字符串表示化学结构的特性与 Obsidian 的纯文

### 如何生成 SMILES 字符串?

对于简单结构,您在初步学习 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 字符串。您也可以使用 [Open Bable](http://openbabel.org/wiki/Main_Page)[JOELib](https://sourceforge.net/projects/joelib/)[Chemical Translation Service](https://cts.fiehnlab.ucdavis.edu/)**化学语言转换工具**/**化学数据库**,将化合物名称、CAS 号、*.mol 文件等转化为 SMILES 格式
对于简单结构,您在初步学习 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 字符串。

您也可以使用 [Open Babel](https://openbabel.org/)[JOELib](https://sourceforge.net/projects/joelib/)[Chemical Translation Service](https://cts.fiehnlab.ucdavis.edu/)**化学语言转换工具**/**化学数据库**,将化合物名称、CAS 号、`*.mol` 文件等转化为 SMILES 格式

## 安装步骤

Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ The data is stored as plain text, so you won’t lose it. The renderer will alwa

![Render SMILES strings into structures](https://github.com/Acylation/obsidian-chem/assets/73122375/a9f9a440-dc66-4689-ab1a-1ef265242778)

### Global Sizing and Theming
#### Global Sizing and Theming

You can adjust the structure scale or the image size and configure light/dark themes of the structure images in the plugin’s settings page. The structures in open notes will be automatically updated when the plugin settings or Obsidian color scheme are changed.

![Configure size and theme](https://github.com/Acylation/obsidian-chem/assets/73122375/fde8d0a4-2c9c-458c-b357-78952480b755)

### Copy & Export
#### Copy & Export

The copy feature is accessible through the right-click menu on images. Images are copied in `png` format. Despite common applications, you can also paste the copied image into your note, which will then save the image as a file to your attachment folder. The scale of the export, transparency, and theme can be configured to suit your needs.

### Utilizing Dataview
#### Utilizing Dataview

Inline Dataview queries and DataviewJS rendering can be enabled in the settings tab. Once enabled, lines within the smiles block will be checked and parsed. The return value from this process is used to render chemical structures, providing greater flexibility. The prefix and strategy are fetched directly from the corresponding Dataview plugin settings.
Inline Dataview queries and DataviewJS rendering can be enabled in the settings tab. Once enabled, lines within the smiles block will be checked and parsed. The return values from this process will be used to render chemical structures, providing greater flexibility. The prefix and strategy are fetched directly from the corresponding Dataview plugin settings.

![Dataview lines in smiles block](https://github-production-user-asset-6210df.s3.amazonaws.com/73122375/292734194-d227fdb8-9c8f-4c87-965a-73c0f2445993.png)

> [!Warning]
> This feature is dependent on the Dataview plugin. Please ensure that you have installed and enabled it.
>
> The execution of DataviewJS is implemented by calling `eval()` at the bottom, which is known to have safety issues.To avoid unintended execution, only trusted code lines should be passed.
>
> If you wish to disable DataviewJS rendering, you can toggle off the `Enable JavaScript Queries` or `Enable Inline JavaScript Queries` options through the Dataview plugin settings.
> The execution of DataviewJS is implemented by calling `eval()` at the bottom, which is known to have security issues. To avoid unintended execution, only trusted code lines should be passed.
>
> If you wish to keep inline Dataview queries rendering and only disable DataviewJS, you can toggle off the `Enable JavaScript Queries` or `Enable Inline JavaScript Queries` options through the Dataview plugin settings.
## Introduction on SMILES

Expand All @@ -55,7 +55,9 @@ Using SMILES strings to represent molecules is easier and more widely supported

### How to Generate SMILES Strings?

For simple structures, you can type them in manually. However, for more complex ones, you may want to use **structure editors**, such as ChemDraw, [ChemDrawJS](https://chemdrawdirect.perkinelmer.cloud/js/sample/index.html#), [MarvinJS](https://marvinjs-demo.chemaxon.com/latest/index.html) and [Ketcher](https://lifescience.opensource.epam.com/KetcherDemoSA/index.html). Also, you can use **translators** like [Open Bable](http://openbabel.org/wiki/Main_Page), [JOELib](https://sourceforge.net/projects/joelib/) and the [Chemical Translation Service](https://cts.fiehnlab.ucdavis.edu/) to convert chemical names, CAS numbers and *.mol files into SMILES strings.
For simple structures, you can type them in manually. However, for more complex ones, you may want to use **structure editors**, such as ChemDraw, [ChemDrawJS](https://chemdrawdirect.perkinelmer.cloud/js/sample/index.html#), [MarvinJS](https://marvinjs-demo.chemaxon.com/latest/index.html) and [Ketcher](https://lifescience.opensource.epam.com/KetcherDemoSA/index.html). There's a Ketcher editor integration plugin [Obsidian Ketcher](https://github.com/yuleicul/obsidian-ketcher) available right in Obsidian.

Also, you can use **translators** like [Open Babel](https://openbabel.org/), [JOELib](https://sourceforge.net/projects/joelib/) and the [Chemical Translation Service](https://cts.fiehnlab.ucdavis.edu/) to convert chemical names, CAS numbers and `*.mol` files into SMILES strings.

## Installation

Expand Down Expand Up @@ -96,7 +98,7 @@ Check out the [roadmap](https://github.com/users/Acylation/projects/6) to see wh

`Chem` plugin is now primarily focused on rendering texts into structures. If you want to create complex structures from scratch, the [Ketcher](https://github.com/yuleicul/obsidian-ketcher) plugin has integrated a powerful opensource editor.

[Chemical Structure Renderer](https://github.com/xaya1001/obsidian-Chemical-Structure-Renderer) is a similar plugin, which uses [Ketcher](https://github.com/epam/ketcher), [Indigo](https://github.com/epam/Indigo) online service for parsing and rendering.
[Chemical Structure Renderer](https://github.com/xaya1001/obsidian-Chemical-Structure-Renderer) is a similar plugin of `Chem`, which uses [Ketcher](https://github.com/epam/ketcher), [Indigo](https://github.com/epam/Indigo) online service for parsing and rendering, while `Chem` plugin integrates standalone packages and runs locally.

## Acknowledgement

Expand Down
1 change: 1 addition & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"description": "Providing chemistry supports. Rendering SMILES strings into chemistry structures.",
"author": "Acylation",
"authorUrl": "https://github.com/Acylation",
"fundingUrl": "https://ko-fi.com/Acylation",
"isDesktopOnly": false
}

0 comments on commit 99cdbe9

Please sign in to comment.