From mboxrd@z Thu Jan 1 00:00:00 1970 From: William Crandall Subject: Re: Drupal syntax on html-export for image links Date: Sat, 26 May 2012 21:43:23 -0700 Message-ID: References: <87wr42j6l6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec54c5392d0a12f04c0fd3d14 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYVKD-00072k-GM for emacs-orgmode@gnu.org; Sun, 27 May 2012 00:43:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SYVKB-0008DG-54 for emacs-orgmode@gnu.org; Sun, 27 May 2012 00:43:29 -0400 In-Reply-To: <87wr42j6l6.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org --bcaec54c5392d0a12f04c0fd3d14 Content-Type: text/plain; charset=ISO-8859-1 Hello Bastien, Thanks for your pointer to org-export! I got it running and see it is an improvement. Reading the archives, I've gathered some notions. (Please correct me if I'm wrong!) Is it true that: 1. The org-export Package is a "Generic Export Engine" and is intended to support a new generation of org export tools (to HTML, LaTeX, ODT, etc). 2. It is now an "experimental" Contributed Package: http://orgmode.org/worg/org-contrib 3. The current (old) export command (C-c C-e) executes a function called "org-export" in org-exp.el (line 943) but it is not related to the new org-export package. 4. API documentation for the new org-export, and it's family (org-e-ascii.el, org-e-html.el, org-e-latex.el, org-e-odt.el org-e-publish.el org-element.el), is here: http://orgmode.org/worg/org-api/ 5. Documentation for back-end developers working on new export tools is here: http://orgmode.org/worg/dev/org-export-reference.html 6. Current org tutorials describe the old tool set, e.g., "Publishing Org-mode files to HTML", not the new: http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html 7. No end-user documentation for the org-export package has been created, describing for example, how to link to an external CSS file (as #+STYLE used to work). 8. "The Manual" does not (yet) document the org-export package: http://orgmode.org/manual/index.html 9. This mailing list is the best place to ask questions. ------------------------------------------------------------ Even if it's not a full BNF, and "only" 98% as Nicolas says, a quasi-complete grammar is a really good place to start, or re-start, building a "spaghetti-free" export system, IMO. ------------------------------------------------------------ ------------------------------------------------------------ Turning to my immediate challenge, exporting to html, I have some questions ( M-x org-export-dispatch h ): 1. UTF-8 How can I change the encoding, which defaults to: I set org-export-coding-system: (setq org-export-coding-system 'utf-8) And now: org-export-coding-system is a variable defined in `org-export.el'. Its value is utf-8 Original value was nil But the exported html file still shows iso-8859-1 -------------------------------------------------- 2. CSS I used to link to an external style file thus: #+STYLE: What syntax works now? -------------------------------------------------- 3. Configuring paths to images #+ATTR_HTML: alt="BC Crandall" [[/sites/a.png]] Exports to: BC Crandall

One win; one fail. #+ATTR_HTML: works fine! But I'd like the path to be My link How can I keep the path "as it was", and get this: My link without "file://g:" -------------------------------------------------- 5. Removing Pre- and Postamble What now works like: (setq org-export-html-preamble nil) (setq org-export-html-postamble nil) Now, there is no preamble. The postamble is:

Date: 2012-05-26 20:59:51 Pacific Daylight Time

Author : William BC Crandall

Generated by Org mode 7.8.11 in Emacs 24.1.50.1.

Validate XHTML 1.0
I'd like to remove both. -------------------------------------------------- 6. Special strings I was able to get a TM (&trade) in the old system with: (eval-after-load "org" '(setq org-export-html-special-string-regexps (append org-export-html-special-string-regexps '(("-TM-" . "™"))))) How now? -------------------------------------------------- Thanks for any pointers or suggestions! And thanks to everyone working on this. -BC Org-mode: 7.8.11 Emacs: 24.1.50.1 Windows 7 On Thu, May 24, 2012 at 2:01 AM, Bastien wrote: > Hi William, > > William Crandall writes: > > > Drupal inline image syntax is: > > > > BC > > > > Default Org-mode html-export, for [[/sites/a.png]] seems to be: > > > > file://g:/sites/a.png > > Nicolas export engine does it right : > > a.png > > To use it, please pull from the git master repository then > > - add the "contrib/" directory to your load-path > - (require 'org-export) > - M-x org-export-dispatch h > > HTH, > > -- > Bastien > --bcaec54c5392d0a12f04c0fd3d14 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello Bastien,

Thanks for your pointer to org-expo= rt!

I got it running and see it is an improvement.

Reading the archives, I&#= 39;ve gathered some notions.
(Please correct m= e if I'm wrong!)

Is it true that:

=
1. The org-export Package is a "Generic Export = Engine"
=A0=A0 and is intended to= support a new generation of
=A0=A0 org export= tools (to HTML, LaTeX, ODT, etc).=A0
=A0=A0
2. It is now an "experimental" Contributed Package:=
=A0=A0 http://orgmode.org/worg/org-contrib

3. The current (old) expo= rt command (C-c C-e) executes
=A0=A0 a functio= n called "org-export" in org-exp.el (line 943)
=A0=A0 but it is not rela= ted to the new org-export package.

4. API documentation for the new org= -export, and it's family
=A0=A0 (org-e-ascii.el, o= rg-e-html.el, org-e-latex.el, org-e-odt.el
=A0= =A0 org-e-publish.el org-element.el), is here:
=A0=A0 http://orgmode.org/worg/org-api/

5. Documentation for back= -end developers working on new
=A0=A0 export = tools is here:
=A0=A0 http://orgmode.org/worg/dev= /org-export-reference.html

6. Current org tutorials describe the old tool set, = e.g.,
=A0=A0 "Publishing Org-mode files t= o HTML", not the new:
=A0=A0 http://orgmo= de.org/worg/org-tutorials/org-publish-html-tutorial.html

7. No end-user documentation for the org-export pack= age
=A0=A0 has been created, describing for ex= ample, how to link
=A0=A0 to an external CSS= file (as #+STYLE used to work).

8. "The Manual" does not (yet)= document the org-export package:
=A0=A0 http://orgmode.org/manual/index.html

9. This mailing list is t= he best place to ask questions.

----------------------------------------= --------------------


Even if it's not a= full BNF, and "only" 98% as Nicolas says,
a quasi-complete grammar = is a really good place to start, or
re-start, building a "spaghetti= -free" export system, IMO.



------------------------------------------------= ------------

---------------------------------= ---------------------------


Turn= ing to my immediate challenge, exporting to html,
I have some questions ( M= -x org-export-dispatch h ):


1. UTF-8

How can I cha= nge the encoding, which defaults to:

=A0=A0 <?xml version=3D"1.0" encoding= =3D"iso-8859-1"?>

I set org-export-coding-s= ystem:

=A0=A0 (setq org-export-coding-system 'utf-8)

And now:

=A0=A0 org-export-coding-system is a vari= able defined in `org-export.el'.
=A0=A0 Its value is utf-8=
=A0=A0 Original value was nil

But the exported html file still shows iso-8859-1


--------------------------------------------------

2. CSS

I used to lin= k to an external style file thus:

=A0=A0 #+STYLE: <link rel=3D"stylesheet"= ; type=3D"text/css" href=3D"css/about.css" />=

What syntax works now?

-------------------------= -------------------------

3. Configuring paths to images

=A0=A0 #+ATTR_HTML: alt=3D"BC Crandall"
=A0=A0 [[/sites/a.png]]

Exports to:

=A0=A0 <img src=3D"g:/sites/= a.png" alt=3D"BC Crandall"/></p>

One win; one fail.

#+ATTR_HTML: works fine!

But I'd like the path to be=A0 <img src=3D&qu= ot;/sites/a.png" ..
without=A0 "g:&q= uot;


----= ----------------------------------------------

4. Paths to files

=A0=A0 [[/sites/my-file][My link= ]]

Exports to:

=A0=A0 <a href=3D"file://g:/= sites/my-file">My link</a>

How can I keep the path "as it was", and g= et this:

=A0=A0 <a href=3D"= ;/sites/my-file">My link</a>

without "file://g:"<= /span>


----= ----------------------------------------------

5. Removing Pre- and Postamble

What now works like:

= =A0=A0 (setq org-export-html-preamble nil)
=A0=A0 (setq org-export-h= tml-postamble nil)
Now, there is no preamble.

The postamble is:

=A0=A0 <div id=3D"postam= ble">
=A0=A0 <p class=3D&quo= t;date"> Date: 2012-05-26 20:59:51 Pacific Daylight Time </p>=
=A0=A0 <p class=3D"author"> = Author : William BC Crandall</p>
=A0=A0 <p class=3D&quo= t;creator"> Generated by Org mode 7.8.11 in Emacs 24.1.50.1. </p= >
=A0=A0=A0=A0=A0 <a href=3D"http://validator.w3.org/check?uri=3Dreferer&quo= t;>Validate XHTML 1.0</a>

=A0=A0 </div>


I&#= 39;d like to remove both.


----= ----------------------------------------------


6. S= pecial strings

I was able to get a TM (&= amp;trade) in the old system with:

(eval-after-load "org"
=A0 '(setq org-export= -html-special-string-regexps
=A0=A0=A0 =A0(app= end org-export-html-special-string-regexps
=A0=A0=A0 =A0=A0=A0 =A0&#= 39;(("-TM-" . "&trade;")))))

How now?


----= ----------------------------------------------

Thanks for any pointers or suggestions!

And thanks to everyone wo= rking on this.

-BC

Org-mode: 7.8.11
Emacs:= 24.1.50.1
Windows 7

<= br style=3D"font-family:courier new,monospace">

On Thu, May 24, 2012 at 2:01 AM, Bastien <bzg@gnu.org> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex"> Hi William,

William Crandall <bc3141592@gmail= .com> writes:

> Drupal inline image syntax is:
>
> =A0 <img src=3D"/sites/default/files/images/BC.png" alt= =3D"BC">
>
> Default Org-mode html-export, for=A0 [[/sites/a.png]]=A0 seems to be:<= br> >
> =A0 <img src=3D"file://g:/sites/a.png"=A0 alt=3D"fil= e://g:/sites/a.png" />

Nicolas export engine does it right :

=A0<img src=3D"/sites/a.png" =A0alt=3D"a.png"/><= br>
To use it, please pull from the git master repository then

- add the "contrib/" directory to your load-path
- (require 'org-export)
- M-x org-export-dispatch h

HTH,

--
=A0Bastien

--bcaec54c5392d0a12f04c0fd3d14--