Skip to content

Instantly share code, notes, and snippets.

View illy's full-sized avatar
💭
I may be slow to respond.

illy

💭
I may be slow to respond.
View GitHub Profile

前陣子一直打算謝謝markdown寫作,拖到現在被這位老兄搶了先,很不錯的介紹文章:[为什么Markdown+R有较大概率成为科技写作主流?](http://www.douban.com/note/220903450/).所以我就不再重複了,此文打算用問答的形式介紹下markdown對於文科寫作的意義[^ft]。

###1. 什麼是markdown?

markdown是一種輕量化的標記語言。大家所熟知的標記語言還有latex,lyx, XML,HTML,這類文本的特點就是你在編輯時可以使用各種tag來控制文本的格式。話說回來,mac下的pages,M$的docx也都時XML文檔,只是你在編輯的時候,不需要加入tag,軟件本身替你增加tag了。

這類語言最大的好處就是在編輯時,你可以很大程度的減少格式對於文本的干擾。你想啊,打開一個word文檔,你調個文字大小,設置個 加粗,二號標題,再來個 斜體 什麼的, 時間大半過去了。而標記語言的最大優勢在於,你只要使用系統能夠識別的tag就可以非常方便地控制這些格式。比如markdown,你可以先使用系統默認的那些tag來寫作,等到最後輸出的時候,配置下css模版即可。

markdown是各種標記語言中的小兄弟,一來是因為它年輕,二來因為它非常輕量化。md是 John GruberAaron Swartz 最初發明的,廣泛用於技術文檔的寫作。它的最大優勢在於人機皆可讀 (machine-readble, human-readble)。

@illy
illy / uob_phd_pdf.txt
Created April 20, 2012 13:56
This is a brief statistics of UoB PhD dissertation PDF software usage.
AbuAisheh_PhD_2011.html:6:<meta name="Creator" content="PScript5.dll Version 5.2.2">
Abuelela_10_PhD.html:6:<meta name="Creator" content="TeX">
Abuissa09PhD.html:5:<meta name="Creator" content="Acrobat PDFMaker 6.0 for Word">
Acceleration_of_the_DEM_on_a_Reconfigurable_Co-Processor_2003.html:4:<meta name="Creator" content="Acrobat PDFMaker 5.0 for Word">
Adams09PhD.html:6:<meta name="Creator" content="PScript5.dll Version 5.2.2">
Adkins_10_PhD.html:6:<meta name="Creator" content="MicrosoftÆ Office Word 2007">
Ahall_11_PhD.html:6:<meta name="Creator" content="MicrosoftÆ Office Word 2007">
Ahasan07PhD.html:5:<meta name="Creator" content="Acrobat PDFMaker 7.0.7 for Word">
Ahmad10PhD.html:6:<meta name="Creator" content="PScript5.dll Version 5.2">
Ahmad11PhD_A1a.html:6:<meta name="Creator" content="MicrosoftÆ Office Word 2007">
@illy
illy / uob phd pdf convertion log original
Created February 23, 2012 03:59
uob phd pdf convertion log
501 Syntax Error: Unknown character collection 'Adobe-Korea1'
498 Syntax Error: Unknown CMap 'KSCms-UHC-H' for character collection 'Adobe-Korea1'
498 Syntax Error: Couldn't find 'KSCms-UHC-H' CMap file for 'Adobe-Korea1' collection
422 Syntax Error: Unknown font tag 'C2_0'
208 Syntax Error: Unknown character collection 'Adobe-Japan1'
180 Syntax Error: Unknown font tag 'C0_0'
33 Syntax Error: Unknown font tag 'C2_2'
26 Syntax Warning: Bad annotation destination
15 Syntax Error: Unknown font tag 'C2_1'
11 Syntax Error: Unknown character collection 'Adobe-GB1'
@illy
illy / UoB PhD project scripts.md
Created February 22, 2012 22:07
This file records the scripts used in the UoB PhD project.

#The Script of Data Preparation for the University of Birmingham PhD Dissertation Corpus Project

Sheng Li University of Birmingham

This file records the scripts used in the UoB PhD corpus project, hoping to provide some clues for the future projects.

All scripts here are basic shell scripts, which are consisted of different GNU tools, such as pdftotext.

Notice, if you want to run pdftotext on your own machine, you might install xpdf first. On OS X, you can use [homebrew]https://github.com/mxcl/homebrew, [macports]http://www.macports.org/ or [gentoo prefix]http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml to install this tool automatically, or compile the install package manually. On Debian platform, you can simply type

@illy
illy / moin2gitit.rb
Created February 21, 2012 21:07 — forked from eungju/moin2gitit.rb
Copy pages from MoinMoin to gitit
#!/usr/bin/env ruby
require 'fileutils'
if ARGV.length != 2
puts "Usages: #{$0} <moin pages directory> <gitit wikidata directory>"
exit 1
end
from_dir = File.expand_path ARGV[0]
@illy
illy / gist:1868428
Created February 20, 2012 08:30 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@illy
illy / Get sed savvy – part 1.md
Created February 20, 2012 08:22
Chinese Translation of Get sed savvy

#Get sed savvy – part 1#

Original post

今天我將繼續介紹命令行工具,主題是sed。(Stream EDitor)是目前介紹過最複雜的工具,它自成一體。把他們放在一篇裡面會太擁擠,所以我會分開介紹。

sed的精華是檢索和替換,所以我們將從這裡開始,然後延伸到其他。

##教程##

Thank Eric Wendelins very much, because he agreed me to translate and republish his posts.

Yes, you may translate any of my articles and post them. Attribution would be appreciated, but not required.

Thanks a lot!

Cheers,
Eric

@illy
illy / grep is a beautiful tool.md
Created February 13, 2012 23:39
Chinese translation of grep is a beautiful tool

#grep is a beautiful tool#

Global Regular Expression Print (Grep)大概是每個命令行用戶的必備工具吧?如同find命令一般,將它與其他命令結合起來使用,將大大提高你的效率。

以下這個簡要的教程將幫助你認識到Grep的簡潔和厲害。如果你在Windows平台上,請下載Crywin;如果你剛開始使用正則式,這兒有一個不錯的正則式教程。

##教程##

假設我們希望在JavaScript文件中搜索重複的標籤。讓我們來看看怎麼利用基本的grep來實現。這一技巧可以幫助你搜索無數的重複項,如下:

Thank Eric Wendelins very much, because he agreed me to translate and republish his posts.

Yes, you may translate any of my articles and post them. Attribution would be appreciated, but not required.

Thanks a lot!

Cheers,
Eric

原文由Eric Wendelins所著:Effective bash shorthand