update packages
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
;;; ox-org.el --- Org Back-End for Org Export Engine -*- lexical-binding: t; -*-
|
||||
;;; ox-org.el --- Org Backend for Org Export Engine -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2013-2023 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2013-2025 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nicolas Goaziou <n.goaziou@gmail.com>
|
||||
;; Maintainer: Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||
;; Keywords: org, wp
|
||||
;; Keywords: org, text
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
@@ -54,6 +53,20 @@ setting of `org-html-htmlize-output-type' is `css'."
|
||||
(const :tag "Don't include external stylesheet link" nil)
|
||||
(string :tag "URL or local href")))
|
||||
|
||||
(defcustom org-org-with-special-rows t
|
||||
"Non-nil means export special table rows.
|
||||
Special rows are the rows containing special marking characters, as
|
||||
described in the Info node `(org)Advanced features'."
|
||||
:group 'org-export-org
|
||||
:type 'boolean
|
||||
:package-version '(Org . "9.7"))
|
||||
|
||||
(defcustom org-org-with-cite-processors nil
|
||||
"Non-nil means use citation processors when exporting citations."
|
||||
:group 'org-export-org
|
||||
:type 'boolean
|
||||
:package-version '(Org . "9.7"))
|
||||
|
||||
(org-export-define-backend 'org
|
||||
'((babel-call . org-org-identity)
|
||||
(bold . org-org-identity)
|
||||
@@ -75,6 +88,8 @@ setting of `org-html-htmlize-output-type' is `css'."
|
||||
(inline-src-block . org-org-identity)
|
||||
(inlinetask . org-org-identity)
|
||||
(italic . org-org-identity)
|
||||
(citation . org-org-identity)
|
||||
(citation-reference . org-org-identity)
|
||||
(item . org-org-identity)
|
||||
(keyword . org-org-keyword)
|
||||
(latex-environment . org-org-identity)
|
||||
@@ -112,7 +127,11 @@ setting of `org-html-htmlize-output-type' is `css'."
|
||||
(lambda (a s v b)
|
||||
(if a (org-org-export-to-org t s v b)
|
||||
(org-open-file (org-org-export-to-org nil s v b)))))))
|
||||
:filters-alist '((:filter-parse-tree . org-org--add-missing-sections)))
|
||||
:filters-alist '((:filter-parse-tree . org-org--add-missing-sections))
|
||||
:options-alist
|
||||
;; Export special table rows.
|
||||
'((:with-special-rows nil nil org-org-with-special-rows)
|
||||
(:with-cite-processors nil nil org-org-with-cite-processors)))
|
||||
|
||||
(defun org-org--add-missing-sections (tree _backend _info)
|
||||
"Ensure each headline has an associated section.
|
||||
@@ -129,7 +148,7 @@ we make sure it is always called."
|
||||
(new-section (org-element-create 'section)))
|
||||
(pcase (org-element-type first-child)
|
||||
(`section nil)
|
||||
(`nil (org-element-adopt-elements h new-section))
|
||||
(`nil (org-element-adopt h new-section))
|
||||
(_ (org-element-insert-before new-section first-child))))))
|
||||
tree)
|
||||
|
||||
@@ -226,7 +245,7 @@ a communication channel."
|
||||
;; them are included in the result.
|
||||
(let ((footnotes
|
||||
(org-element-map
|
||||
(list (org-export-get-parent-headline section) section)
|
||||
(list (or (org-element-lineage section 'headline) "") section)
|
||||
'footnote-reference
|
||||
(lambda (fn)
|
||||
(and (eq (org-element-property :type fn) 'standard)
|
||||
@@ -320,17 +339,14 @@ publishing directory.
|
||||
Return output file name."
|
||||
(org-publish-org-to 'org filename ".org" plist pub-dir)
|
||||
(when (plist-get plist :htmlized-source)
|
||||
(or (require 'htmlize nil t)
|
||||
(error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
|
||||
(org-require-package 'htmlize)
|
||||
(require 'ox-html)
|
||||
(let* ((org-inhibit-startup t)
|
||||
(htmlize-output-type 'css)
|
||||
(html-ext (concat "." (or (plist-get plist :html-extension)
|
||||
org-html-extension "html")))
|
||||
(visitingp (find-buffer-visiting filename))
|
||||
(work-buffer (or visitingp (find-file-noselect filename)))
|
||||
newbuf)
|
||||
(with-current-buffer work-buffer
|
||||
(org-with-file-buffer filename
|
||||
(font-lock-ensure)
|
||||
(org-fold-show-all)
|
||||
(setq newbuf (htmlize-buffer)))
|
||||
@@ -338,17 +354,14 @@ Return output file name."
|
||||
(when org-org-htmlized-css-url
|
||||
(goto-char (point-min))
|
||||
(and (re-search-forward
|
||||
"<style type=\"text/css\">[^\000]*?\n[ \t]*</style>.*" nil t)
|
||||
"<style type=\"text/css\">\\(?:.\\|\n\\)*?\n[ \t]*</style>.*" nil t)
|
||||
(replace-match
|
||||
(format
|
||||
"<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">"
|
||||
org-org-htmlized-css-url)
|
||||
t t)))
|
||||
(write-file (concat pub-dir (file-name-nondirectory filename) html-ext)))
|
||||
(kill-buffer newbuf)
|
||||
(unless visitingp (kill-buffer work-buffer)))
|
||||
;; FIXME: Why? Which buffer is this supposed to apply to?
|
||||
(set-buffer-modified-p nil)))
|
||||
(kill-buffer newbuf))))
|
||||
|
||||
|
||||
(provide 'ox-org)
|
||||
|
||||
Reference in New Issue
Block a user