Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
Co-Authored-By: Alfoil <15233248+alfoil@users.noreply.github.com>
  • Loading branch information
Chaoses-Ib and alfoil committed Nov 7, 2022
1 parent 0e387db commit 781d423
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 103 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Installer/ObsidianShell/

# Advanced Installer caches and default build output
*-cache/
*-SetupFiles/
Prerequisites/
Setup Files/


## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down
115 changes: 64 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
Languages: [English](README.md), [简体中文](README.zh-Hans.md)

## Features
- Associate Markdown files with Obsidian
- Associate Markdown files with Obsidian

In addition to making it easy to open notes, associating files helps integrate Obsidian into your workflows. For example, you can use a launcher to quickly open notes.

For Chinese users:
配合支持拼音搜索的启动器,还可以间接实现通过拼音搜索笔记文件,比如:
- [Everything](https://www.voidtools.com/) + [IbEverythingExt](https://github.com/Chaoses-Ib/IbEverythingExt)
- [Listary](https://www.listarypro.com/)

- VaultRecent/Recent mode
- Open standalone Markdown files in Obsidian, i.e., use Obsidian as a Markdown editor.
- Enable the *global vault pattern*, which means that you can share one config with your notes at different locations.

- Open Markdown files in Obsidian through command line


## Installation
[Releases](https://github.com/Chaoses-Ib/ObsidianShell/releases)

Expand All @@ -27,61 +31,70 @@ Config file location: `%LOCALAPPDATA%\Chaoses Ib\ObsidianShell\ObsidianShell.Con
3. Check `Always use this app to open .md files`
4. Click `OK`


## CLI
A command line interface program for opening Markdown files in Obsidian.

It supports three opening modes:
- VaultFallback (default)
If the Markdown file is in a vault, open the vault, otherwise open the file using the Markdown fallback (see below).
- VaultRecent
If the Markdown file is in a vault, open the vault, otherwise link the file to Recent vault and open the vault.

The idea to implement it comes from [@etienne](https://forum.obsidian.md/t/open-and-edit-standalone-markdown-files/14977).
- Recent
Link the Markdown file to Recent vault and open the vault.

You can change the opening mode in `ObsidianShell.Config`:
```xml
<add key="OpenMode" value="VaultFallback" />
```

Notice: The vault where the Markdown file in must be in the vault list before opening the file, i.e., you must have opened that vault before, otherwise Obsidian will report an error.

### Markdown fallback
You can change the Markdown fallback editor in `ObsidianShell.Config`.

Notepad (default):
```xml
<add key="MarkdownFallback" value="notepad" />
<add key="MarkdownFallbackArguments" value="{0}" />
```

[Visual Studio Code](https://code.visualstudio.com/):
```xml
<add key="MarkdownFallback" value="%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe" />
<add key="MarkdownFallbackArguments" value="{0}" />
```
(The use of `code` is not recommended since it is actually an batch file and leads to a delay)

[Typora](https://typora.io/) (≥ 1.1):
```xml
<add key="MarkdownFallback" value="C:\Program Files\Typora\Typora.exe" />
<add key="MarkdownFallbackArguments" value="{0}" />
```

### Recent vault
You can set the location of your Recent vault in `ObsidianShell.Config`:
```xml
<add key="RecentVault" value="C:\path\to\Recent" />
```
And the maximum number of subdirectories in Recent:
```xml
<add key="RecentLimit" value="10" />
```

Notice: You must have opened the Recent vault before, otherwise Obsidian will report an error when opening files.
- VaultFallback (default)

If the Markdown file you want to open is in a vault, open the vault, otherwise open the file using a custom Markdown editor.

Related configuration:
```xml
<add key="OpenMode" value="VaultFallback" />
```

Markdown editor:
- Notepad (default)
```xml
<add key="MarkdownFallback" value="notepad" />
<add key="MarkdownFallbackArguments" value="{0}" />
```

- [Visual Studio Code](https://code.visualstudio.com/)
```xml
<add key="MarkdownFallback" value="%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe" />
<add key="MarkdownFallbackArguments" value="{0}" />
```
(The use of `code` is not recommended since it is actually an batch file and will cause some startup delays)

- [Typora](https://typora.io/) (≥ 1.1)
```xml
<add key="MarkdownFallback" value="C:\Program Files\Typora\Typora.exe" />
<add key="MarkdownFallbackArguments" value="{0}" />
```
- VaultRecent

If the Markdown file you want to open is in a vault, open the vault, otherwise link the file's parent directory to the Recent vault and then open the file.[^standalone]

Related configuration:
```xml
<add key="OpenMode" value="VaultRecent" />
<add key="RecentVault" value="C:\path\to\Recent" />
<add key="RecentLimit" value="10" />
```
where `RecentVault` is the location of your Recent vault and `RecentLimit` is the maximum number of subdirectories in Recent.

- Recent

Whether the Markdown file you want to open is in a vault, link its parent directory to the Recent vault and then open it.

Related configuration:
```xml
<add key="OpenMode" value="Recent" />
<add key="RecentVault" value="C:\path\to\Recent" />
<add key="RecentLimit" value="10" />
```


Notice: The vault where the Markdown file in (and the Recent vault) must be in the vault list of Obsidian before opening the file, i.e., you must have opened that vault before, otherwise Obsidian will report an error when opening the vault.


## ContextMenu
![](images/ContextMenu.png)

It is used to open the corresponding directory in Obsidian, complementing the defect that the CLI cannot be associated with directories.
It is used to open the corresponding directory in Obsidian, complementing the defect that the CLI cannot be associated with directories.


[^standalone]: [Open and edit standalone Markdown files - Feature requests - Obsidian Forum](https://forum.obsidian.md/t/open-and-edit-standalone-markdown-files/14977)
114 changes: 63 additions & 51 deletions README.zh-Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
语言:[English](README.md)[简体中文](README.zh-Hans.md)

## 功能
- 关联 Markdown 文件到 Obsidian
- 关联 Markdown 文件到 Obsidian

除了方便打开笔记外,关联文件还有助于将 Obsidian 集成进你的工作流,比如你可以使用一个启动器来快速打开笔记文件。

配合支持拼音搜索的启动器,还可以间接实现通过拼音搜索笔记文件,比如:
- [Everything](https://www.voidtools.com/) + [IbEverythingExt](https://github.com/Chaoses-Ib/IbEverythingExt)
- [Listary](https://www.listarypro.com/)

- VaultRecent/Recent 模式
- 在 Obsidian 中打开独立 Markdown 文件,将 Obsidian 用作一个 Markdown 编辑器
- 实现全局仓库模式,让不同位置的笔记可以使用同一份配置

- 通过命令行在 Obsidian 中打开 Markdown 文件


## 安装
[Releases](https://github.com/Chaoses-Ib/ObsidianShell/releases)

Expand All @@ -26,62 +30,70 @@
3. 勾选 `始终使用此应用打开 .md 文件`
4. 点击 `确定`


## CLI
一个用来在 Obsidian 中打开 Markdown 文件的命令行程序。

支持三种打开模式:
- VaultFallback(默认)
如果 Markdown 文件在仓库中,打开仓库,否则就用 Markdown 回落(见下文)打开它。
- VaultRecent
如果 Markdown 文件在仓库中,打开仓库,否则把它链接到 Recent 仓库并打开。

实现方法来自 [@etienne](https://forum.obsidian.md/t/open-and-edit-standalone-markdown-files/14977)
- Recent
把 Markdown 文件链接到 Recent 仓库并打开。

打开模式可以在 `ObsidianShell.Config` 中设置:
```xml
<add key="OpenMode" value="VaultFallback" />
```

注意:要打开的 Markdown 文件的仓库必须在仓库列表中,也就是说,你必须在之前打开过那个仓库,否则 Obsidian 会报错。

### Markdown 回落
Markdown 回落编辑器可以在 `ObsidianShell.Config` 中设置。

记事本(默认):
```xml
<add key="MarkdownFallback" value="notepad" />
<add key="MarkdownFallbackArguments" value="{0}" />
```

[Visual Studio Code](https://code.visualstudio.com/)
```xml
<add key="MarkdownFallback" value="%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe" />
<add key="MarkdownFallbackArguments" value="{0}" />
```
(不推荐用 `code`,它实际上是个批处理文件,会导致一些延迟)

[Typora](https://typora.io/)(≥ 1.1):
```xml
<add key="MarkdownFallback" value="C:\Program Files\Typora\Typora.exe" />
<add key="MarkdownFallbackArguments" value="{0}" />
```

### Recent 仓库
你可以在 `ObsidianShell.Config` 中设置 Recent 仓库的位置:
```xml
<add key="RecentVault" value="C:\path\to\Recent" />
```
以及 Recent 子目录的最大数量:
```xml
<add key="RecentLimit" value="10" />
```

注意:你必须在之前打开过 Recent 仓库,否则 Obsidian 会在打开文件时报错。
- VaultFallback(默认)

如果要打开的 Markdown 文件在某个仓库中,打开该仓库,否则就用自定义的 Markdown 编辑器打开它。

相关配置:
```xml
<add key="OpenMode" value="VaultFallback" />
```

Markdown 编辑器:
- 记事本(默认)
```xml
<add key="MarkdownFallback" value="notepad" />
<add key="MarkdownFallbackArguments" value="{0}" />
```

- [Visual Studio Code](https://code.visualstudio.com/)
```xml
<add key="MarkdownFallback" value="%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe" />
<add key="MarkdownFallbackArguments" value="{0}" />
```
(不推荐用 `code`,它实际上是个批处理文件,会导致一些启动延迟)

- [Typora](https://typora.io/)(≥ 1.1)
```xml
<add key="MarkdownFallback" value="C:\Program Files\Typora\Typora.exe" />
<add key="MarkdownFallbackArguments" value="{0}" />
```
- VaultRecent

如果要打开的 Markdown 文件在某个仓库中,打开该仓库,否则先把它的父目录链接到 Recent 仓库再打开它。[^standalone]

相关配置:
```xml
<add key="OpenMode" value="VaultRecent" />
<add key="RecentVault" value="C:\path\to\Recent" />
<add key="RecentLimit" value="10" />
```
其中 `RecentVault` 代表 Recent 仓库的位置,`RecentLimit` 代表 Recent 子目录的最大数量。
- Recent

不论要打开的 Markdown 文件是否在某个仓库中,都先把它的父目录链接到 Recent 仓库再打开它。

相关配置:
```xml
<add key="OpenMode" value="Recent" />
<add key="RecentVault" value="C:\path\to\Recent" />
<add key="RecentLimit" value="10" />
```


注意:要打开的 Markdown 文件的仓库(以及 Recent 仓库)必须位于 Obsidian 的仓库列表中,也就是说,你必须在之前打开过那个仓库,否则 Obsidian 会在打开仓库时报错。


## ContextMenu
上下文菜单:
![](images/ContextMenu.png)

用于在 Obsidian 中打开相应目录,补足 CLI 无法关联目录的缺陷。
用于在 Obsidian 中打开相应目录,补足 CLI 无法关联目录的缺陷。


[^standalone]: [Open and edit standalone Markdown files - Feature requests - Obsidian Forum](https://forum.obsidian.md/t/open-and-edit-standalone-markdown-files/14977)

0 comments on commit 781d423

Please sign in to comment.