emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* export all linked images with a certain property or tag
@ 2007-09-30 18:36 Fabian Braennstroem
  2007-10-01 17:05 ` Bastien
  0 siblings, 1 reply; 11+ messages in thread
From: Fabian Braennstroem @ 2007-09-30 18:36 UTC (permalink / raw)
  To: emacs-orgmode

Hi,
I am looking for a way to export linked images with a
certain property to html.
I am thinking about a structure like this:

* Pictures
** Germany :Project1:
:PROPERTIES:
 :Datum:2007
:END:
- some text
[[file:image.png]]
- some text

** Germany :Project2:
:PROPERTIES:
 :Datum:2007
:END:
- some text
[[file:image2.png]]
- some text


With the agenda search for tags and properties I could list
the headings of 'Datum="2007"', but is there a chance to
export the images together with the corresponding headings
and properties into one html-file?
A problem would arise, if some headings with the wanted
property/tag do not have any images.
It would be really a nice feature for collecting and
comparing images... :-)

Greetings!
Fabian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: export all linked images with a certain property or tag
  2007-09-30 18:36 export all linked images with a certain property or tag Fabian Braennstroem
@ 2007-10-01 17:05 ` Bastien
  2007-10-01 20:34   ` Fabian Braennstroem
  0 siblings, 1 reply; 11+ messages in thread
From: Bastien @ 2007-10-01 17:05 UTC (permalink / raw)
  To: emacs-orgmode

Fabian Braennstroem <f.braennstroem@gmx.de> writes:

> I am looking for a way to export linked images with a certain property
> to html.

More generally, we could implement a way to restrict the exported text
to some headlines, given certain conditions on the headline itself (and
its text properties) and the properties in :PROPERTIES:.

Would that suit your specific needs?

-- 
Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: export all linked images with a certain property or tag
  2007-10-01 17:05 ` Bastien
@ 2007-10-01 20:34   ` Fabian Braennstroem
  2007-10-01 23:50     ` Bastien
  0 siblings, 1 reply; 11+ messages in thread
From: Fabian Braennstroem @ 2007-10-01 20:34 UTC (permalink / raw)
  To: emacs-orgmode

Hi Bastien,

Bastien schrieb am 10/01/2007 05:05 PM:
> Fabian Braennstroem <f.braennstroem@gmx.de> writes:
> 
>> I am looking for a way to export linked images with a certain property
>> to html.
> 
> More generally, we could implement a way to restrict the exported text
> to some headlines, given certain conditions on the headline itself (and
> its text properties) and the properties in :PROPERTIES:.
> 
> Would that suit your specific needs?

Sounds good for me, maybe it would be good to add some kind
off 'comment-region', which will not be exported by default.
A small example:

* Pictures
** Germany :Project1:
:PROPERTIES:
 :Datum:2007
:END:
|-- Some Comment Begin ------------------------
- some text
|-- Some Comment End ------------------------

[[file:image.png]]
|-- Some Comment Begin ------------------------
- some text
|-- Some Comment End ------------------------

The html file would just show:
* Pictures
** Germany :Project1:
:PROPERTIES:
 :Datum:2007
:END:
[[file:image.png]]

This would be great for me ... but than it probably even
easier to just extract the picture and properties...
Another and maybe easier way for the export could be to
define the number of levels of a searched tag; then I would
reorganize my structure a bit:

* Pictures
** Germany :Project1:
:PROPERTIES:
 :Datum:2007
:END:

[[file:image.png]]
-some text

*** new level
- some text
*** new level 2
- some text


The html export with an argument of '2' could look like:

* Pictures
** Germany :Project1:
:PROPERTIES:
 :Datum:2007
:END:

[[file:image.png]]
-some text

This is probably easiest to implement and yet pretty powerfull!?
Greetings!
Fabian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: export all linked images with a certain property or tag
  2007-10-01 20:34   ` Fabian Braennstroem
@ 2007-10-01 23:50     ` Bastien
  2007-10-02 21:19       ` Fabian Braennstroem
  0 siblings, 1 reply; 11+ messages in thread
From: Bastien @ 2007-10-01 23:50 UTC (permalink / raw)
  To: emacs-orgmode

Fabian Braennstroem <f.braennstroem@gmx.de> writes:

> Sounds good for me, maybe it would be good to add some kind off
> 'comment-region', which will not be exported by default.

Org already knows about comments. You can comment entire regions by
selecting them, then pressing M-;. Whenever asked, enter "#" as the
comment character.

Within comments, all links are still active (even if the fontification
is quite misleading on this). So you should be able to insert pictures
and jump to them as usual.

Both HTML and LaTeX exporters will just skip comments.

See (info "(org)Comment lines")

> Another and maybe easier way for the export could be to define the
> number of levels of a searched tag; then I would reorganize my
> structure a bit:

The export engine is already aware of levels in some ways.  

`org-export-headline-levels' (or the "H:" option in #+OPTIONS) sets the
level of headlines to export. For the HTML exporter, levels below this
one are exported as list items. The LaTeX exporter comes with another
option: `org-export-latex-low-levels' which decides what to do with
lower levels: you can either convert them as descriptive lists, skip
them or use your own syntax. AFAIK there is no equivalent for HTML, 
but this would do what you request.

HTH,

-- 
Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: export all linked images with a certain property or tag
  2007-10-01 23:50     ` Bastien
@ 2007-10-02 21:19       ` Fabian Braennstroem
  2007-10-02 22:47         ` Bastien
  0 siblings, 1 reply; 11+ messages in thread
From: Fabian Braennstroem @ 2007-10-02 21:19 UTC (permalink / raw)
  To: emacs-orgmode


Bastien schrieb am 10/01/2007 11:50 PM:
> Fabian Braennstroem <f.braennstroem@gmx.de> writes:
> 
>> Sounds good for me, maybe it would be good to add some kind off
>> 'comment-region', which will not be exported by default.
> 
> Org already knows about comments. You can comment entire regions by
> selecting them, then pressing M-;. Whenever asked, enter "#" as the
> comment character.
> 
> Within comments, all links are still active (even if the fontification
> is quite misleading on this). So you should be able to insert pictures
> and jump to them as usual.
> 
> Both HTML and LaTeX exporters will just skip comments.
> 
> See (info "(org)Comment lines")

Thanks for the hint.

>> Another and maybe easier way for the export could be to define the
>> number of levels of a searched tag; then I would reorganize my
>> structure a bit:
> 
> The export engine is already aware of levels in some ways.  
> 
> `org-export-headline-levels' (or the "H:" option in #+OPTIONS) sets the
> level of headlines to export. For the HTML exporter, levels below this
> one are exported as list items. The LaTeX exporter comes with another
> option: `org-export-latex-low-levels' which decides what to do with
> lower levels: you can either convert them as descriptive lists, skip
> them or use your own syntax. AFAIK there is no equivalent for HTML, 
> but this would do what you request.

Sounds pretty good for me, but is it possible to insert all
current agenda headlines into one buffer?
Right now, I am just able to put on tree to an indirect buffer.
Thanks! Fabian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: export all linked images with a certain property or tag
  2007-10-02 21:19       ` Fabian Braennstroem
@ 2007-10-02 22:47         ` Bastien
  2007-10-03 10:30           ` Fabian Braennstroem
  0 siblings, 1 reply; 11+ messages in thread
From: Bastien @ 2007-10-02 22:47 UTC (permalink / raw)
  To: emacs-orgmode

Fabian Braennstroem <f.braennstroem@gmx.de> writes:

> Sounds pretty good for me, but is it possible to insert all
> current agenda headlines into one buffer?

In agenda view, you can use C-x C-w to export the view to HTML. This
uses htmlize.el, so make sure it's on your system.

See "Exporting to a file" at the bottom of this info page:

  (info "(Org)Agenda commands")

For now, if you want to skip some headlines during exportation, you will
have to archive them, or to add the keyword QUOTE (C-c : when you're on
the headline.)

-- 
Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: export all linked images with a certain property or tag
  2007-10-02 22:47         ` Bastien
@ 2007-10-03 10:30           ` Fabian Braennstroem
  2007-10-03 12:24             ` Bastien
  0 siblings, 1 reply; 11+ messages in thread
From: Fabian Braennstroem @ 2007-10-03 10:30 UTC (permalink / raw)
  To: emacs-orgmode

Bastien schrieb am 10/02/2007 10:47 PM:
> Fabian Braennstroem <f.braennstroem@gmx.de> writes:
> 
>> Sounds pretty good for me, but is it possible to insert all
>> current agenda headlines into one buffer?
> 
> In agenda view, you can use C-x C-w to export the view to HTML. This
> uses htmlize.el, so make sure it's on your system.
> 
> See "Exporting to a file" at the bottom of this info page:
> 
>   (info "(Org)Agenda commands")

Sorry, I was not really clear... not the agenda view should
be exported, but every visible tree should be included in
one indirect buffer. Right now, 'b' shows the
current-headline in an indirect buffer, which I can export
to html like usual. For this purpose there has to be one
global indirect agenda-buffer, which gets all those visible
trees!?

> For now, if you want to skip some headlines during exportation, you will
> have to archive them, or to add the keyword QUOTE (C-c : when you're on
> the headline.)

Thanks, did not know QUOTE before, buf archiving :-)

Fabian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: export all linked images with a certain property or tag
  2007-10-03 10:30           ` Fabian Braennstroem
@ 2007-10-03 12:24             ` Bastien
  2007-10-03 17:01               ` Fabian Braennstroem
  0 siblings, 1 reply; 11+ messages in thread
From: Bastien @ 2007-10-03 12:24 UTC (permalink / raw)
  To: emacs-orgmode

Fabian Braennstroem <f.braennstroem@gmx.de> writes:

> Sorry, I was not really clear... not the agenda view should be
> exported, but every visible tree should be included in one indirect
> buffer. Right now, 'b' shows the current-headline in an indirect
> buffer, which I can export to html like usual. For this purpose there
> has to be one global indirect agenda-buffer, which gets all those
> visible trees!?

I don't think this will be easy to do since showing the current headline
relies on narrowing the indirect buffer to a subtree, and narrowing more
than one region is not possible in a single buffer.

It would require to build another buffer with all headlines and subtrees
that are part of the agenda view.  Interesting!

-- 
Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: export all linked images with a certain property or tag
  2007-10-03 18:11                 ` Fabian Braennstroem
@ 2007-10-03 16:29                   ` Bastien
  0 siblings, 0 replies; 11+ messages in thread
From: Bastien @ 2007-10-03 16:29 UTC (permalink / raw)
  To: emacs-orgmode

Fabian Braennstroem <f.braennstroem@gmx.de> writes:

> but it needs some cosmetic like the looping over all
> existing agenda entries...

I wouldn't call it "cosmetic" :)

Can you provide a full example of what you want to do and what the
function you provide actually does, step by step?

When building the agenda view, Org collects all relevant headlines. If
we want to build something like the "complete agenda trees buffer (c)"
we should perhaps start from this early collection -- going back and
forth from one buffer to another and writing on them could be dangerous.

But thanks for the code, it's something we can start with! 

-- 
Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: export all linked images with a certain property or tag
  2007-10-03 12:24             ` Bastien
@ 2007-10-03 17:01               ` Fabian Braennstroem
  2007-10-03 18:11                 ` Fabian Braennstroem
  0 siblings, 1 reply; 11+ messages in thread
From: Fabian Braennstroem @ 2007-10-03 17:01 UTC (permalink / raw)
  To: emacs-orgmode



Bastien schrieb am 10/03/2007 12:24 PM:
> Fabian Braennstroem <f.braennstroem@gmx.de> writes:
> 
>> Sorry, I was not really clear... not the agenda view should be
>> exported, but every visible tree should be included in one indirect
>> buffer. Right now, 'b' shows the current-headline in an indirect
>> buffer, which I can export to html like usual. For this purpose there
>> has to be one global indirect agenda-buffer, which gets all those
>> visible trees!?
> 
> I don't think this will be easy to do since showing the current headline
> relies on narrowing the indirect buffer to a subtree, and narrowing more
> than one region is not possible in a single buffer.
> 
> It would require to build another buffer with all headlines and subtrees
> that are part of the agenda view.  Interesting!
> 

I gave it a small try, very simple and does not really work:

(defun org-agenda-collect-indirect-trees ()
  (interactive)
  (org-agenda-tree-to-indirect-buffer)
  (other-window 1)
  (mark-page)
;  (write-file "dummy")
  (write-region nil 0 "~/org/agenda-indirect-buffer.org" t)
  (other-window 1)
  (next-line)
  ; Loop over all agenda headlines...
)

not working means, that it appends the whole buffer content
and not just the viewable tree. The next problem would be to
run some kine of loop over all agenda headlines; now I would
just copy the command about 10 times ...
Do you think it is a working approach and maybe you got an
idea about the 'whole-buffer' problem?
Fabian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: export all linked images with a certain property or tag
  2007-10-03 17:01               ` Fabian Braennstroem
@ 2007-10-03 18:11                 ` Fabian Braennstroem
  2007-10-03 16:29                   ` Bastien
  0 siblings, 1 reply; 11+ messages in thread
From: Fabian Braennstroem @ 2007-10-03 18:11 UTC (permalink / raw)
  To: emacs-orgmode

It kind of works...

(defun org-agenda-collect-indirect-trees ()
  (interactive)
  (delete-file "~/org/agenda-indirect-buffer.org")
 ; LOOP
  (org-agenda-tree-to-indirect-buffer)
  (other-window 1)
  (mark-page)

  (write-region (point-min) (point-max)
"~/org/agenda-indirect-buffer.org" t)
  (write-region "\n\n" 0 "~/org/agenda-indirect-buffer.org" t)
  (other-window 1)
  (next-line)

  (org-agenda-tree-to-indirect-buffer)
  (other-window 1)
  (mark-page)
  (write-region (point-min) (point-max)
"~/org/agenda-indirect-buffer.org" t)
  (write-region "\n\n" 0 "~/org/agenda-indirect-buffer.org" t)
  (other-window 1)
  (next-line)

  (org-agenda-tree-to-indirect-buffer)
  (other-window 1)
  (mark-page)
  (write-region (point-min) (point-max)
"~/org/agenda-indirect-buffer.org" t)
  (write-region "\n\n" 0 "~/org/agenda-indirect-buffer.org" t)
  (other-window 1)
  (next-line)

  (org-agenda-tree-to-indirect-buffer)
  (other-window 1)
  (mark-page)
  (write-region (point-min) (point-max)
"~/org/agenda-indirect-buffer.org" t)
  (write-region "\n\n" 0 "~/org/agenda-indirect-buffer.org" t)
  (other-window 1)
  (next-line)

  (org-agenda-tree-to-indirect-buffer)
  (other-window 1)
  (mark-page)
  (write-region (point-min) (point-max)
"~/org/agenda-indirect-buffer.org" t)
  (write-region "\n\n" 0 "~/org/agenda-indirect-buffer.org" t)
  (other-window 1)
  (next-line)

  (other-window 1)
  (find-file "~/org/agenda-indirect-buffer.org")
  (org-export-as-html 2 t nil
"~/org/agenda-indirect-buffer.html")
)


but it needs some cosmetic like the looping over all
existing agenda entries...


Fabian Braennstroem schrieb am 10/03/2007 05:01 PM:
> 
> Bastien schrieb am 10/03/2007 12:24 PM:
>> Fabian Braennstroem <f.braennstroem@gmx.de> writes:
>>
>>> Sorry, I was not really clear... not the agenda view should be
>>> exported, but every visible tree should be included in one indirect
>>> buffer. Right now, 'b' shows the current-headline in an indirect
>>> buffer, which I can export to html like usual. For this purpose there
>>> has to be one global indirect agenda-buffer, which gets all those
>>> visible trees!?
>> I don't think this will be easy to do since showing the current headline
>> relies on narrowing the indirect buffer to a subtree, and narrowing more
>> than one region is not possible in a single buffer.
>>
>> It would require to build another buffer with all headlines and subtrees
>> that are part of the agenda view.  Interesting!
>>
> 
> I gave it a small try, very simple and does not really work:
> 
> (defun org-agenda-collect-indirect-trees ()
>   (interactive)
>   (org-agenda-tree-to-indirect-buffer)
>   (other-window 1)
>   (mark-page)
> ;  (write-file "dummy")
>   (write-region nil 0 "~/org/agenda-indirect-buffer.org" t)
>   (other-window 1)
>   (next-line)
>   ; Loop over all agenda headlines...
> )
> 
> not working means, that it appends the whole buffer content
> and not just the viewable tree. The next problem would be to
> run some kine of loop over all agenda headlines; now I would
> just copy the command about 10 times ...
> Do you think it is a working approach and maybe you got an
> idea about the 'whole-buffer' problem?
> Fabian
> 
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-10-03 16:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-30 18:36 export all linked images with a certain property or tag Fabian Braennstroem
2007-10-01 17:05 ` Bastien
2007-10-01 20:34   ` Fabian Braennstroem
2007-10-01 23:50     ` Bastien
2007-10-02 21:19       ` Fabian Braennstroem
2007-10-02 22:47         ` Bastien
2007-10-03 10:30           ` Fabian Braennstroem
2007-10-03 12:24             ` Bastien
2007-10-03 17:01               ` Fabian Braennstroem
2007-10-03 18:11                 ` Fabian Braennstroem
2007-10-03 16:29                   ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).