emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: William Crandall <bc3141592@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Drupal syntax on html-export for image links
Date: Sat, 26 May 2012 21:43:23 -0700	[thread overview]
Message-ID: <CAENLK5U+rDe8UFHKpZfAUOsXn+O1qDShA7WEC_9brOtRPyFdOA@mail.gmail.com> (raw)
In-Reply-To: <87wr42j6l6.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 4880 bytes --]

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:

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

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: <link rel="stylesheet" type="text/css" href="css/about.css" />

What syntax works now?


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

3. Configuring paths to images

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

Exports to:

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

One win; one fail.

#+ATTR_HTML: works fine!

But I'd like the path to be  <img src="/sites/a.png" ..
without  "g:"


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

4. Paths to files

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

Exports to:

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

How can I keep the path "as it was", and get this:

   <a href="/sites/my-file">My link</a>

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:

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

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-" . "&trade;")))))

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 <bzg@gnu.org> wrote:

> Hi William,
>
> William Crandall <bc3141592@gmail.com> writes:
>
> > Drupal inline image syntax is:
> >
> >   <img src="/sites/default/files/images/BC.png" alt="BC">
> >
> > Default Org-mode html-export, for  [[/sites/a.png]]  seems to be:
> >
> >   <img src="file://g:/sites/a.png"  alt="file://g:/sites/a.png" />
>
> Nicolas export engine does it right :
>
>  <img src="/sites/a.png"  alt="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
>

[-- Attachment #2: Type: text/html, Size: 19779 bytes --]

  reply	other threads:[~2012-05-27  4:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-24  4:55 Drupal syntax on html-export for image links William Crandall
2012-05-24  9:01 ` Bastien
2012-05-27  4:43   ` William Crandall [this message]
2012-05-27  7:35     ` Nicolas Goaziou
2012-05-27 12:41       ` Jambunathan K
2012-05-27 12:37     ` Jambunathan K
2012-05-27 16:00       ` William Crandall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAENLK5U+rDe8UFHKpZfAUOsXn+O1qDShA7WEC_9brOtRPyFdOA@mail.gmail.com \
    --to=bc3141592@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).