Skip to content

Commit

Permalink
Merge pull request #77 from nanzhong/body-only
Browse files Browse the repository at this point in the history
refactor: make use of org export body-only argument
  • Loading branch information
nanzhong authored Jul 4, 2024
2 parents 69bbd0f + fb7bc45 commit 3aba7d1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions weblorg.el
Original file line number Diff line number Diff line change
Expand Up @@ -1031,11 +1031,6 @@ from the file, like TITLE, OPTIONS etc. The generated HTML will
be added ad an entry to the returned assoc. Optionally, provide
an INPUT-PATH to resolve relative links and INCLUDES from."
(let (html keywords)
;; Replace the HTML generation code to prevent ox-html from adding
;; headers and stuff around the HTML generated for the `body` tag.
(advice-add
#'org-html-template :override
(lambda(contents _i) (setq html contents)))
;; Watch collection of keywords, which are file-level properties,
;; like #+TITLE, #+FILETAGS, etc.
(advice-add
Expand Down Expand Up @@ -1066,9 +1061,8 @@ an INPUT-PATH to resolve relative links and INCLUDES from."
(with-temp-buffer
(insert input-data)
(if input-path (set-visited-file-name input-path t t))
(org-html-export-as-html))
(setq html (org-export-as 'html nil nil t)))
;; Uninstall advices
(ad-unadvise 'org-html-template)
(ad-unadvise 'org-html-keyword)
(ad-unadvise 'org-html-headline)
;; Add the generated HTML as a property to the collected keywords
Expand Down

0 comments on commit 3aba7d1

Please sign in to comment.