Arch Linux 使用markdown

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
# 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 : 并用浏览器查看

转载于:https://www.cnblogs.com/elmaple/p/4621228.html

你可能感兴趣的:(Arch Linux 使用markdown)