Pour utiliser Org-Babel, il est necessaire d'ajouter les lignes suivantes dans le fichie ".emacs' de votre installation:
; Some initial langauges we want org-babel to support (org-babel-do-load-languages 'org-babel-load-languages '( (sh . t) (python . t) (R . t) (ruby . t) (ditaa . t) (dot . t) (octave . t) (sqlite . t) (perl . t) ))
Une petite commande forte utile pour utiliser un crontab pour generer automatiquement les fichiers HTMLs pour un site web.
Premier essai à la methode bourrin! On exporte tout!
emacs --batch -l $HOME/.emacs -f org-publish-all
Deuxieme essai: on choisi ce que l'on souhaite exporter.
emacs --batch -l $HOME/.emacs --eval '(org-publish-project "website")'
Copier cette section est a copie dans un fichier .emacs .
;; ;; ORG MODE - Function to create a new blog Post ;; ;; Press F5 to create a new Blog Post. ;; Emacs will ask you to enter the title and the Blog post category you want. ;; (defvar homeblogdir "/home/xxxx/dropbox/The_Flammable_Project/src/posts/") (defun newPost (title ctaegory) "open a new Blog Posts in Year_Month_Day.org" (interactive "sTitre: \nsCategory: ") (let* ((tmptitle (replace-regexp-in-string "[ ']" "_" title)) (year (format-time-string "%Y")) (month (format-time-string "%m")) (day (format-time-string "%d")) (newtitle (downcase (concat year "_" month "_" day ".org"))) ) (find-file (concat homeblogdir newtitle)) (insert (concat "* " title "\n")) (insert (concat ":PROPERTIES:\n")) (insert (concat ":PUBDATE: <" year "-" month "-" day ">\n")) (insert (concat ":CATEGORY: " category "\n")) (insert (concat ":END:\n\n")) ) ) (global-set-key (kbd "<f5>") 'newPost)
Pour que les accents circonflexes soient bien pris en compte lors de l'édition de documents, il suffit d'ajouter les lignes suivantes dans le fichier "~/.emacs".
;; Support des accents circonflexes dans Emacs (load-library "iso-transl")