* Run commands after html export
@ 2013-10-12 10:04 Jarmo Hurri
2013-10-12 11:11 ` Jarmo Hurri
0 siblings, 1 reply; 4+ messages in thread
From: Jarmo Hurri @ 2013-10-12 10:04 UTC (permalink / raw)
To: emacs-orgmode
Greetings.
I feel like a newbie most of the time when I try to do something a bit
more complicated with org. And finding the solution in the manuals is
often pretty hard.
What I would like to do now is to automatically run some commands after
I have exported an org file as html. (In particular, I want to commit to
git and push changes to remote repo.) I know about publishing, but it
seems like overkill for a single org file.
I looked at the documentation, found hooks, and read source code, but
could not find the solution. The hooks in org-export-html-final-hook
seem to be run before the file is saved. I found no applicable hooks in
org-exp.el.
While I am at it, is there a way to set a default export type (html), or
do I have to bind a new key or rebind C-c C-e?
Thanks in advance - again.
Jarmo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Run commands after html export #orgmode
@ 2013-10-12 12:19 Iannis Zannos
2013-10-13 7:11 ` Run commands after html export Jarmo Hurri
0 siblings, 1 reply; 4+ messages in thread
From: Iannis Zannos @ 2013-10-12 12:19 UTC (permalink / raw)
To: Jarmo Hurri; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2100 bytes --]
Hello Jarmo,
it may be useful to look into the publishing scheme of org-mode.
Export = export a single file
Publish = publish a set of files. More extensive configuration
capabilities. Can also be used to publish single file.
Publish provides very extensive configuration capabilities, which include a
preparation-function and a completion-function hook. The completion
function can be used to ftp or rsync or otherwise copy data to the target
directory. Have a look at:
http://orgmode.org/worg/doc.html search for: org-publish-project-alist. In
that section you will find following passage:
`:publishing-function'
Function to publish file. Each back-end may define its
own (i.e. `org-latex-publish-to-pdf',
`org-html-publish-to-html'). May be a list of functions, in
which case each function in the list is invoked in turn.
Another property allows you to insert code that prepares
a project for publishing. For example, you could call GNU Make
on a certain makefile, to ensure published files are built up to
date.
`:preparation-function'
Function to be called before publishing this project. This
may also be a list of functions.
`:completion-function'
Function to be called after publishing this project. This
may also be a list of functions.
You will find more info in the orgmode manual here:
http://orgmode.org/manual/Configuration.html#Configuration
and here:
http://orgmode.org/manual/Sources-and-destinations.html#Sources-and-destinations
and in further related parts linked-to from the above.
Hopefully the above is useful.
Best,
Iannis Zannos
On Sat, Oct 12, 2013 at 2:11 PM, Jarmo Hurri <jarmo.hurri@syk.fi> wrote:
>
> Answering my own question...
>
> > What I would like to do now is to automatically run some commands
> > after I have exported an org file as html.
>
> I ended up circumventing the problem - that is, the exporter - by
> creating a code block in which I first run org-html-export-to-html and
> then do my git stuff. I no longer use the exporter, I just evaluate the
> block.
>
> Lesson learned.
>
> Jarmo
>
>
>
[-- Attachment #2: Type: text/html, Size: 4245 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Run commands after html export
2013-10-12 12:19 Run commands after html export #orgmode Iannis Zannos
@ 2013-10-13 7:11 ` Jarmo Hurri
0 siblings, 0 replies; 4+ messages in thread
From: Jarmo Hurri @ 2013-10-13 7:11 UTC (permalink / raw)
To: emacs-orgmode
Iannis Zannos <zannos@gmail.com> writes:
Greetings Iannis.
> Publish provides very extensive configuration capabilities, which
> include a preparation-function and a completion-function hook.
I saw the manual and worg pages on publishing, but thought that
configuring publishing parameters was simply too much work for
committing and pushing a single org file and the exported html.
But I am sure that for some other projects I am working on, publishing
fits the bill exactly. So I will have to delve into those setups later.
Thanks!
Jarmo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Run commands after html export
@ 2013-10-12 15:33 Iannis Zannos
0 siblings, 0 replies; 4+ messages in thread
From: Iannis Zannos @ 2013-10-12 15:33 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2100 bytes --]
Hello Jarmo,
it may be useful to look into the publishing scheme of org-mode.
Export = export a single file
Publish = publish a set of files. More extensive configuration
capabilities. Can also be used to publish single file.
Publish provides very extensive configuration capabilities, which include a
preparation-function and a completion-function hook. The completion
function can be used to ftp or rsync or otherwise copy data to the target
directory. Have a look at:
http://orgmode.org/worg/doc.html search for: org-publish-project-alist. In
that section you will find following passage:
`:publishing-function'
Function to publish file. Each back-end may define its
own (i.e. `org-latex-publish-to-pdf',
`org-html-publish-to-html'). May be a list of functions, in
which case each function in the list is invoked in turn.
Another property allows you to insert code that prepares
a project for publishing. For example, you could call GNU Make
on a certain makefile, to ensure published files are built up to
date.
`:preparation-function'
Function to be called before publishing this project. This
may also be a list of functions.
`:completion-function'
Function to be called after publishing this project. This
may also be a list of functions.
You will find more info in the orgmode manual here:
http://orgmode.org/manual/Configuration.html#Configuration
and here:
http://orgmode.org/manual/Sources-and-destinations.html#Sources-and-destinations
and in further related parts linked-to from the above.
Hopefully the above is useful.
Best,
Iannis Zannos
On Sat, Oct 12, 2013 at 2:11 PM, Jarmo Hurri <jarmo.hurri@syk.fi> wrote:
>
> Answering my own question...
>
> > What I would like to do now is to automatically run some commands
> > after I have exported an org file as html.
>
> I ended up circumventing the problem - that is, the exporter - by
> creating a code block in which I first run org-html-export-to-html and
> then do my git stuff. I no longer use the exporter, I just evaluate the
> block.
>
> Lesson learned.
>
> Jarmo
>
>
>
[-- Attachment #2: Type: text/html, Size: 4287 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-13 7:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-12 10:04 Run commands after html export Jarmo Hurri
2013-10-12 11:11 ` Jarmo Hurri
-- strict thread matches above, loose matches on Subject: below --
2013-10-12 12:19 Run commands after html export #orgmode Iannis Zannos
2013-10-13 7:11 ` Run commands after html export Jarmo Hurri
2013-10-12 15:33 Iannis Zannos
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.