diff --git a/manual.html b/manual.html index 89a7bc4..df61fee 100644 --- a/manual.html +++ b/manual.html @@ -125,8 +125,6 @@ General Public License for more details.
— The Detailed Node Listing — @@ -295,6 +293,18 @@ FAQ
+ +How do I publish my notes with an Internet-friendly graph? + +
Developer’s Guide to Org-roam @@ -1268,7 +1278,7 @@ Next: Completion, Previous: <Since version 9.5, Org has first-class support for citations. Org-roam supports the caching of both these in-built citations (of form
[cite:@key]
) and org-ref -citations (of form (NO_ITEM_DATA:key)). +citations (of form key).Org-roam attempts to load both the
org-ref
andorg-cite
package when indexing files, so no further setup from the user is required for citation @@ -2283,6 +2293,8 @@ Next:
-Previous: How do I migrate from Roam Research?, Up: FAQ [Index]
+Next: How do I publish my notes with an Internet-friendly graph?, Previous: How do I migrate from Roam Research?, Up: FAQ [Index]ROAM_TAGS
property for headline nodes
+Previous: How to migrate from Org-roam v1?, Up: FAQ [Index]
+The default graph builder creates a graph with an org-protocol +handler which is convenient when you’re working locally but +inconvenient when you want to publish your notes for remote access. +Likewise, it defaults to displaying the graph in Emacs which has the +exact same caveats. This problem is solvable in the following way +using org-mode’s native publishing capability: +
+The example code below is used to publish to a local directory where a +separate shell script copies the files to the remote site. +
+• Configure org-mode for publishing | + | |
• Overriding the default link creation function | + | |
• Copying the generated file to the export directory | + |
+Next: Overriding the default link creation function, Up: How do I publish my notes with an Internet-friendly graph? [Index]
+This has two steps: +
This will require code like the following: +
(defun roam-sitemap (title list) + (concat "#+OPTIONS: ^:nil author:nil html-postamble:nil\n" + "#+SETUPFILE: ./simple_inline.theme\n" + "#+TITLE: " title "\n\n" + (org-list-to-org list) "\nfile:sitemap.svg")) + +(setq my-publish-time 0) ; see the next section for context +(defun roam-publication-wrapper (plist filename pubdir) + (org-roam-graph) + (org-html-publish-to-html plist filename pubdir) + (setq my-publish-time (cadr (current-time)))) + +(setq org-publish-project-alist + '(("roam" + :base-directory "~/roam" + :auto-sitemap t + :sitemap-function roam-sitemap + :sitemap-title "Roam notes" + :publishing-function roam-publication-wrapper + :publishing-directory "~/roam-export" + :section-number nil + :table-of-contents nil + :style "<link rel=\"stylesheet\" href=\"../other/mystyle.cs\" type=\"text/css\">"))) +
+Next: Copying the generated file to the export directory, Previous: Configure org-mode for publishing, Up: How do I publish my notes with an Internet-friendly graph? [Index]
+The code below will generate a link to the generated html file instead +of the default org-protocol link. +
(defun org-roam-custom-link-builder (node) + (let ((file (org-roam-node-file node))) + (concat (file-name-base file) ".html"))) + +(setq org-roam-graph-link-builder 'org-roam-custom-link-builder) +
+Previous: Overriding the default link creation function, Up: How do I publish my notes with an Internet-friendly graph? [Index]
+The default behavior of ‘org-roam-graph’ is to generate the graph and +display it in Emacs. There is an ‘org-roam-graph-generation-hook’ +available that provides access to the file names so they can be copied +to the publishing directory. Example code follows: +
+(add-hook 'org-roam-graph-generation-hook + (lambda (dot svg) (if (< (- (cadr (current-time)) my-publish-time) 5) + (progn (copy-file svg "~/roam-export/sitemap.svg" 't) + (kill-buffer (file-name-nondirectory svg)) + (setq my-publish-time 0))))) +
@@ -2705,7 +2833,7 @@ Next: Variable Index, Pre
-Next: Bibliography (1), Previous: Function Index, Up: Top [Index]
+Previous: Function Index, Up: Top [Index]-Previous: Variable Index, Up: Top [Index]
-NO_ITEM_DATA:key -
-Emacs 28.0.50 (Org mode N/A) +
Emacs 29.0.50 (Org mode 9.6)