Open gnusupport opened 5 years ago
I have found solution on how to accept STDIN and export ORG html either full or only within the
content. This is similar to invocation of markdown on command line. I can just think, that to speed up, one could use emacsclient with --eval#!/usr/local/bin/emacs --script
;;;; Good idea from https://joelmccracken.github.io/entries/reading-writing-data-in-emacs-batch-via-stdin-stdout/
(defun org-stding-to-html-full ()
"Reads org text body from STDIN and export full HTML"
(let ((org-document-content "")
this-read)
(while (setq this-read (ignore-errors
(read-from-minibuffer "")))
(setq org-document-content (concat org-document-content "\n" this-read)))
(with-temp-buffer
(org-mode)
(insert org-document-content)
(org-html-export-as-html)
(princ (buffer-string)))))
(defun org-stding-to-html-body-only ()
"Reads org text body from STDIN and export full only body HTML"
(let ((org-document-content "")
this-read)
(while (setq this-read (ignore-errors
(read-from-minibuffer "")))
(setq org-document-content (concat org-document-content "\n" this-read)))
(with-temp-buffer
(org-mode)
(insert org-document-content)
(org-html-export-as-html nil nil nil t)
(princ (buffer-string)))))
(org-stding-to-html-body-only)
Related to
org mode
and the page here: http://hyperpolyglot.org/lightweight-markup you could update the column related to Org Mode and insert information as following.Under
sandbox
you would write "GNU Emacs editor installable from https://www.gnu.org/s/emacs with Org Mode mode likeM-x org-mode
. Isn't it sandbox for Org mode?Under
command line tool
well, I use Org Mode under command line tool all the time. It is also used to prepare web site pages. The database containts org mode text inside, pages are extracted and on the fly converted to HTML files. There are some references to using org mode on a command line, even those may not be straight forward:Myself, I am using a complicated version which uses the below common lisp script (CLISP) and exports Org Mode on the fly to markdown, and them converts markdown to HTML. That is my preference. But I will write for you how to do it with Emacs only