-
Notifications
You must be signed in to change notification settings - Fork 1
/
mweb-v1.2-release-zh.html
655 lines (429 loc) · 18.3 KB
/
mweb-v1.2-release-zh.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>
MWeb 1.2 版更新说明和用 wkhtmltopdf 生成带目录的 PDF 和自定预览 CSS - Coder For Art
</title>
<link href="atom.xml" rel="alternate" title="Coder For Art" type="application/atom+xml">
<link rel="stylesheet" href="asset/css/foundation.min.css" />
<link rel="stylesheet" href="asset/css/docs.css" />
<script src="asset/js/vendor/modernizr.js"></script>
<script src="asset/js/vendor/jquery.js"></script>
<script type="text/javascript">
function before_search(){
var searchVal = 'site:coderforart.com ' + document.getElementById('search_input').value;
document.getElementById('search_q').value = searchVal;
return true;
}
</script>
</head>
<body class="antialiased hide-extras">
<div class="marketing off-canvas-wrap" data-offcanvas>
<div class="inner-wrap">
<nav class="top-bar docs-bar hide-for-small" data-topbar>
<section class="top-bar-section">
<div class="row">
<div style="position: relative;width:100%;"><div style="position: absolute; width:100%;">
<ul id="main-menu" class="left">
<li id="menu_item_index"><a target="_self" href="index.html">Home</a></li>
<li id="menu_item_archives"><a target="_self" href="archives.html">Archives</a></li>
<li id="menu_item_about"><a target="_self" href="about.html">About</a></li>
</ul>
<ul class="right" id="search-wrap">
<li>
<form target="_blank" onsubmit="return before_search();" action="https://google.com/search" method="get">
<input type="hidden" id="search_q" name="q" value="" />
<input tabindex="1" type="search" id="search_input" placeholder="Search"/>
</form>
</li>
</ul>
</div></div>
</div>
</section>
</nav>
<nav class="tab-bar show-for-small">
<a href="javascript:void(0)" class="left-off-canvas-toggle menu-icon">
<span> Coder For Art</span>
</a>
</nav>
<aside class="left-off-canvas-menu">
<ul class="off-canvas-list">
<li><a target="_self" href="index.html">Home</a></li>
<li><a target="_self" href="archives.html">Archives</a></li>
<li><a target="_self" href="about.html">About</a></li>
<li><label>Categories</label></li>
<li><a href="Cocoa.html">Cocoa</a></li>
<li><a href="CG%20Artist.html">CG Artist</a></li>
<li><a href="Game%20Engine.html">Game Engine</a></li>
<li><a href="MWeb-cat.html">MWeb</a></li>
<li><a href="PinPhoto-cat.html">PinPhoto</a></li>
</ul>
</aside>
<a class="exit-off-canvas" href="#"></a>
<section id="main-content" role="main" class="scroll-container">
<script type="text/javascript">
$(function(){
$('#menu_item_index').addClass('is_active');
});
</script>
<div class="row">
<div class="large-8 medium-8 columns">
<div class="markdown-body article-wrap">
<div class="article">
<h1>MWeb 1.2 版更新说明和用 wkhtmltopdf 生成带目录的 PDF 和自定预览 CSS</h1>
<div class="read-more clearfix">
<span class="date">2015/02/08</span>
<span>posted in </span>
<span class="posted-in"><a href='MWeb-cat.html'>MWeb</a></span>
<span class="posted-in"><a href='Introduction.html'>Introduction</a></span>
<span class="comments">
<a href="http://coderforart.com/mweb-v1.2-release-zh.html#disqus_thread">comments</a>
</span>
</div>
</div><!-- article -->
<div class="article-content">
<h2 id="toc_0">新增</h2>
<ul>
<li>可选择在输入时是否自动插入列表编号,可以在 Preferences --> General --> Auto insert list and blockquote prefix 开启和关闭。</li>
<li>分享功能的 Copy as image、Save as image、Save as PDF 等现在统一都用HTML的样式了,另外还专门为分享到微薄等SNS生成的图片做了优化,比如说如果有代码,会强制换行。</li>
<li>新增把文档库里的单个或多个文档导出为HTML或者PDF。使用方法为:选择要导出的文档(可多选) --> 鼠标右键 --> Export as HTML、PDF</li>
<li>新增把整个分类导出为HTML或者PDF。使用方法为:右键要导出的分类 --> Export as HTML、PDF。导出的PDF现在还没办法自动生成目录,下边的详细介绍会分享一个可以自动生成目录的方法,然后个人觉得生成的PDF非常好。</li>
<li>新增MWeb自带的两个主题octopress、greyshade的即时预览CSS。现在可以不用 Build site 就可以即时预览文章的大概效果了。另外自定网站的预览CSS非常简单,请看下边的详细介绍。</li>
<li>新增可以拖拽改变文档的顺序。使用方法为:鼠标右键父分类 --> Edit --> 把Order by设定为:Custom --> 然后就可以用拖拽调节这个父分类下的文档顺序了。</li>
<li>新增可以拖拽改变分类的顺序。</li>
</ul>
<span id="more"></span><!-- more -->
<h2 id="toc_1">修正</h2>
<ul>
<li>Build site 闪退问题,这也是这次版本发布的原因。</li>
<li>Preview site 无效果问题。</li>
<li>编辑器小修正。</li>
</ul>
<h2 id="toc_2">生成带目录的PDF的方法</h2>
<p>先安装wkhtmltopdf,网址:<a href="http://wkhtmltopdf.org/">http://wkhtmltopdf.org/</a>。<br/>
然后用Export as HTML把要生成带目录的PDF的内容导出为HTML。我这里是选择整个Coder For Art网站。如图是导出到tocPDF文件夹下的情况。<br/>
<img src="media/14233888581377/14233994590970.jpg" alt=""/></p>
<p>选择tocPDF文件夹,并<code>CMD+C</code>复制,打开终端工具(Terminal),打<code>cd</code> (注意cd后带一空格),然后<code>CMD+V</code>,再 Enter。<br/>
然后再执行以下命令</p>
<pre><code class="language-text">wkhtmltopdf toc index.html CoderForArt.pdf
</code></pre>
<p>执行结果生成的PDF如图:<br/>
<img src="media/14233888581377/14233999928601.jpg" alt=""/></p>
<p>一般情况下有代码的地方如果过长会被切掉,可以加入以下CSS</p>
<pre><code class="language-css">.hljs{overflow: visible; word-wrap: break-word;}
</code></pre>
<p>就不会被切了。如图:<br/>
<img src="media/14233888581377/14234006629706.jpg" alt=""/></p>
<h2 id="toc_3">自定预览CSS</h2>
<p>把要自定的预览的网站的主题整个文件夹复制到预览CSS文件夹的layout文件夹下,如图是我要自定greyshade主题的预览CSS:</p>
<p><img src="media/14233888581377/14233974412288.jpg" alt=""/></p>
<p>然后只留下layout/greyshade文件夹下的asset文件夹和随便两个.html文件,其他都删除。把留下的两个.html文件分别改名为:demo.html和index.html。</p>
<p>使用Build site --> Preview site --> 转到任何一个单独的文章页面 --> 查看原代码 --> 复制并把它粘贴到demo.html上。现在你可以直接打开demo.html看效果了。调整demo.html到合适的预览效果时,再把demo.html的所有内容粘贴到index.html上。</p>
<p>把index.html页的标题都用<code>{{title}}</code>替换,内容用<code>{{content}}</code>替换,并在<code><head></head></code>之间加上<code>{{head}}</code>,一般加在<code></head></code>前面即可。</p>
<p>如图,在预览CSS的文件夹里新增一个名为greyshade.css的内容为空的文件即可。<br/>
<img src="media/14233888581377/14233984379844.jpg" alt=""/></p>
<p>要注意的是:greyshade.css的文件名greyshade和layout文件夹下的greyshade文件夹的名称是一样的。然后如果你引用的CSS加有<code>media="screen, projection"</code>这样的限定,请删除,不然MWeb在导出PDF功能上会没有样式。还有如果你在用highlightjs这个代码高亮插件,导出PDF或者生成图片时,代码被切掉的话,可以用以下CSS强制换行:</p>
<pre><code class="language-css">.hljs{overflow: visible; word-wrap: break-word;}
</code></pre>
</div>
<div class="row">
<div class="large-6 columns">
<p class="text-left" style="padding:15px 0px;">
<a href="mweb-v1.2-release.html"
title="Previous Post: MWeb 1.2 release">« MWeb 1.2 release</a>
</p>
</div>
<div class="large-6 columns">
<p class="text-right" style="padding:15px 0px;">
<a href="aliyun-net-cn-free-web-host-express.html"
title="Next Post: 万网(阿里云)免费虚拟主机体验">万网(阿里云)免费虚拟主机体验 »</a>
</p>
</div>
</div>
<div class="comments-wrap">
<div class="share-comments">
<div id="disqus_thread"></div>
</div>
</div>
</div><!-- article-wrap -->
</div><!-- large 8 -->
<div class="large-4 medium-4 columns">
<div class="hide-for-small">
<div id="sidebar" class="sidebar">
<div id="site-info" class="site-info">
<div class="site-a-logo"><img src="media/14195170907881/icon.jpg" /></div>
<h1>Coder For Art</h1>
<div class="site-des">I'm an indie Mac/iOS developer, also want to be a CG artist</div>
<div class="social">
<a target="_blank" class="weibo" href="http://weibo.com/oulvhai" title="weibo">Weibo</a>
<a target="_blank" class="twitter" target="_blank" href="http://twitter.com/oulvhai" title="Twitter">Twitter</a>
<a target="_blank" class="github" target="_blank" href="https://github.com/oulvhai" title="GitHub">GitHub</a>
<a target="_blank" class="rss" href="atom.xml" title="RSS">RSS</a>
</div>
</div>
<div id="site-categories" class="side-item ">
<div class="side-header">
<h2>Important</h2>
</div>
<div class="side-content">
<div style="color:#ff0000; text-align:center; padding:8px;" class="bg-info site_notice">
<a style="color:#ff0000;" onclick="ga('send','event','global_notice_click');" href="https://zh.mweb.im/mweb3x-release-note.html" >MWeb 3 发布后 2.x 版维护说明及两者之间的功能对比!</a>
</div>
</div>
</div>
<div id="site-categories" class="side-item ">
<div class="side-header">
<h2>Categories</h2>
</div>
<div class="side-content">
<p class="cat-list">
<a href="Cocoa.html"><strong>Cocoa</strong></a>
<a href="CG%20Artist.html"><strong>CG Artist</strong></a>
<a href="Game%20Engine.html"><strong>Game Engine</strong></a>
<a href="MWeb-cat.html"><strong>MWeb</strong></a>
<a href="PinPhoto-cat.html"><strong>PinPhoto</strong></a>
</p>
</div>
</div>
<div id="site-categories" class="side-item">
<div class="side-header">
<h2>Recent Posts</h2>
</div>
<div class="side-content">
<ul class="posts-list">
<li class="post">
<a href="mweb3-release-note.html">MWeb 3.0 测试版更新情况</a>
</li>
<li class="post">
<a href="mweb3.0-on-test.html">MWeb 3.0 测试版终于发布了!欢迎大家试用!</a>
</li>
<li class="post">
<a href="15113184658847.html">MWeb for Mac, iOS 黑五半价促销一周,写个大概介绍。</a>
</li>
<li class="post">
<a href="mweb-ios-2.3.2-release.html">MWeb for iOS 2.3.2 发布!</a>
</li>
<li class="post">
<a href="how_to_use_images_in_mweb.html">MWeb Mac 版和 iOS 版图片及图床使用完全指南</a>
</li>
</ul>
</div>
</div>
</div><!-- sidebar -->
</div><!-- hide for small -->
</div><!-- large 4 -->
</div><!-- row -->
<div class="page-bottom clearfix">
<div class="row">
<p class="copyright">Copyright © 2015
Powered by <a target="_blank" href="http://www.mweb.im">MWeb</a>,
Theme used <a target="_blank" href="http://github.com">GitHub CSS</a>.</p>
</div>
</div>
</section>
</div>
</div>
<script src="asset/prism.js"></script>
<style type="text/css">
figure{margin: 0;padding: 0;}
figcaption{text-align:center;}
/* PrismJS 1.14.0
http://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background:#b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #F7F7F7;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre[class*="language-"].line-numbers > code {
position: relative;
white-space: inherit;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
</style>
<script type="text/javascript">
var disqus_shortname = 'coderforart';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<script type="text/javascript">
var disqus_shortname = 'coderforart';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<script src="asset/js/foundation.min.js"></script>
<script>
$(document).foundation();
function fixSidebarHeight(){
var w1 = $('.markdown-body').height();
var w2 = $('#sidebar').height();
if (w1 > w2) { $('#sidebar').height(w1); };
}
$(function(){
fixSidebarHeight();
})
$(window).load(function(){
fixSidebarHeight();
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-58735702-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>