I'd like my exports to go into a specific directory. Right now everything is output in the same path as the source file.
There's a very old post with sample code that seems get me part way there:
(defun org-export-output-file-name-modified (orig-fun extension &optional subtreep pub-dir)
(unless pub-dir
(setq pub-dir "exported-org-files")
(unless (file-directory-p pub-dir)
(make-directory pub-dir)))
(apply orig-fun extension subtreep pub-dir nil))
(advice-add 'org-export-output-file-name :around #'org-export-output-file-name-modified)
However HTML exports don't include images, either static ones or inserted via PlantUML. Latex/PDF export works fine though.
Is there a better option?
Edit:
I tried the following org-export code:
(require 'ox-publish)
(setq org-publish-project-alist
'(("org-notes"
:base-directory "~/Dropbox/orgmode/"
:publishing-directory "~/export"
:publishing-function org-html-publish-to-html
)
("org-static"
:base-extension "png"
:base-directory "~/Dropbox/orgmode/"
:publishing-directory "~/export"
:publishing-function org-publish-attachment
)
("org" :components ("org-notes" "org-static"))
)
)
The images are not being moved to ~/export
though.
Edit 2:
Apologies for the paths; I fixed them now. So the issue seems to be Babel and plantuml. I have the following org-file:
#+title: org-export-test
* Meta :noexport:
Meta section. We don't expect to see it exported due to the ~noexport~ tag.
* Intro
This is an intro section.
* Plantuml section
What we store.
#+begin_src plantuml :file plantuml_dirgram.png
@startuml
hide circle
skinparam linetype ortho
entity "Table" as EventLog {
id : number <<generated>>
--
}
@enduml
#+end_src
The PlantUML section contains a directive to output to plantuml_diagram.png
in the same path as the org file.
However when I run org-publish-current-file
, the HTML file is generated, but the png
is not. If I generate the png file manually into ~/Dropbox/orgmode
, it's still not copied into ~/export
.
publishing
is essentiallyexporting + moving files to a publishing directory
- you have to write a (for simple cases, small) config file (there is an example in the manual) but it works very well.org-publish
functionality, but still no luck. I don't see any errors or anything useful in Messages.toggle-debug-on-error
is set as well.~/export
? You mean~/Library/Mobile Documents/iCloud~com~appsonthemove~beorg/Documents/org-roam/export
?