ofosos / ox-epub

Org mode epub export
GNU General Public License v3.0
93 stars 10 forks source link

keywords #4

Closed pank closed 7 years ago

pank commented 7 years ago

Hi,

It would seem that something like uid should be a keyword. So that I can write something like

 #+uid: 12345

in my org file. In fact, all of these should probably be proper keywords.

uid subject publisher rights manifest spine cover

I don't know what spine and manifest are. These should be added to org-export-define-derived-backend. See e.g. here.

ofosos commented 7 years ago

Spine is the order of included html files, while manifest is a list of files included in the epub.

I agree with you on this.

pank commented 7 years ago

Mark Meyer notifications@github.com writes:

Spine is the order of included html files, while manifest is a list of files included in the epub.

So I guess both ‘spine’ and ‘manifest’ could and should be deduced from the target Org file, right?

ofosos commented 7 years ago

With manifest yes, with spine not necessarily. With the current structure (multiple org files make one epub) you should be able to define the spine manually.

ofosos commented 7 years ago

Start this work, plan for tomorrow: org-epub-publish-finish extracts a lot of these values from the project plist, these are then passed as explicit named arguments to the subordinate functions. These should be left in a plist and the plist should be passed to the subordinate functions for them to extract it. This will slim down org-epub-publish-finish, getting us in the right direction.

pank commented 7 years ago

Right, basically all backend specific keywords should be moved to org-export-define-derived-backend.

So, you should have something like

;; See docstrig of `org-export-define-derived-backend'
(org-export-define-derived-backend 'koma-letter 'latex
  :options-alist
  ;; See docstring of `org-export-options-alist'
  '((:epub-uid "UID" nil nil t)
    ;; ...
    )
  :translate-alist
  '((template . org-epub-template))
  :menu-entry
  '(?E "Export to Epub"
       ((?e "As Epub file" org-epub-export-to-epub)
        (?O "As ODT file and open"
            (lambda (a s v b)
              (if a (org-odt-export-to-epub t s v)
                (org-open-file (org-odt-export-to-epub nil s v) 'system)))))))
ofosos commented 7 years ago

This should now work on master C-c C-e E e will export the current buffer to epub and place an appropriately named epub in your source folder. Please try it.

There's still some usage of file-base-name and such, hence the version bump to Emacs 24.3.

The publish functions are currently broken on master (no cache), I'll consider if I can get them in a working state tomorrow.

ofosos commented 7 years ago

From my point of view the keywords are now properly implemented. I will cross-check the available properties and their implementation and then document their function and syntax in README.org and close this bug.

ofosos commented 7 years ago

Clarified keyword syntax in docs.