[Summarizing the back-and-forth in the comments]
Three problems:
By default the markdown
exporter is not loaded.
The output of the export process can be a buffer or a file, but it is not the stdout
of the Emacs process, so you cannot use output redirection.[1]
org-export-as
is the generic interface that returns the transcoded output as a string. Higher-level interfaces create the output buffer or file. In this case, org-md-export-to-markdown
is the higher-level interface that produces a file.
In summary, the invocation is:
emacs --batch myLanes.org \
--eval "(progn (require 'org) (require 'ox-md) (org-md-export-to-markdown))"
That produces a file myLanes.md
in the same directory as the input file myLanes.org
(in this case, the current working directory , but you can use pathnames).
Footnote:
[1] Well, you can but you have to do it yourself, e.g. with (princ (org-export-as 'md))
.
ox-md
as well: it is not loaded by default.org-export-as
is not the right interface for this - tryorg-md-export-to-markdown
. If the input file ismyLanes.org
, the output file will bemyLanes.md
in the same directory.