Logseq Doctor:在导入 Logseq 之前修复您陈旧的 Markdown 文件
Logseq Doctor: Heal your flat old Markdown files before importing them to Logseq

原始链接: https://github.com/andreoliwa/logseq-doctor

**Logseq Doctor** 是一个命令行工具,旨在准备、清理和管理 Markdown 文件,以便将其无缝集成到 Logseq 中。它充当了一座桥梁,帮助用户将现有的笔记整理成 Logseq 特有的层级大纲格式。 **主要功能包括:** * **格式转换:** 将普通 Markdown 文件转换为 Logseq 兼容的大纲格式。 * **任务管理:** 将任务汇总到统一的待办列表中、添加新任务并提供状态更新。 * **内容实用工具:** 将内容追加到日志或页面中,并清理或标准化现有的 Markdown 文件。 * **性能:** 目前提供 Python (`lqdpy`) 和 Go (`lqd`) 两个版本,未来所有开发工作将集中在运行速度更快的 Go 语言版本上。 **安装:** * **Go 版本:** `brew install andreoliwa/formulae/logseq-doctor` 或 `go install github.com/andreoliwa/logseq-doctor/cmd/lqd@latest` * **Python 版本:** `pipx install logseq-doctor` 尽管该项目目前处于 Alpha 测试阶段,但它提供了一套强大的命令来整理数据,并防止无效内容进入您的 Logseq 图谱。建议用户过渡到作为主要实现版本的 Go 版本 (`lqd`)。

Hacker News 最新 | 往日 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Logseq Doctor:在导入 Logseq 之前修复您陈旧的纯 Markdown 文件 (github.com/andreoliwa) 4 积分 由 ankitg12 发布于 2 小时前 | 隐藏 | 往日 | 收藏 | 讨论 帮助 | 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Documentation Go Build Status Tox Build Status Coverage Status PyPI Package

Logseq Doctor: heal your flat old Markdown files before importing them to Logseq.

📚 Read the full documentation

Note

This project is still alpha, so it's very rough on the edges (documentation and feature-wise).

At the moment, it has both a Python and Go CLI.

The long-term plan is to convert it to Go and slowly remove Python. New features will be added to the Go CLI only.

Logseq Doctor is a command-line tool with commands to manipulate your Logseq Markdown files. It provides utilities to:

  • Convert flat Markdown to Logseq's outline format
  • Append content to pages and journals
  • Create task backlogs that are easily viewed and prioritized in the mobile app
  • Manage tasks in Logseq
  • Clean up and tidy Markdown files
  • Prevent invalid content to be committed
  • And more stuff to come...
  • Backlog Management (backlog): Aggregate tasks from multiple pages into unified backlogs with smart categorization, overdue detection, and focus page generation
  • Content Management (content): Append raw Markdown content to Logseq pages or journals
  • Markdown Integration (md): Parse and add Markdown content using DOM manipulation with support for parent blocks and journal targeting
  • Task Management (task add): Add new tasks or update existing ones with key-based search, preserving children and properties
  • Tidy Up (tidy-up): Clean up and standardize your Markdown files
  • Fast Performance: Written in Go for speed and efficiency
  • Outline Conversion (outline): Convert flat Markdown files to Logseq's outline format
  • Task Listing (tasks): List and manage tasks in your Logseq graph

The recommended way for macOS and Linux is to install with Homebrew:

brew install andreoliwa/formulae/logseq-doctor

Or you can install manually:

go install github.com/andreoliwa/logseq-doctor/cmd/lqd@latest

Confirm if it's in your path:

which lqd
# or
ls -l $(go env GOPATH)/bin/lqd

The recommended way is to install logseq-doctor globally with pipx:

pipx install logseq-doctor

You can also install the development version with:

pipx install git+https://github.com/andreoliwa/logseq-doctor

You will then have the lqdpy command available globally in your system.

To build and install from the source (both Python and Go executables), clone the repository and run:

Type lqd (the Go executable) without arguments to check the current commands and options:

Logseq Doctor heals your Markdown files for Logseq.

Convert flat Markdown to Logseq outline, clean up Markdown,
prevent invalid content, and more stuff to come.

"lqdpy" is the CLI tool originally written in Python; "lqd" is the Go version.
The intention is to slowly convert everything to Go.

Usage:
lqd [command]

Available Commands:
backlog     Aggregate tasks from multiple pages into a unified backlog
completion  Generate the autocompletion script for the specified shell
content     Append raw Markdown content to Logseq
help        Help about any command
md          Add Markdown content to Logseq using the DOM
task        Manage tasks in Logseq (subcommands: add)
tidy-up     Tidy up your Markdown files

Flags:
-h, --help   help for lqd

Use "lqd [command] --help" for more information about a command.

Type lqdpy without arguments to check the current commands and options:

Usage: lqdpy [OPTIONS] COMMAND [ARGS]...

Logseq Doctor: heal your flat old Markdown files before importing them.

Options:
-g, --graph DIRECTORY           Logseq graph  [env var: LOGSEQ_GRAPH_PATH;
required]
--install-completion [bash|zsh|fish|powershell|pwsh]
Install completion for the specified shell.
--show-completion [bash|zsh|fish|powershell|pwsh]
Show completion for the specified shell, to
copy it or customize the installation.
--help                          Show this message and exit.

Commands:
outline  Convert flat Markdown to outline.
tasks    List tasks in Logseq.

To set up local development:

Run this to see help on all available targets:

To run all the tests run:

Note, to combine the coverage data from all the tox environments run:

OS
Windows set PYTEST_ADDOPTS=--cov-append tox
Other PYTEST_ADDOPTS=--cov-append tox
联系我们 contact @ memedata.com