From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Eliminate line breaks in html Date: Wed, 25 Aug 2010 01:42:00 +0000 Message-ID: References: <87hbjjq4p9.fsf@rochester.rr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1189880902==" Return-path: Received: from [140.186.70.92] (port=55565 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oo56H-00019j-Ea for emacs-orgmode@gnu.org; Tue, 24 Aug 2010 21:48:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oo505-0003Jj-O3 for emacs-orgmode@gnu.org; Tue, 24 Aug 2010 21:42:03 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:57357) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oo505-0003Jf-FJ for emacs-orgmode@gnu.org; Tue, 24 Aug 2010 21:42:01 -0400 Received: by vws16 with SMTP id 16so148878vws.0 for ; Tue, 24 Aug 2010 18:42:00 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tim Burt Cc: emacs-orgmode --===============1189880902== Content-Type: multipart/alternative; boundary=0016e68ee000e1a49a048e9bfc17 --0016e68ee000e1a49a048e9bfc17 Content-Type: text/plain; charset=ISO-8859-1 Just tying up loose ends on this... Tim Burt was kind enough to go offline with me for a while on this, but I realized I should put my final solution out there. There is an option in blogger to post in raw html, so for those just starting, that's an option. Just C-u C-c C-e C-R and paste into blogger. I already had some 30 posts and re-doing them would have been awful. Here's what I ended up doing: - write up post in org-mode - highlight region - C-u C-c C-e C-R - new file and yank the html - write the file as export.txt - in a terminal run: perl -pi -e ' s/\R//g; s/\//g; s/\<\/p\>/\n\n/g;' export.txt --- This removes the begin paragraph tag and replaces the end paragraph tag with some new-line characters. - refresh export.txt - copy the whole buffer and then paste into blogger Paragraph beginnings have two spaces that I go through and delete and since I also write to export to LaTeX I use \quote and need to go through and change them to
where necessary. I obviously also have to clean up LaTeX only stuff... It's hardly any work and I can live with it, especially since I get the power of org-mode for writing things up along with it's mutli-faceted export capabilities *and* the fact that I have the file with me rather than just on blogger. For what its worth, perhaps someone can gain from this! John It's been working great and On Wed, Jul 28, 2010 at 1:48 PM, John Hendy wrote: > @ Giovanni: the manual says \n:nil does not work. I played around with it > anyway but was unsuccessful. Bummer as it seemed like it would have been > perfect... > > @ TIm, I am aware of this option and it's what I was referencing in the > original note with: > > > I could resort to explicit html every time I post (requiring
> > for every line break) but this would also require fixing all > > pre-existing posts which is pretty much not an option. > > But what about my point that currently all my posts do not use this? When I > experimented with this option yesterday it turned old posts into huge run-on > paragraphs with no structure, hence I don't really think it's an option > unless I re-edit every post. Going forward, it'd be easier to somehow get > rid of line breaks... though maybe I should just write my own template or > something. I don't really use

in my posts anyway but prefer the single > line space created by just on
. > > I dunno -- any thoughts? Should I re-do like 30 posts for this? Is there > any other way? > > > Thanks for the help, all. > John > > On Wed, Jul 28, 2010 at 5:30 AM, Tim Burt wrote: > >> John Hendy writes: >> >> > I use org for exporting to html and then pasting into blogger >> I use this process also for Blogger >> > ... but every time I do I need to delete line breaks. >> ... but I do not need to delete line breaks. See >> >> http://naturallogofx.rketburt.org/2010/07/linebreaks-blogger-and-org-mode.html >> for an article that describes what I do. The fix for me was in the >> Blogger settings, not anything in emacs. >> >> > Is there a way to get org to just publish the blob without breaking >> > lines every time? >> I do not know how to prevent line breaks in the export, but nor have I >> needed to do that. >> >> > I'm guessing it has to do with my minor fill mode as the line breaks >> > tend to be the same as they are in org. >> >> > >> > In typical export, everything is surrounded by tags but in >> blogger on >> > doesn't have these and thus line breaks are line breaks. >> The article reference above indicates how to stop Blogger from >> presenting an input linebreak (e.g. newline character) as an output >> linebreak. >> >> > I could resort to explicit html every time I post (requiring
>> > for every line break) but this would also require fixing all >> > pre-existing posts which is pretty much not an option. >> > >> > Any idea what I could do? >> Let me know if the article reference does not help solve the issue. >> >> Tim >> >> >> > >> > >> > Thanks, >> > John >> > _______________________________________________ >> > Emacs-orgmode mailing list >> > Please use `Reply All' to send replies to the list. >> > Emacs-orgmode@gnu.org >> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> > > --0016e68ee000e1a49a048e9bfc17 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Just tying up loose ends on this...

Tim Burt = was kind enough to go offline with me for a while on this, but I realized I= should put my final solution out there.=A0There is an option in blogger to= post in raw html, so for those just starting, that's an option. Just C= -u C-c C-e C-R and paste into blogger. I already had some 30 posts and re-d= oing them would have been awful. Here's what I ended up doing:

- write up post in org-mode
- highlight regio= n
- C-u C-c C-e C-R
- new file and yank the html
<= div>- write the file as export.txt
- in a terminal run:=A0perl -pi -e ' s/\R//g; s/\<p\&= gt;//g; s/\<\/p\>/\n\n/g;' =A0export.txt
--- This removes the begi= n paragraph tag and replaces the end paragraph tag with some new-line chara= cters.
- refresh export.txt
- copy the whole = buffer and then paste into blogger

Paragraph beginnings ha= ve two spaces that I go through and delete and since I also write to export= to LaTeX I use \quote and need to go through and change them to <blockq= uote></blockquote> where necessary. I obviously also have to clean= up LaTeX only stuff... It's hardly any work and I can live with it, es= pecially since I get the power of org-mode for writing things up along with= it's mutli-faceted export capabilities and=A0the fact that I ha= ve the file with me rather than just on blogger.

<= span class=3D"Apple-style-span" style=3D"border-collapse: collapse;">For wh= at its worth, perhaps someone can gain from this!

<= span class=3D"Apple-style-span" style=3D"border-collapse: collapse;">
John

It's been working great and=A0



On Wed, Jul 28, 2010 at 1= :48 PM, John Hendy <jw.hendy@gmail.com> wrote:
@ Giovanni: the manual says \n:nil does not work. I played around with it a= nyway but was unsuccessful. Bummer as it seemed like it would have been per= fect...

@ TIm, I am aware of this option and it's wh= at I was referencing in the original note with:

> I could resort to = explicit html every time I post (requiring <br \>
> for every line break) but this would also require fixing all
> p= re-existing posts which is pretty much not an option.

But what about my point = that currently all my posts do not use this? When I experimented with this = option yesterday it turned old posts into huge run-on paragraphs with no st= ructure, hence I don't really think it's an option unless I re-edit= every post. Going forward, it'd be easier to somehow get rid of line b= reaks... though maybe I should just write my own template or something. I d= on't really use <p> in my posts anyway but prefer the single line= space created by just on <br \>.

I dunno -- any= thoughts? Should I re-do like 30 posts for this? Is there any other way?


Thanks for the= help, all.
John

On Wed, Jul 28, 2010 at 5:30 AM, Tim Burt <= tcburt@rochester.rr.com> wrote:
John Hendy <jw.hendy@gmail.com> writes:

> I use org for exporting to html and then pasting into blogg= er
I use this process also for Blogger
> ... but every time I do I need to delete line breaks.
... but I do not need to delete line breaks. =A0See
http://naturallogofx.rketburt.org/2010/07= /linebreaks-blogger-and-org-mode.html
for an article that describes what I do. =A0The fix for me was in the
Blogger settings, not anything in emacs.

> Is there a way to get org to just publish the blob without breaking > lines every time?
I do not know how to prevent line breaks in the export, but nor have = I
needed to do that.

> I'm guessing it has to do with my minor fill mode as the line brea= ks
> tend to be the same as they are in org.

>
> In typical export, everything is surrounded by <html> tags but i= n blogger on
> doesn't have these and thus line breaks are line breaks.
The article reference above indicates how to stop Blogger from
presenting an input linebreak (e.g. newline character) as an output
linebreak.

> I could resort to explicit html every time I post (requiring <br \&= gt;
> for every line break) but this would also require fixing all
> pre-existing posts which is pretty much not an option.
>
> Any idea what I could do?
Let me know if the article reference does not help solve the issue.
Tim


>
>
> Thanks,
> John
> _______________________________________________ > Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmo= de@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode


--0016e68ee000e1a49a048e9bfc17-- --===============1189880902== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1189880902==--