-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: fix readme: update according to latest changes
- Loading branch information
1 parent
10824ca
commit ea220d5
Showing
2 changed files
with
50 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,12 @@ and can be imported into zhihu.com with just one click. | |
|
||
## Usage | ||
|
||
Action: https://github.com/marketplace/actions/md2zhihu | ||
### 1. Convert markdown remotely with github-action: | ||
|
||
This is the recommended way since you do not need install anything locally, just | ||
a `git` is quite enough. | ||
|
||
`md2zhihu` action: https://github.com/marketplace/actions/md2zhihu | ||
|
||
Add action definition into the git repo you have markdowns to convert: | ||
`.github/workflows/md2zhihu.yml`: | ||
|
@@ -36,15 +41,16 @@ jobs: | |
The next push github converts markdowns in `_posts/` and creates a new commit | ||
that contains the converted markdowns in folder `_md2zhihu`. | ||
|
||
E.g., the single-file version of all of my blog posts: | ||
https://github.com/drmingdrmer/drmingdrmer.github.io/tree/master/_md2zhihu | ||
E.g., the single-file version of one of my blog posts: | ||
https://github.com/drmingdrmer/drmingdrmer.github.io/blob/master/_md2zhihu/dict-cmp.md | ||
|
||
To retrieve the converted markdowns, merge branch `_md2zhihu/md`, | ||
or access the branch on the web: | ||
or access the branch directly on the web: | ||
https://github.com/drmingdrmer/drmingdrmer.github.io/blob/master/_md2zhihu/dict-cmp.md | ||
Since all external assets are uploaded copy-paste this page will work as expected. | ||
|
||
|
||
### Options | ||
<details> | ||
<summary>Action Options</summary> | ||
|
||
- `pattern`: | ||
|
||
|
@@ -81,9 +87,10 @@ https://github.com/drmingdrmer/drmingdrmer.github.io/blob/master/_md2zhihu/dict- | |
**required**: True | ||
**default**: `zhihu` | ||
|
||
</details> | ||
|
||
|
||
## Use it Locally | ||
### 2. Convert markdown on your laptop | ||
|
||
System requirement: MaxOS | ||
|
||
|
@@ -94,21 +101,32 @@ npm install -g @mermaid-js/mermaid-cli | |
pip install md2zhihu | ||
``` | ||
|
||
In a git work dir: | ||
|
||
```sh | ||
md2zhihu your_great_work.md | ||
md2zhihu your_great_work.md -r . | ||
``` | ||
|
||
This command convert `your_great_work.md` to `_md2/your_great_work.md`. | ||
And the assets it references are uploaded to the default git remote. | ||
|
||
Or using another git to store assets, e.g.: | ||
``` | ||
md2zhihu your_great_work.md -r [email protected]:drmingdrmer/md2test.git@test | ||
``` | ||
|
||
This command convert `your_great_work.md` to | ||
`_md2/zhihu/your_great_work/your_great_work.md`. | ||
**You must have write access to the git repo** | ||
|
||
### Trouble shoot | ||
<details> | ||
<summary><b>Trouble shoot</b></summary> | ||
|
||
### command not found: md2zhihu | ||
|
||
- `pip install --verbose md2zhihu` Confirm that install done successfully. | ||
- `which md2zhihu` Confirm that the binary can be found: e.g.: `/Users/drdrxp/xp/py3virtual/p38/bin/md2zhihu`. | ||
- `echo $PATH` Confirmat that the install path is included in `PATH`: `...:/Users/drdrxp/xp/py3virtual/p38/bin:...` | ||
|
||
</details> | ||
|
||
## Features | ||
|
||
|