您的位置:首页 > 运维架构 > Linux

Arch Linux 使用markdown

2015-07-04 20:49 831 查看

Arch Linux 使用markdown

pandoc 文档格式转换

pygments 代码高亮

markdown-mode.el 配置emacs

pandoc


号称文件格式转换的瑞士军刀,这里主要是用来把marddown文件转换成html。

Arch需要安装haskell-pandoc,arch.2015.07的标准库里没有haskell-doc, AUR里的haskell-pandoc有依赖问题,安装失败。

到pandoc的官网看一下能不能源码安装,根据安装指示到了ArchHaskell-wiki

haskell-core

haskell-happstack

# edit /etc/pacman.conf to add repository
[haskell-core]
Server = http://orbitalfox.com/haskell/core/$arch [haskell-happstack]
Server = http://noaxiom.org/$repo/$arch[/code] 
# Add Magnus Therning's key of haskell-core
pacman-key -r 4209170B
pacman-key --lsign-key 4209170B
# Add Magnus Therning's key of haskell-happstack
pacman-key -r B0544167
pacman-key --lsign-key B0544167
# refresh package list and install pandoc
pacman -Syu
pacman -S haskell-pandoc


pygments

# install pygements
pacman -S python-pygments


markdown-mode

yaourt -S emacs-goodies-el

;; edit ~/.emacs
(add-to-list 'load-path "emacs-goodies-el")
(autoload 'markdown-mode "markdown-mode.el" "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.markdown\\'". markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'". markdown-mode))
(custom-set-variables
'(markdown-command "pandoc -f markdown -t html -s --mathml --highlight-style pygments"))

markdown-mode 快捷键

C-c C-t $nu
: Title 插入标题1...6

C-c C-s e
: Style emphasis,斜体

C-c C-s s
: Style strong,加粗

C-c C-c e
: Control 保存html

C-c C-c v
: 保存html,并用浏览器查看

C-c C-c p
: 并用浏览器查看
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: