Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e3da67

Browse files
committed
v1.4.0
1 parent 5b9f191 commit 8e3da67

File tree

6 files changed

+43
-26
lines changed

6 files changed

+43
-26
lines changed

‎README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,27 @@
44

55
## 1.安装
66

7-
## 2.配置
7+
(1)具有 .NET Core/.NET 5 环境可以直接使用命令安装:
8+
9+
````shell
10+
dotnet tool install --global dotnet-cnblog
11+
````
12+
13+
(2)如果没有上面的环境,那么可以直接下载二进制文件
14+
15+
下载地址: https://github.com/stulzq/dotnet-cnblogs-tool/releases
16+
17+
> 因为本工具是开源的,而且使用过程中需要输入密码,所以不要相信任何第三方下载,因为它们有可能被植入恶意代码,仅提供上面两种方式。
18+
19+
## 2.使用
820

921
第一次运行需要配置博客ID,账号密码等,按照提示输入即可,对信息采用tea加密算法进行加密存储。
1022

1123
![first-config](./assets/first-config.png)
12-
有可能如下情况:
24+
25+
> 需要账号密码是因为调用 MetaWeblog API 需要此信息
26+
27+
如果安装成功,但是无法正常运行:
1328

1429
![error](./assets/error.png)
1530

@@ -30,20 +45,16 @@ dotnet-cnblog reset
3045

3146
![reset](./assets/reset.png)
3247

33-
## 3.使用
48+
## 3.处理 Markdown 文件中的图片
3449

35-
使用命令对Markdown文件里的图片进行解析,并上传到博客园,并且转换内容保存到新的文件中。
50+
使用命令对Markdown文件里的图片进行解析,上传到博客园,并且转换内容保存到新的文件中。
3651

3752
````shell
38-
dotnet-cnblog <markdown文件路径>
53+
dotnet-cnblog proc -f <markdown文件路径>
3954
````
4055
![test](./assets/test.gif)
4156

42-
## 4.使用演示
43-
44-
![ys](./assets/ys.gif)
45-
46-
## 5.说明
57+
## 4.说明
4758

4859
- 程序未加过多的容错机制,请勿暴力测试。比如发送一个非MarkDown文件到程序。
4960

@@ -53,7 +64,7 @@ dotnet-cnblog <markdown文件路径>
5364

5465
- 图片上传完毕以后,会自动转换md内容保存到带`cnblog`后缀的文件里面
5566

56-
- 密码错误请到程序根目录删除`config.json`后重新运行程序,将会让你设置密码
67+
- 密码错误请重置配置
5768

5869

5970

‎assets/ys.gif

-1.82 MB
Binary file not shown.

‎src/dotnet-cnblogs/Command/CommandProcessFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void Execute(CommandContext context)
5151
//循环上传图片
5252
foreach (var img in imgList)
5353
{
54-
if (img.StartsWith("http"))
54+
if (img.StartsWith("http",StringComparison.OrdinalIgnoreCase))
5555
{
5656
ConsoleHelper.PrintMsg($"图片跳过:{img} ");
5757
continue;

‎src/dotnet-cnblogs/Program.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Drawing;
33
using System.IO;
44
using System.Text;
5-
using System.Threading.Tasks;
65
using Dotnetcnblog.Command;
76
using Dotnetcnblog.Utils;
87
using McMaster.Extensions.CommandLineUtils;
@@ -36,12 +35,20 @@ private static int Main(string[] args)
3635
}
3736
}
3837

38+
/// <summary>
39+
/// 一级命令执行
40+
/// </summary>
41+
/// <param name="app"></param>
42+
/// <returns></returns>
3943
private int OnExecute(CommandLineApplication app)
4044
{
4145
app.ShowHelp();
4246
return 0;
4347
}
4448

49+
/// <summary>
50+
/// 打印标题
51+
/// </summary>
4552
static void PrintTitle()
4653
{
4754
Console.WriteAscii("dotNet Cnblogs Tool", Color.FromArgb(244, 212, 255));
@@ -52,6 +59,10 @@ static void PrintTitle()
5259
Console.WriteLine("");
5360
}
5461

62+
/// <summary>
63+
/// 初始化,加载配置
64+
/// </summary>
65+
/// <returns></returns>
5566
static bool Init()
5667
{
5768
var context=new CommandContext();
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"profiles": {
33
"dotnet-cnblog": {
4-
"commandName": "Project",
5-
"commandLineArgs": "proc -f \"d:\\a.md\""
4+
"commandName": "Project"
65
}
76
}
87
}

‎src/dotnet-cnblogs/dotnet-cnblog.csproj

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@
66
<PackAsTool>true</PackAsTool>
77
<!-- Optional performance setting - enables tiered JIT compilation-->
88
<TieredCompilation>true</TieredCompilation>
9-
<TargetFramework>netcoreapp3.1</TargetFramework>
9+
<TargetFramework>net5.0</TargetFramework>
1010
<ApplicationIcon>program.ico</ApplicationIcon>
1111
<PackageId>dotnet-cnblog</PackageId>
1212
<Authors>stulzq</Authors>
1313
<Company>stulzq</Company>
1414
<Product>dotnet-cnblog</Product>
15-
<Description>Cnblogs Article Quick Release Tool.</Description>
16-
<Copyright>Copyright 2018 stulzq</Copyright>
17-
<PackageProjectUrl>https://github.com/stulzq/CnBlogPublishTool</PackageProjectUrl>
18-
<PackageLicenseUrl>https://github.com/stulzq/CnBlogPublishTool/blob/master/LICENSE</PackageLicenseUrl>
15+
<Description>Cnblogs Article Quick Publish Tool.</Description>
16+
<Copyright>Copyright 2018-2020 stulzq</Copyright>
17+
<PackageProjectUrl>https://github.com/stulzq/dotnet-cnblogs-tool</PackageProjectUrl>
18+
<PackageLicenseUrl>https://github.com/stulzq/dotnet-cnblogs-tool/blob/master/LICENSE</PackageLicenseUrl>
1919
<PackageTags>cnblogs</PackageTags>
2020
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
21-
<Version>1.3.1</Version>
21+
<Version>1.4.0</Version>
2222
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2323
<IncludeSymbols>true</IncludeSymbols>
2424
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2525
<RootNamespace>Dotnetcnblog</RootNamespace>
26+
<PackageReleaseNotes>升级到 .NET 5.0 并且重构代码,使用方法有小的变更,请查看文档 https://github.com/stulzq/dotnet-cnblogs-tool</PackageReleaseNotes>
2627
</PropertyGroup>
2728

2829
<ItemGroup>
@@ -38,10 +39,5 @@
3839
<PackageReference Include="Polly" Version="7.2.0" />
3940
</ItemGroup>
4041

41-
<ItemGroup>
42-
<None Update="test.md">
43-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
44-
</None>
45-
</ItemGroup>
4642

4743
</Project>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /