With just the few lines in a file file.adoc
////
-*-iimage-mode-*-
////
.A PNG smiley
image::smiley.png[]
I can generate HTML using asciidoctor
and MS-word .doc
using pandoc
.
This toolchain doesn't handle SVG, and so it's not perfect, but it works well, and
it's free.
file.html
There is a snag though:
I'd like iimage-mode
to be enabled when I load file.adoc
. My attempt (the first three lines in the source above) doesn't work. Can you think of a way that will?
.emacs
(set-foreground-color "white")
(set-background-color "black")
(require 'adoc-mode)
(setq auto-mode-alist (cons '("\\.adoc\\'" . adoc-mode) auto-mode-alist))
Comments
I am writing these comments here to be able to typeset.
Asciidoctor (I'm using to the superior implementation of the asciidoc syntax written in Ruby) does have (now?) line comments in addition to block comments.
Using
// -- mode: iimage --
on the first line works (thanks, Nick). But it replaces the adoc major mode (thanks, phils).
- Adding at the bottom of the file:
//// Local Variables:
eval: (iimage-mode 1)
End:
////
switches to minor mode iimage while the major mode remains adoc.
- phils's suggestion to use
my-adoc-mode-hook
works well.
I'm forking the second part to a separate question. This discussion is already long enough for one question.
Update
Using asciidoctor + pandoc may produce a .doc
file that is handled correctly with a recent version of MS-Word. Comments welcome. MS-Word 2011 on OS X opens the resulting .doc
file fine, but shows an error message in the place of SVG images.
If this works, it will (finally) be a way to send a .doc
file to all those people who insist on them, while editing in an environment as flexible as Emacs.