1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

emacs26.1にしてorg-to-htmlしたらemacs-htmlizeを入れなさいって

Last updated at Posted at 2018-11-01

emacs26.1にしてorg-to-htmlしたら

Please install htmlize from https://github.com/hniksic/emacs-htmlize

とのお達し.

前からcode highlightingが効かんなって思ってたが..

https://github.com/hniksic/emacs-htmlize からhtmlize.elをDL(うまくいかんときはclone)して,~/.emacs.d/site_lispに入れて,

;; where I have htmlize.el                                                                                              
(add-to-list 'load-path "~/.emacs.d/site_lisp")
(require 'htmlize)

を(~/.emacs.d/init.elに)付け足したらできた.pathで悩むんや.emacs-lispはいつも...elpa行ったらないって怒られるし...

追記:batch <2019-10-07 月>

batchで書くとこのエラーが出たり,出んかったりする.

> "emacs #{org} --batch -f org-html-export-to-html --kill

–batchで呼ばれた時には,personal initialization filesをskipするらしい.pacakge-initializeをしなさいとのお達し.

を入れたら動いたけど,なんか他のエラーが出てる.

(require 'package)
(setq package-load-list '((htmlize t)))
(package-initialize)

なんかもいるかも.init.elは勉強せな.

つい追記:wsl対応<2024-09-30 月>

wslでexportするときに失敗.

html化が成功しているので,htmlize.elは入っていると思っていたが,M-x list-packagesで探しても見当たらず.本文の手法で入れるとsyntax-highlightして表示.

ただし,gitからのDLで今は,sshが使えなくて,Web-browserからDLするときは, htmlize.elに入ってcodeの右にあるDownload raw fileを選択.Folderを開いて,explorer間でcopy.


  • source ~/.emacs.d/htmlize.org
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?