-
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.
new-feature: local mode; support using git-remote
- changes of CLI: - `--asset-dir` is removed. - `--output-dir`: the root git dir to push to remote, which contains converted assets. A git repo will be initialized in this dir. - `--asset-output-dir`: the dir to store assets. Most cases you do not need to set this path. - changes of github-action: - `md_branch` is removed. Now it always pushes to the branch it converts md from. - new-feature: support specifying a remote as url of the repo that stores converted assets. - new-feature: if `--repo` is not specified, it convert md locally, i.e., assets are linked by relative path, and nothing is pushed to remote. - test: when CI, use repo md2test to test pushing. - refactor: extract common util func from test, such as comparing md, comparing images. - refactor: use feature-list to describe platform specific convertion. - refactor: use k3git to parse git url.
- Loading branch information
1 parent
e4dcd83
commit 939eec0
Showing
35 changed files
with
2,266 additions
and
233 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
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
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 |
---|---|---|
@@ -1,32 +1,27 @@ | ||
name: 'md2zhihu' | ||
description: > | ||
Convert markdown to a single-file by uploading all its local assets. | ||
Convert markdown to a single-file by uploading local assets. | ||
branding: | ||
icon: upload-cloud | ||
color: green | ||
|
||
inputs: | ||
pattern: | ||
description: 'file pattern to convert' | ||
required: true | ||
default: '**/*.md' | ||
|
||
output_dir: | ||
description: 'dir to store converted markdown' | ||
required: true | ||
default: '_md2zhihu' | ||
|
||
md_branch: | ||
description: > | ||
The branch name to push converted markdown to. | ||
A build overrides previous built branch. | ||
If you want to persist the built markdowns, | ||
merge this branch. | ||
dir to store converted markdown. | ||
required: true | ||
default: '_md2zhihu/md' | ||
default: '_md2zhihu' | ||
|
||
asset_branch: | ||
description: > | ||
The branch name in which assets are stored. | ||
The branch in which assets are stored. | ||
This branch must NOT be removed otherwise the assets will not be accessed. | ||
required: true | ||
default: '_md2zhihu/asset' | ||
|
||
|
@@ -66,8 +61,7 @@ runs: | |
--repo https://github.com/${{ github.repository }}.git@${{ inputs.asset_branch }} \ | ||
--code-width 600 \ | ||
--platform ${{ inputs.target_platform }} \ | ||
--asset-dir _md2zhihu \ | ||
--md-output ${{ inputs.output_dir }} \ | ||
--md-output ${{ inputs.output_dir }}/ \ | ||
${{ inputs.pattern }} | ||
git add ${{ inputs.output_dir }} | ||
|
@@ -77,7 +71,7 @@ runs: | |
-c "[email protected]" \ | ||
commit -m "md2zhihu built" | ||
git push -f origin HEAD:refs/heads/${{ inputs.md_branch }} | ||
git push -f origin HEAD:${{ github.ref }} | ||
echo "::set-output name=converted_branch::https://github.com/${{ github.repository }}/tree/${{ inputs.md_branch }}" | ||
echo "::set-output name=converted_branch::https://github.com/${{ github.repository }}/tree/${{ github.ref }}" | ||
shell: bash |
Oops, something went wrong.