reddit / emacs

Q: Publish org files based on recursive links

shortichon · 2022-12-13 17:54
Hi, I would like to share a subset of my org notes to co-workers by exporting them in html files that are linked together, with one entrypoint which is an org note that I manage to keep up to date with the project state. But I have hundreds of org notes, all in the same directory, so I can't juste use the org-publish `:recursive t` option. What I would like is an option to specify one (or many) org-files to be included and then that the export process follow all links inside the given files (currently org-roam links) and try to included those linked files too. Is something like this already exist ? (I've search but not found anything relevant to my need) And if not, what should be my firsts steps to make it work as I wish (I'm fairly new to org publish process). Thanks !
AndreaSomePostfix · 2022-12-13 22:34
I don't use this but maybe org-publish already has a solution for you: check the docs for org-publish-project-alist "The :exclude property may be used to prevent certain files from being published. Its value may be a string or regexp matching file names you don't want to be published. "
shortichon · 2022-12-14 10:50
Thanks for the idea, but in fact I've already tried this `:exclude` tag in combination with `:include ["my_index_org_file.org"]`. It succeed to export only my 'index' file an not the whole directory, but now what I would like is the export process to recursively follow each link in this file and to export them as well.
hkjels · 2022-12-14 19:54
Just remove the include
shortichon · 2022-12-14 20:57
I've tried but as expected if I have `:exclude "*"` (because I don't want to export at least 90% of my org-notes) and I remove `:include` nothing is exported with the org-publish-project (or -all or -file). Currently my config look likes : ```lisp (push '("org-ap" :base-directory "~/Documents/org/roam" :base-extension "org" :publishing-directory "~/Documents/Atelier Paysan/export_html" :publishing-function org-html-publish-to-html :recursive nil :exclude ".*" :headline-level 10 :auto-preamble t :auto-index t ;:index-filename "20220209111729-la_bete_gestion_du_projet_porte_d_entree.org" ;:include ["20220209111729-la_bete_gestion_du_projet_porte_d_entree.org"] ) ```
hkjels · 2022-12-15 09:32
Publish don’t care about what you have included in each document, that’s just used for linking. You’ll have to employ some pattern for the files you want to exclude I believe