Skip to content

Commit

Permalink
v2.1.11
Browse files Browse the repository at this point in the history
+ Update the name of demo script
+ Update some contents of the tutorial
  • Loading branch information
huangwb8 committed Dec 14, 2022
1 parent 20fe73f commit 68e9bec
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ m2w/setup.py
dist/*
m2w.egg-info/*
m2w/__pycache__/*
build/*
build/*
.vscode/*
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ Now, more powerful `m2w 2` comes and meet everyone! :star2: :star2: :star2:
+ Use `config/user.json` to maintain the user information in a little different way comparing with `m2w 1.0`.
+ You can just keep your file structures locally as you like.
+ You can manage lots of websites at the same time via multiple `legacy_*.json`.
+ All you need to deal with is a single python script `m2w.py` instead of two (`update.py` and `upload.py` in `m2w 1.0`).
+ All you need to deal with is a single python script `myblog.py` instead of two (`update.py` and `upload.py` in `m2w 1.0`).
+ Ignore repeated new markdown files for uploading (`v2.2.4+`)
+ Stable and useful as `m2w 1.0`.

## Install

<font face="黑体" color="red" size=5>注意!Python包m2w由于目录结构,正在修复中,目前暂不可用。大家先直接clone该仓库使用。</font>

> [Miniconda](https://docs.conda.io/en/latest/miniconda.html) is recommended to manage Python version and related dependencies.
Here is the dependency:
Expand Down Expand Up @@ -83,7 +81,7 @@ Generally, the latest version of `m2w` is recommended.
## Usage

1. Install m2w from PyPi or this Github repotory.
2. Build a `m2w.py` file (or other names you like) in `<path01>`. Here is the [demo](https://github.com/huangwb8/m2w/blob/main/m2w.py). Create `<path02>/config/user.json` and set `path_m2w` as `<path02>` in `m2w.py`:
2. Build a `myblog.py` file (or other names you like) in `<path01>`. Here is the [demo](https://github.com/huangwb8/m2w/blob/main/myblog.py). Create `<path02>/config/user.json` and set `path_m2w` as `<path02>` in `myblog.py`:

```python
# Absolute path of m2w
Expand Down Expand Up @@ -116,22 +114,23 @@ path_m2w = '<path02>'
}
```

4. Run `m2w.py` like:
4. Run `myblog.py` like:

```bash
python <path01>/m2w.py
python <path01>/myblog.py
```

## Demo

> This demo is conducted in Win10 with [VScode](https://code.visualstudio.com/).
As shown in the following GIF, all changed or brand-new markdowns can be automatically updated/upload via just a simple command `python m2w.py`!
As shown in the following GIF, all changed or brand-new markdowns can be automatically updated/upload via just a simple command `python myblog.py`!

![Code_Iscn3mHU78](https://chevereto.hwb0307.com/images/2022/12/11/Code_Iscn3mHU78.gif)
![Typora_zKwwaE10Qe](https://chevereto.hwb0307.com/images/2022/12/14/Typora_zKwwaE10Qe.gif)

## LOG

+ **2022-12-14**`m2w.py` is the same name as `m2w` package, which would bring some bugs. I change the name of the demo script as `myblog.py`.
+ **2022-12-10** :Upload `m2w 2` to PyPi. You can install `m2w 2` with code (in Shell) like `pip install -i https://pypi.org/simple m2w`. The project url is [https://pypi.org/project/m2w](https://pypi.org/project/m2w).
+ **2022-12-08** :Ignore repeated uploading of new markdown based on their file names. Update ot `m2w 2.2.4` (Strongly recommended)!
+ **2022-12-06**:Optimized parameter space of m2w, which make it more flexible. Update ot `m2w 2.2`!
Expand Down
12 changes: 5 additions & 7 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@
+`m2w 1.0` 相比,使用 和`config/user.json` 略微不同的方式维护用户信息。
+ 可以开心地保留原有的文件结构 (~ ̄▽ ̄)~ 。
+ 通过多个`legacy_*.json` 同时管理多个网站。
+ 只需要使用1个 python 脚本 `m2w.py` 而不是两个(`m2w 1.0` 中的 `update.py``upload.py`)。
+ 只需要使用1个 python 脚本 `myblog.py` 而不是两个(`m2w 1.0` 中的 `update.py``upload.py`)。
+ 忽略重复的新markdown的上传操作(`v2.2.4+`)。该特性对于用户从`m2w 1.0`升级到`m2w 2`十分友好!
+ 像m2w 1.0 稳定且好用!

## 安装

<font face="黑体" color="red" size=5>注意!Python包m2w由于目录结构,正在修复中,目前暂不可用。大家先直接clone该仓库使用。</font>

> 建议使用 [Conda](https://conda.io/projects/conda/en/stable/user-guide/install/download.html) 来管理 Python 版本和相关依赖项。这是一个第3方示例教程:《[win10安装 Anaconda3](https://www.cnblogs.com/syushin/p/15113986.html)》。自己找找,教程很多的 (~ ̄▽ ̄)~
依赖项:
Expand Down Expand Up @@ -72,7 +70,7 @@ pip install -i https://pypi.org/simple m2w==2.2.10
## 使用

1. 通过`pip`或这个Github repotory安装 m2w。
2. 新建文件`<path01>/m2w.py`文件,这是一个[示例](https://github.com/huangwb8/m2w/blob/main/m2w.py)。将`m2w.py`文件中的`path_m2w`赋值为`<path02>`
2. 新建文件`<path01>/myblog.py`文件(名字随便取),这是一个[示例](https://github.com/huangwb8/m2w/blob/main/myblog.py)。将`myblog.py`文件中的`path_m2w`赋值为`<path02>`

```python
# Absolute path of m2w
Expand Down Expand Up @@ -107,14 +105,14 @@ path_m2w = '<path02>'
4. 最后,运行脚本:

```bash
python '<path01>/m2w.py'
python '<path01>/myblog.py'
```

## 项目展示

如下图所示,只需要一行`python m2w.py`,即可自动更新或上传markdown喔!
如下图所示,只需要一行`python myblog.py`,即可自动更新或上传markdown喔!

![Code_Iscn3mHU78](https://chevereto.hwb0307.com/images/2022/12/11/Code_Iscn3mHU78.gif)
![Typora_zKwwaE10Qe](https://chevereto.hwb0307.com/images/2022/12/14/Typora_zKwwaE10Qe.gif)

## 相关仓库

Expand Down
1 change: 0 additions & 1 deletion m2w.py → myblog.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
path_m2w = 'E:/Github/m2w/@test' # /@test

####===============================Dependency

from m2w.json2 import read_json_as_dict
from m2w.up import md_detect, up
from m2w.wp import wp_xmlrpc
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,27 @@
+ Without Proxy like v2ray
+ conda activate pypi-3.10
+ cat ~./.pypirc
### Package URL
+ https://pypi.org/project/m2w
### How to install
+ pip install --upgrade -i https://pypi.org/simple m2w
+ pip install -i https://pypi.org/simple m2w==2.2.10
+ pip install -i https://pypi.org/simple m2w==2.2.11
+ pip install m2w
'''

VERSION = "2.2.10"
VERSION = "2.2.11"

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

setup(
name='m2w',
version=VERSION,
description='Automatically upload and update local markdown to WordPress via Python',
description='v2.2.11: Repair an error about package dir structure',
long_description = long_description,
long_description_content_type = "text/markdown",
author = 'Bensz',
Expand Down

0 comments on commit 68e9bec

Please sign in to comment.