展示 HN:用 Rust 编写的开源 Markdown 研究工具 – Ekphos
Show HN: Open-source Markdown research tool written in Rust – Ekphos

原始链接: https://github.com/hanebox/ekphos

## Ekphos:轻量级 Markdown 研究工具 Ekphos 是一个用 Rust 构建的、快速的基于终端的 Markdown 研究工具,旨在实现高效的笔记记录和组织。它具有三面板界面:一个可折叠的侧边栏用于文件夹导航,一个中央内容区域用于 Markdown 渲染,以及右侧的提纲用于快速访问标题。 **主要特性:** * **组织:** 具有字母顺序排序的层级文件夹结构。可以使用 `n`/`N` 创建新笔记/文件夹。 * **编辑:** 受 Vim 启发的编辑笔记的键绑定 (`e`)。 * **搜索:** 递归搜索,结果高亮显示 (`/`)。 * **图像预览:** 支持本地和远程图像,并在兼容的终端中预览(iTerm2、Kitty 等)。 * **自定义:** 可通过 `~/.config/ekphos/config.toml` 进行配置,包括主题(兼容 Alacritty 主题)和笔记目录。 * **Markdown 支持:** 全面的 Markdown 渲染,包括表格、可折叠的详细信息以及通过 Syntect 实现的多种语言的语法高亮。 **安装:** 从 GitHub 克隆仓库并使用 `make` 或 `cargo` 构建。 **目前处于早期开发阶段**,预计会出现潜在的破坏性更改。欢迎通过向 `main` 分支提交拉取请求来贡献代码。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 展示 HN:用 Rust 编写的开源 Markdown 研究工具 – Ekphos (github.com/hanebox) 4 分,由 haneboxx 2 小时前发布 | 隐藏 | 过去 | 收藏 | 1 条评论 你好!在寻找类似 Obsidian 的 TUI 但一无所获后,我制作了一个 obsidian 的替代品,可以在终端中使用。所以我自己构建了一个。 bebna 1 分钟前 [–] 为什么不使用 (n)vim 或 emacs 和一些插件呢? 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Crates.io Rust License

An open source, lightweight, fast, terminal-based markdown research tool built with Rust.

Ekphos Preview

  • Rust 1.70+ (run rustup update to update)
  • A terminal emulator (for inline image preview: iTerm2, Kitty, WezTerm, Ghostty, or Sixel-compatible terminal)

Using Cargo (Recommended)

git clone https://github.com/hanebox/ekphos.git
cd ekphos
make
sudo make install
git clone https://github.com/hanebox/ekphos.git
cd ekphos
docker build -t ekphos-ssh .
docker compose up -d

After the container is up, SSH into the machine:

ssh ekphos@your-docker-container-ip

If installed with Cargo:

If installed with Make:

cd ekphos  # navigate to the cloned repo
sudo make uninstall
Flag Description
-h, --help Print help information
-v, --version Print version
-c, --config Print config file path
-d, --dir Print notes directory

Configuration is stored in ~/.config/ekphos/config.toml.

# ~/.config/ekphos/config.toml
notes_dir = "~/Documents/ekphos"
welcome_shown = false
theme = "catppuccin-mocha"
show_empty_dir = true
syntax_theme = "base16-ocean.dark"
Setting Description Default
notes_dir Directory where notes are stored ~/Documents/ekphos
welcome_shown Show welcome dialog on startup true
theme Theme name (without .toml extension) catppuccin-mocha
show_empty_dir Show folders that contain no .md files true
syntax_theme Syntax highlighting theme for code base16-ocean.dark

Note: This configuration format requires v0.3.0 or later.

Experimental: Themes are still highly experimental. We expect to finalize the theme standard around v0.6.0 or v0.7.0.

Themes are stored in ~/.config/ekphos/themes/ and use the Alacritty color scheme format.

  • catppuccin-mocha (default)

Ekphos is fully compatible with Alacritty Themes. To use any Alacritty theme:

  1. Browse themes at https://github.com/alacritty/alacritty-theme/tree/master/themes
  2. Download a theme file to your themes directory:
    curl -o ~/.config/ekphos/themes/dracula.toml \
      https://raw.githubusercontent.com/alacritty/alacritty-theme/master/themes/dracula.toml
  3. Set the theme in your config:

Create a .toml file in the themes directory using the Alacritty color format:

# ~/.config/ekphos/themes/mytheme.toml

[colors.primary]
background = "#1e1e2e"
foreground = "#cdd6f4"

[colors.cursor]
text = "#1e1e2e"
cursor = "#f5e0dc"

[colors.selection]
text = "#1e1e2e"
background = "#f5e0dc"

[colors.normal]
black = "#45475a"
red = "#f38ba8"
green = "#a6e3a1"
yellow = "#f9e2af"
blue = "#89b4fa"
magenta = "#f5c2e7"
cyan = "#94e2d5"
white = "#bac2de"

[colors.bright]
black = "#585b70"
red = "#f38ba8"
green = "#a6e3a1"
yellow = "#f9e2af"
blue = "#89b4fa"
magenta = "#f5c2e7"
cyan = "#94e2d5"
white = "#a6adc8"

Then set in config:


Ekphos has three panels:

Panel Position Description
Sidebar Left Collapsible folder tree with notes
Content Center Note content with markdown rendering
Outline Right Auto-generated headings for navigation

Use Tab or Shift+Tab to switch between panels.

The sidebar displays a hierarchical folder tree that automatically detects subdirectories containing .md files:

  • Folders are shown with (collapsed) or (expanded) icons
  • Press Enter on a folder to toggle expand/collapse
  • Folders and notes are sorted alphabetically together
  • Folders start collapsed by default
  1. Press n to create a new note
  2. Enter the note name
  3. Press Enter to confirm

Notes are stored as .md files in your configured notes directory.

Context-aware: When your cursor is on a folder or a note inside a folder, pressing n will create the new note in that folder.

  1. Press N (Shift+N) to create a new folder
  2. Enter the folder name
  3. Press Enter to confirm
  4. A dialog will appear to create the first note in the folder
  5. Enter the note name and press Enter (or Esc to cancel and remove the empty folder)

Context-aware: When your cursor is on a folder, pressing N will create the new folder as a subfolder.

  1. Select a note or folder in the sidebar
  2. Press r to rename
  3. Edit the name and press Enter to confirm (or Esc to cancel)
  1. Select a note or folder in the sidebar
  2. Press d to delete
  3. Confirm with y or cancel with n

Warning: Deleting a folder will remove all notes inside it!

  1. Press / in the sidebar to start searching
  2. Type your search query
  3. Results are highlighted in green, title shows match count
  4. Use Arrow keys or Ctrl+j/k/n/p to navigate between matches
  5. Press Enter to select and close search
  6. Press Esc to cancel search

Features:

  • Searches all notes recursively, including those in collapsed folders
  • Auto-expands folders containing matched notes
  • Border color indicates status: yellow (typing), green (matches found), red (no matches)
  1. Select a note in the sidebar
  2. Press e to enter edit mode
  3. Edit using vim keybindings
  4. Press Ctrl+s to save
  5. Press Esc to exit edit mode (discards unsaved changes)
Syntax Rendered As
# Heading ◆ HEADING (blue)
## Heading ■ Heading (green)
### Heading ▸ Heading (yellow)
#### Heading › Heading (mauve)
##### Heading Heading (teal)
###### Heading Heading (subtle)
- item • item
- [ ] task [ ] task (unchecked)
- [x] task [x] task (checked)
`code` Inline code (green)
```lang Syntax-highlighted code
![alt](path) Inline image
[text](url) Clickable link (cyan)
| table | Formatted table
<details> Collapsible dropdown (cyan)

Code blocks with a language specifier are syntax-highlighted using syntect:

```rust
fn main() {
    let message = "Hello, Ekphos!";
    println!("{}", message);
}
```

Supported languages: Rust, Python, JavaScript, TypeScript, Go, C, C++, Java, Ruby, PHP, Shell, SQL, HTML, CSS, JSON, YAML, Markdown, and many more.

Code blocks without a language specifier render in a uniform green color.

Available syntax themes:

Theme Description
base16-ocean.dark Dark ocean theme (default)
base16-ocean.light Light ocean theme
base16-eighties.dark Dark 80s retro theme
base16-mocha.dark Dark mocha theme
InspiredGitHub GitHub-inspired light theme
Solarized (dark) Solarized dark theme
Solarized (light) Solarized light theme

Set in config:

# ~/.config/ekphos/config.toml
syntax_theme = "base16-mocha.dark"

Use standard markdown image syntax:

![alt text](path/to/image.png)
![screenshot](~/pictures/screenshot.png)
![diagram](./diagrams/flow.png)
![remote](https://example.com/image.png)

Both local files and remote URLs (http/https) are supported.

Supported formats: PNG, JPEG, GIF, WebP, BMP

  1. Navigate to the image line in content view
  2. Click on the image or press Enter/o to open in system viewer

For inline image preview, use a compatible terminal:

  • iTerm2 (macOS)
  • Kitty
  • WezTerm
  • Ghostty
  • Sixel-enabled terminals

Markdown links are rendered with underlined cyan text:

[Ekphos Website](https://ekphos.xyz)
[GitHub](https://github.com)

Opening links:

  • Click on a link to open in your default browser
  • Or navigate to the line and press Space
  • Hover over a link to see the "Open ↗" hint

Multiple links on same line:

  • Use ] to select next link, [ to select previous
  • Selected link is highlighted with yellow background
  • Space opens the currently selected link

Use HTML <details> tags for collapsible/expandable sections:

<details>
<summary>Click to expand</summary>

Hidden content goes here.
This can include multiple lines.

</details>

Usage:

  • Click on the details line to toggle open/close
  • Or navigate with keyboard and press Space
  • When collapsed, shows indicator
  • When expanded, shows indicator with content below

Use cases: FAQs, spoilers, optional information, long code examples.

The outline panel shows all headings in your note:

  1. Press Tab to focus the outline
  2. Use j/k to navigate headings
  3. Press Enter to jump to that heading

Key Action
j/k Navigate up/down
Tab Switch focus (Sidebar → Content → Outline)
Shift+Tab Switch focus (reverse)
Enter/o Open image / Jump to heading
? Show help dialog
q Quit
Key Action
n Create new note
N Create new folder
Enter Toggle folder / Open note
r Rename note/folder
d Delete note/folder
e Edit note
/ Search notes
Key Action
j/k Navigate lines
Shift+J/K Toggle floating cursor mode
Space Toggle task / details dropdown / Open link
]/[ Next/previous link (multi-link lines)
Enter/o Open image in system viewer
Click Open link or image

Floating Cursor Mode: When enabled (yellow border, [FLOAT] indicator), the cursor moves freely within the visible area. The view only scrolls when the cursor reaches the top or bottom edge. Toggle with Shift+J or Shift+K.

Key Action
i Insert before cursor
a Insert after cursor
A Insert at end of line
I Insert at start of line
o New line below
O New line above
v Visual mode
h/l Move cursor left/right
j/k Move cursor up/down
w/b Move by word
0/$ Line start/end
g/G Top/bottom of file
x Delete character
dd Delete line
dw Delete word forward
db Delete word backward
y Yank (copy) selection
p Paste
u Undo
Ctrl+r Redo
Ctrl+s Save and exit
Esc Exit (discard changes)

Delete commands (dd, dw, db) use a confirmation flow with visual feedback:

  1. Press d - Title shows NORMAL d- with yellow border
    • Available: d (line), w (word forward), b (word backward)
  2. Press target key - Text is highlighted, title shows NORMAL [DEL] with red border
    • Press d to confirm deletion
    • Press Esc to cancel
    • Any other key cancels and performs its action

Press v in normal mode to enter visual mode for text selection.

Key Action
h/j/k/l Extend selection
w/b Extend by word
y Yank selection
d/x Delete selection
Esc Cancel

Ekphos is open source and contributions are welcome.

git clone https://github.com/hanebox/ekphos.git
cd ekphos
make run
Branch Purpose
main Development branch
release Stable release branch
  1. Fork the repository
  2. Create a feature branch from main
  3. Make your changes
  4. Submit a PR to the main branch

This project is in an early development stage. There may be frequent unexpected breaking changes throughout the pre-release, but things should remain usable throughout this stage.

We don't have socials yet, but things are open for discussion. Feel free to create a discussion in this repo.

MIT

联系我们 contact @ memedata.com