emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* HTML export without all <div ...>  tags
@ 2009-09-25 13:00 Detlef Steuer
  2009-09-25 13:32 ` Matt Lundin
  2009-09-25 13:45 ` Carsten Dominik
  0 siblings, 2 replies; 8+ messages in thread
From: Detlef Steuer @ 2009-09-25 13:00 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

I'm in the process of adapting cmsimple (www.cmsimple.dk) to use our university's corporate design. Cmsimple in its core is a php script, which takes _one_
html file and creates the complete layout of a site on the fly while splitting the file apart at h[123] levels.

Now I want to create that one html file with org-mode. What else? 

If I could get org-mode to export pure html without all the <div> tags I think I am done. But how to explain to orgmode to be dumb?

The variable Org-Export-Html-Style-Include-Default ist set to nil, so no definitions included. Nevertheless the way divs are grouped around headlines seems to disturb cmsimple and its layout. 
At least, if I remove all divs the layout is just fine.

Is there a way to get rid of all div tags in exported html?

Thx
Detlef 

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

* Re: HTML export without all <div ...>  tags
  2009-09-25 13:00 HTML export without all <div ...> tags Detlef Steuer
@ 2009-09-25 13:32 ` Matt Lundin
  2009-09-25 13:53   ` R: " Giovanni Ridolfi
  2009-09-25 13:45 ` Carsten Dominik
  1 sibling, 1 reply; 8+ messages in thread
From: Matt Lundin @ 2009-09-25 13:32 UTC (permalink / raw)
  To: Detlef Steuer; +Cc: emacs-orgmode

Detlef Steuer <steuer@unibwh.de> writes:

> I'm in the process of adapting cmsimple (www.cmsimple.dk) to use our
> university's corporate design. Cmsimple in its core is a php script,
> which takes _one_ html file and creates the complete layout of a site
> on the fly while splitting the file apart at h[123] levels.
>
> Now I want to create that one html file with org-mode. What else?
>
> If I could get org-mode to export pure html without all the <div> tags
> I think I am done. But how to explain to orgmode to be dumb?

AFAIK, the <div> tags are hard-coded into org-export-as-html. 

You might try org-export-generic in the contrib directory of the git
repository. 

Another (more complex) solution: export to LaTeX and then use a
converter such as hevea or tex4ht to create a basic html file.

Too bad cmsimple doesn't parse org source files instead of html! ;)

- Matt

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

* Re: HTML export without all <div ...>  tags
  2009-09-25 13:00 HTML export without all <div ...> tags Detlef Steuer
  2009-09-25 13:32 ` Matt Lundin
@ 2009-09-25 13:45 ` Carsten Dominik
  2009-09-25 14:06   ` Matt Lundin
  2009-09-25 14:15   ` scripting challenge (was: Re: HTML export without all <div ...> tags) Giovanni Ridolfi
  1 sibling, 2 replies; 8+ messages in thread
From: Carsten Dominik @ 2009-09-25 13:45 UTC (permalink / raw)
  To: Detlef Steuer; +Cc: emacs-orgmode


On Sep 25, 2009, at 2:00 PM, Detlef Steuer wrote:

> Hi!
>
> I'm in the process of adapting cmsimple (www.cmsimple.dk) to use our  
> university's corporate design. Cmsimple in its core is a php script,  
> which takes _one_
> html file and creates the complete layout of a site on the fly while  
> splitting the file apart at h[123] levels.
>
> Now I want to create that one html file with org-mode. What else?
>
> If I could get org-mode to export pure html without all the <div>  
> tags I think I am done. But how to explain to orgmode to be dumb?
>
> The variable Org-Export-Html-Style-Include-Default ist set to nil,  
> so no definitions included. Nevertheless the way divs are grouped  
> around headlines seems to disturb cmsimple and its layout.
> At least, if I remove all divs the layout is just fine.
>
> Is there a way to get rid of all div tags in exported html?

I guess the easiest would be to just post-process the html file
produced by Org.  For example with perl (untested):

perl -ap -e 's/<div [^>]*>//g' orgoutput.html > simple.html

HTH

- Carsten

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

* R: Re: HTML export without all <div ...>  tags
  2009-09-25 13:32 ` Matt Lundin
@ 2009-09-25 13:53   ` Giovanni Ridolfi
  0 siblings, 0 replies; 8+ messages in thread
From: Giovanni Ridolfi @ 2009-09-25 13:53 UTC (permalink / raw)
  To: Detlef Steuer, Matt Lundin; +Cc: emacs-orgmode

-- Ven 25/9/09, Matt Lundin <mdl@imapmail.org> ha scritto:
> Detlef Steuer <steuer@unibwh.de>
> writes:
> 
> > If I could get org-mode to export pure html without
> > all the <div> tags
> 
> AFAIK, the <div> tags are hard-coded into
> org-export-as-html. 
> 
> You might try org-export-generic in the contrib directory
> of the git repository. 
> 
> Another (more complex) solution: export to LaTeX and then
> use a
> converter such as hevea or tex4ht to create a basic html
> file.
> 

Another solution: 
1. write a function to remove <div> and </div> tags
2. call that function in a post-processing hook. 
   I'm pretty sure there's a post processing hook 
   for html-export.

cheers,
Giovanni






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

* Re: HTML export without all <div ...>  tags
  2009-09-25 13:45 ` Carsten Dominik
@ 2009-09-25 14:06   ` Matt Lundin
  2009-09-25 14:15   ` scripting challenge (was: Re: HTML export without all <div ...> tags) Giovanni Ridolfi
  1 sibling, 0 replies; 8+ messages in thread
From: Matt Lundin @ 2009-09-25 14:06 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Detlef Steuer, emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Sep 25, 2009, at 2:00 PM, Detlef Steuer wrote:
>
>> Is there a way to get rid of all div tags in exported html?
>
> I guess the easiest would be to just post-process the html file
> produced by Org.  For example with perl (untested):
>
> perl -ap -e 's/<div [^>]*>//g' orgoutput.html > simple.html

So simple and elegant. It's amazing how many simple tricks you learn by
hanging around this list. :)

- Matt

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

* scripting challenge (was: Re: HTML export without all <div ...> tags)
  2009-09-25 13:45 ` Carsten Dominik
  2009-09-25 14:06   ` Matt Lundin
@ 2009-09-25 14:15   ` Giovanni Ridolfi
  2009-09-25 14:19     ` Carsten Dominik
  1 sibling, 1 reply; 8+ messages in thread
From: Giovanni Ridolfi @ 2009-09-25 14:15 UTC (permalink / raw)
  To: Detlef Steuer, Carsten Dominik; +Cc: emacs-orgmode

> > If I could get org-mode to export pure html without
> all the <div> tags I think I am done. 
> I guess the easiest would be to just post-process the html
> file
> produced by Org.  For example with perl (untested):
> 
> perl -ap -e 's/<div [^>]*>//g' orgoutput.html >
> simple.html
> 

[OT] comp.perl.group ;-)

Carsten,  

I'curious (and also a bit provocative ;-), 
does your command work also for </div> tags ?

Is there a way to remove both <div> and </div> 
in the same line?

cheers,
Giovanni




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

* Re: scripting challenge (was: Re: HTML export without all <div ...> tags)
  2009-09-25 14:15   ` scripting challenge (was: Re: HTML export without all <div ...> tags) Giovanni Ridolfi
@ 2009-09-25 14:19     ` Carsten Dominik
  2009-09-25 14:32       ` scripting challenge Bernt Hansen
  0 siblings, 1 reply; 8+ messages in thread
From: Carsten Dominik @ 2009-09-25 14:19 UTC (permalink / raw)
  To: Giovanni Ridolfi; +Cc: Detlef Steuer, emacs-orgmode

Hi Giovanni,

good catch, no, it does not.  This will:

perl -ap -e 's/<div [^>]*>|<\/div>//g' orgoutput.html > simple.html

Many divs may be in the same ling because of the /g switch on the  
substitution command.  It causes the rest of the line after the match  
to be parsed again.

- Carsten

On Sep 25, 2009, at 3:15 PM, Giovanni Ridolfi wrote:

>>> If I could get org-mode to export pure html without
>> all the <div> tags I think I am done.
>> I guess the easiest would be to just post-process the html
>> file
>> produced by Org.  For example with perl (untested):
>>
>> perl -ap -e 's/<div [^>]*>//g' orgoutput.html >
>> simple.html
>>
>
> [OT] comp.perl.group ;-)
>
> Carsten,
>
> I'curious (and also a bit provocative ;-),
> does your command work also for </div> tags ?
>
> Is there a way to remove both <div> and </div>
> in the same line?
>
> cheers,
> Giovanni
>
>
>
>
>
>
> _______________________________________________
> 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] 8+ messages in thread

* Re: scripting challenge
  2009-09-25 14:19     ` Carsten Dominik
@ 2009-09-25 14:32       ` Bernt Hansen
  0 siblings, 0 replies; 8+ messages in thread
From: Bernt Hansen @ 2009-09-25 14:32 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Detlef Steuer, emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> good catch, no, it does not.  This will:
>
> perl -ap -e 's/<div [^>]*>|<\/div>//g' orgoutput.html > simple.html

This works too

perl -ap -e 's@</?div[^>]*>@@g' org-mode.html >/tmp/simple.html

-Bernt

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

end of thread, other threads:[~2009-09-25 14:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-25 13:00 HTML export without all <div ...> tags Detlef Steuer
2009-09-25 13:32 ` Matt Lundin
2009-09-25 13:53   ` R: " Giovanni Ridolfi
2009-09-25 13:45 ` Carsten Dominik
2009-09-25 14:06   ` Matt Lundin
2009-09-25 14:15   ` scripting challenge (was: Re: HTML export without all <div ...> tags) Giovanni Ridolfi
2009-09-25 14:19     ` Carsten Dominik
2009-09-25 14:32       ` scripting challenge Bernt Hansen

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).