Skip to content

Commit

Permalink
update instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
insula1701 committed Jan 28, 2018
1 parent bdd4c9c commit e9fcdbb
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 24 deletions.
9 changes: 4 additions & 5 deletions Quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

包括:


| 变量名 | 默认值 | 说明 |
| :----- | :----- | :---- |
|main_size |16px |正文主字号|
Expand All @@ -40,10 +41,8 @@

如果你希望覆盖默认样式中的个别样式,可以自主编写`custom.css`,它将在`default.css`之后被引入。

## 示例

[`example.md`](https://github.com/insula1701/maxpress/blob/master/temp/example.md) ->
[`example.html`](https://github.com/insula1701/maxpress/blob/master/result/html) (html请下载后在浏览器中打开)
## 示例&更多用法参考

公众号文章示例:[微信公众号MarkDown排版完全指南](https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&mid=2247483712&idx=1&sn=e8c2c8e9478045e335033b84f12be46e&chksm=ea8f8efcddf807ea61ce72618e0d89dd755635108cb898bbe1c103fcf2a4a029dc629e35b87b)
[《懒人福音: 怎样做一个从不排版的微信小编?》](https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&mid=2247483713&idx=1&sn=0ec80785ce60503eb30e4ce27ac89781&chksm=ea8f8efdddf807ebb5137b1f0d8c652bcaa33e861d2c0544b50aeed051361b904cf194f6f844)

[《微信公众号MarkDown排版完全指南》](https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&mid=2247483712&idx=1&sn=e8c2c8e9478045e335033b84f12be46e&chksm=ea8f8efcddf807ea61ce72618e0d89dd755635108cb898bbe1c103fcf2a4a029dc629e35b87b)
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# MaxPress:MarkDown+Python实现微信公众号一键排版

-------------
更新针对非技术人员的小白教程:

**【上篇:基本原理】**[《懒人福音: 怎样做一个从不排版的微信小编?》](https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&mid=2247483713&idx=1&sn=0ec80785ce60503eb30e4ce27ac89781&chksm=ea8f8efdddf807ebb5137b1f0d8c652bcaa33e861d2c0544b50aeed051361b904cf194f6f844)

**【下篇:语法指南】** [《微信公众号MarkDown排版完全指南》](https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&mid=2247483712&idx=1&sn=e8c2c8e9478045e335033b84f12be46e&chksm=ea8f8efcddf807ea61ce72618e0d89dd755635108cb898bbe1c103fcf2a4a029dc629e35b87b)

-------------

## 基本功能

1. 批量转换MarkDown文档为适合粘贴微信编辑器的HTML文件。
2. 支持自定义:正文字号、文字颜色(正文颜色、主题色、引用色)、行间距、段间距、标题水平对齐方式、内容两侧留白比例、底部图片。
3. 转换完成的MarkDown文档可以自动移动存档。

## 示例

[`example.md`](https://github.com/insula1701/maxpress/blob/master/temp/example.md) ->
[`example.html`](https://github.com/insula1701/maxpress/blob/master/result/html) (html请下载后在浏览器中打开)

公众号文章示例:[微信公众号MarkDown排版完全指南](https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&mid=2247483712&idx=1&sn=e8c2c8e9478045e335033b84f12be46e&chksm=ea8f8efcddf807ea61ce72618e0d89dd755635108cb898bbe1c103fcf2a4a029dc629e35b87b)

## 开始使用

建议直接使用Python脚本,如果你没有安装Python,可以使用编译好的可执行程序,支持Windows/Mac。
### 下载

[请在此处下载稳定版本。](https://github.com/insula1701/maxpress/releases)
[下载最新稳定版本:Windows版/Mac版](https://github.com/insula1701/maxpress/releases)

### 使用Windows/Mac版可执行程序

Expand All @@ -37,6 +39,7 @@
5. 默认进行自动存档,即转换完毕后将所有原始`.md`文件移动至`result/archive`目录下,可修改配置文件(auto_archive)禁用此功能。
6. 如果出现文件名冲突的情况,默认同文件名自动覆盖,可修改配置文件(auto_rename)改为进行自动重命名。


#### 格式调整

在运行转换程序之前,修改`config.json`文件,可自定义常用格式变量。
Expand All @@ -61,6 +64,13 @@

如果你希望覆盖默认样式中的个别样式,可以自主编写`custom.css`,它将在`default.css`之后被引入。

#### 示例

[`example.md`](https://github.com/insula1701/maxpress/blob/master/temp/example.md) ->
[`example.html`](https://github.com/insula1701/maxpress/blob/master/result/html) (html请下载后在浏览器中打开)

公众号文章示例:[微信公众号MarkDown排版完全指南](https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&mid=100000048&idx=1&sn=7bb0a7fd4cd92ed6b753e996e7eaf0ce&chksm=6a8f8e8c5df8079af7324b2505670d2abd0e83552873fcdaf7acf52ae8b25399380d60a5d778&mpshare=1&scene=1&srcid=1229tvTWQ1h4dDLJEYny9An8&key=dd3ea87ce1ad0714eaba7dea68d348c20f5b3fb8317e722240f1ef78c7894661ea5fdd718290986a650fdf3b2dd72762d7f4afd75e91ed2a0c7731a2a687388c964eb644526833a72f511f019b2ccb21&ascene=0&uin=MjE0NzM5NTU4MQ%3D%3D&devicetype=iMac+MacBookPro12%2C1+OSX+OSX+10.12.4+build(16E195)&version=12020810&nettype=WIFI&lang=zh_CN&fontScale=100&pass_ticket=6iRWB3aLBCQOXpS5n6I%2BNeH5AK3ygPJiPOMvcoNPo5bULSUy%2BHV4uZXOUJKw3n%2FK)

### 使用Python脚本【推荐】

如果你的计算机上装有Python环境,可以直接运行脚本。建议从Master分支获取最新稳定版本。
Expand Down Expand Up @@ -90,6 +100,11 @@ maxpress.convert_all(archive=True, styles=None)

带样式的列表粘贴到微信编辑器时,可能意外出现格式丢失的情况(貌似是微信的bug?),目前通过在每个`li`元素内额外添加一个`span`元素包装样式,暂时可以解决。但要注意,如果自定义样式的话,为`li span`所设置的字号、颜色等不能与上级元素完全一致,否则在粘贴到微信编辑器时会被自动去掉。

## 示例

[`example.md`](https://github.com/insula1701/maxpress/blob/master/temp/example.md) ->
[`example.html`](https://github.com/insula1701/maxpress/blob/master/result/html) (html请下载后在浏览器中打开)

## 后续开发计划

- [ ] 可选在文首自动添加引导关注Banner
Expand Down
16 changes: 8 additions & 8 deletions less/default.less
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
@main_margin: 3%;

@para_spacing: 1.5em;

@quote_color: #999;

@main_size: 16px;

@line_height: 1.8em;

@auto_archive: True;
@main_size: 16px;

@text_color: #555;

@theme_color: #3fa944;

@title_align: center;

@text_color: #555;
@para_spacing: 1.5em;

@auto_archive: True;

@main_margin: 3%;


// 运行时程序将根据本文件中定义的格式自动生成default.less
Expand Down
4 changes: 2 additions & 2 deletions result/html/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ <h3 style="font-size:18px; color:#3fa944; font-weight:bold; margin:1.5em 3%; tex
<h3 style="font-size:18px; color:#3fa944; font-weight:bold; margin:1.5em 3%; text-align:center" align="center">超链接</h3>
<p style="line-height:1.8em; margin:1.5em 3%"><strong style="color:#3fa944">注意:</strong>微信公众号目前仅支持公众号文章链接,如果你将带有其他超链接的文本插入了编辑器中,发送到手机之后,链接和链接的格式都会丢失。</p>
<p style="line-height:1.8em; margin:1.5em 3%">Markdown有多种引用链接的方式下面这种比较简单</p>
<pre style="line-height:1.7em; color:#999; background-color:white; font-size:14px; display:block" bgcolor="white"><code style="line-height:1.8em; color:#999; border:1px solid #ddd; border-radius:3px; display:block; padding:3px; white-space:pre; overflow:auto; font-size:14px; margin:auto 3%">[2016年让我相见恨晚的10本书](https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&amp;mid=2247483699&amp;idx=1&amp;sn=d5b3a4b14b39000bf7e32238bc15e0cb&amp;chksm=ea8f8e8fddf80799bad7c9fc6a85914d6e58a91842837bce99de30efe28462333b9ecfefa337)
<pre style="line-height:1.7em; color:#999; background-color:white; font-size:14px; display:block" bgcolor="white"><code style="line-height:1.8em; color:#999; border:1px solid #ddd; border-radius:3px; display:block; padding:3px; white-space:pre; overflow:auto; font-size:14px; margin:auto 3%">[2016年让我相见恨晚的10本书](https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&amp;mid=2247483711&amp;idx=1&amp;sn=471b4450db3d869ec755a2fd91430c14&amp;chksm=ea8f8e83ddf80795a2feca40417d78134c6359cf911cd36818378f5a1a0cd8098e9949bc0c76)
</code></pre>
<p style="line-height:1.8em; margin:1.5em 3%">显示效果</p>
<p style="line-height:1.8em; margin:1.5em 3%"><a href="https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&amp;mid=2247483699&amp;idx=1&amp;sn=d5b3a4b14b39000bf7e32238bc15e0cb&amp;chksm=ea8f8e8fddf80799bad7c9fc6a85914d6e58a91842837bce99de30efe28462333b9ecfefa337" style="color:#3fa944; text-decoration:none">2016年让我相见恨晚的10本书</a></p>
<p style="line-height:1.8em; margin:1.5em 3%"><a href="https://mp.weixin.qq.com/s?__biz=MzI2NjM5NDMyMw==&amp;mid=2247483711&amp;idx=1&amp;sn=471b4450db3d869ec755a2fd91430c14&amp;chksm=ea8f8e83ddf80795a2feca40417d78134c6359cf911cd36818378f5a1a0cd8098e9949bc0c76" style="color:#3fa944; text-decoration:none">2016年让我相见恨晚的10本书</a></p>
<h3 style="font-size:18px; color:#3fa944; font-weight:bold; margin:1.5em 3%; text-align:center" align="center">表格</h3>
<p style="line-height:1.8em; margin:1.5em 3%">由于手机屏幕较小难以控制表格的版式不建议在移动端使用表格</p>
<p style="line-height:1.8em; margin:1.5em 3%">以下是一个Markdown的写法示例第二行每列有几个<code style="line-height:1.8em; color:#999; border:1px solid #ddd; border-radius:3px; display:inline; padding:3px; white-space:pre-wrap; font-size:14px">-</code>和空格并不重要):</p>
Expand Down

0 comments on commit e9fcdbb

Please sign in to comment.