2

I have an org document ~/foo.org

#+Title: testing htmlize
#+Date: <2015-08-21 Fri>

* Hello world

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  Donec hendrerit
tempor tellus.  Donec pretium posuere tellus.  Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus.  Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus.  Nulla posuere.  Donec vitae dolor.
Nullam tristique diam non turpis.  Cras placerat accumsan nulla.  Nullam rutrum.
Nam vestibulum accumsan nisl.

** Subsection

Mauris ac felis vel velit tristique imperdiet.  

| this   | is   | a      | table  |
|--------+------+--------+--------|
| albeit | not  | very   | useful |
| john   | paul | george | ringo  |

Issuing M-x htmlize-file <ret> ~/foo.org <ret> writes an html file ~/foo.org.html whose output looks like

#+Title: testing htmlize
#+Date: <2015-08-21 Fri>

* Hello world...

It appears that htmlize reads ~/foo.org in its collapsed form. Is it possible to get htmlize to read ~/foo.org in its entirety?

I'm currently issuing M-x htmlize-buffer followed by C-x C-w to write the complete html file but I'd like to do this with only one command.

1 Answer 1

2

Set the org-startup-folded variable to something like 'showall.

(setq org-startup-folded 'showall)

You can either change the value of this variable gloabally as above or set it in a let binding in a wrapper function that you write to do htmlize-file.

You can even choose to set the value of this variable local to the org file by using #+STARTUP: keyword.


On doing C-h v org-startup-folded, you get help on what values you can set it to and how to set it using #+STARTUP:.

org-startup-folded is a variable defined in `org.el'.
Its value is t

Documentation:
Non-nil means entering Org-mode will switch to OVERVIEW.
This can also be configured on a per-file basis by adding one of
the following lines anywhere in the buffer:

   #+STARTUP: fold              (or `overview', this is equivalent)
   #+STARTUP: nofold            (or `showall', this is equivalent)
   #+STARTUP: content
   #+STARTUP: showeverything
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.