Skip to main content

mbs

博客管理器,可以管理多个博客的文章。

使用

1 安装

pip install mbs-cn

2 命令

usage: mbs [-h] [-cs] [-n CATEGORY MARKDOWN_FILE_PATH] [-d TITLE] [-sc FOLDER] [-uo PATH] [-ua FOLDER]

博客管理器

optional arguments:
  -h, --help            显示当前帮助信息,然后退出
  -cs, --categories     显示所有分类
  -n CATEGORY MARKDOWN_FILE_PATH, --new-post CATEGORY MARKDOWN_FILE_PATH
                        要上传的 markdown 文件的分类和路径
  -d TITLE, --delete TITLE
                        要删除的文章标题
  -sc FOLDER, --scan-changed-files FOLDER
                        扫描目标文件中所有有变化的文件
  -uo PATH, --update-one PATH
                        更新一个文件
  -ua FOLDER, --update-all FOLDER
                        更新指定目录中的所有文件

3 当前支持的博客

  • 博客园
  • 简书
  • 思否
  • 个人网站 / 博客

简书的图片不支持外链,所以采用异步的方式将所有外链图片上传到简书的图床中。 对于支持外链图片的博客,默认使用外链图片,不会上传到对应博客的图床。

4 问题

  • 部分代码写得难看,因为能使用,暂时就没有优化

5 debug

默认日志是保存在文件里,不在终端输出,但有时可能会遇到执行一条命令后终端没有任何输出,查看日志或者启动 debug 可能会有帮助。

日志文件路径:

  • windows %APPDATA%\mbs\mbs.log
  • Linux/Mac $HOME/.config/mbs/mbs.log

开启 debug 模式可以在终端也输出日志,因为日志文件一样可以看,所以此功能作用不大。开启方式为在当前终端设置环境变量MBS_DEBUG=1。

6 注意

当前仅对使用mbs上传的文章进行管理,其他已经上传的文章,需要自己想办法将有关数据添加到数据库中。

数据库文件与日志文件在同一个目录中。

7 效果图

  1. 检查更新

截屏2021-05-28 20.20.08

截屏2021-05-28 20.21.05

Metadata

Release files for mbs-cn 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mbs-cn 0.0.7
File Interpreter ABI Platform
mbs_cn-0.0.7-py3-none-any.whl Python 3 none any Details

Release files / mbs_cn-0.0.7-py3-none-any.whl

Download URL mbs_cn-0.0.7-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
938efb581e426f6f2fa71a4223b32d2f1b863c18d679a92e19482da4c582e036
BLAKE2b-256 checksum
How to use checksums
8ec8b2c7a5ff4d764e13b0dc9a8b22d867bffc21e2f5bc6f284da2bf5ce1e9d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.0.7 This release

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page