I have an org-mode project with many small org files that I'd like to export to HTML. I have not set #+TITLE
in many files as they do not have proper titles. I find on export that the partial first sentence is exported as the document's title.
For instance, an org document like so:
This is a short file.
Mary had a little lamb, etc.
Will be exported to have the following HTML:
*snip*
<div id="content">
<h1 class="title">This is a short file.</h1>
<p>Mary had a little lamb, etc.</p>
*snip*
I would prefer to see both sentences in the above file be marked as paragraphs. How can I disable the automatic divination of titles?
To avoid the first line becoming the title you can set an empty title:
#+Title:
This is a short file.
Mary had a little lamb, etc.
If you take a look on the code of org-export-region-as-html
you will see the following fragment
(title (or (and subtree-p (org-export-get-title-from-subtree))
(plist-get opt-plist :title)
(and (not
(plist-get opt-plist :skip-before-1st-heading))
(org-export-grab-title-from-buffer))
(and buffer-file-name
(file-name-sans-extension
(file-name-nondirectory buffer-file-name)))
"UNTITLED"))
A function org-export-grab-title-from-buffer
is called if no title is defined. You can disable this function by advising it
(defadvice org-export-grab-title-from-buffer (around org-export-grab-title-from-buffer-disable activate))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With