Re: [O] Inhibit converting -- to ndash;
Hello Nicolas, For me, org-e-html-special-string-regexps does not (yet) play well. On Sun, Jun 17, 2012 at 4:47 PM, Nicolas Goaziou n.goaz...@gmail.com wrote: William Crandall bc3141...@gmail.com writes: I've not been able to get special-strings working with the new exporter, I have no problem with (add-to-list 'org-e-html-special-string-regexps '(-nd- . --)) Could you elaborate? I have no problem with special strings in any back-end so far. -- Certainly. If I add that one line to the end of init.el: -- Debugger entered--Lisp error: (void-variable org-e-html-special-string-regexps) add-to-list(org-e-html-special-string-regexps (-nd- . --)) [etc.] -- And the attempted compile kicks off a renaming error, that I do not understand. That is, if I delete the new line, and try to compile: -- byte-compile-file: Renaming: permission denied, g:/dev/bin/emacs/.emacs.d/init.elc16464y, g:/dev/bin/emacs/.emacs.d/init.elc -- If I kill emacs, delete all init.elc* files, and restart, byte-compile proceeds without complaint. I've tried to wrap the line in two ways, but neither work: -- (eval-after-load 'org (add-to-list 'org-e-html-special-string-regexps '(-nd- . --))) -- Same void-variable error, and Renaming: permission denied error, with multiple init.elc3996DWC, etc. And same if I wrap it like this (void and renaming errors), which is the syntax that works for the old exporter: -- (eval-after-load org '(setq org-e-html-special-string-regexps (append org-e-html-special-string-regexps '((-nd- . --) -- -- If I remove all code snippet from init.el, kill emacs, delete all init.elcXXX files, and restart, emacs is fine. But, if I repeatedly test different permutations, emacs hangs trying to open a plain text file, showing no text and a broken scroll bar, and corrupts the desktop file. That is to say, it doesn't (yet) work for me ;). Hope this helps! -BC Org-mode version 7.8.11 (release_7.8.11-80-gfca016) GNU Emacs 24.1.50.1 (i386-mingw-nt6.1.7601) of 2012-06-18 on MARVIN Windows 7
[O] org-export-generic calls (assoc): Deprecated in Emacs 24
Nicolas, While testing org-e-html-special-string-regexps, I pulled a new emacs. Startup shows a new message: Package assoc is obsolete! (require 'assoc) is in org-export-generic, line 102. Some discussion here: http://www.emacswiki.org/emacs-en/assoc-deprecated Thanks again for great work on a moving target! -BC Org-mode version 7.8.11 (release_7.8.11-80-gfca016) GNU Emacs 24.1.50.1 (i386-mingw-nt6.1.7601) of 2012-06-18 on MARVIN Windows 7
Re: [O] Inhibit converting -- to ndash;
Hello Nicolas, On Mon, Jun 18, 2012 at 5:04 PM, Nicolas Goaziou n.goaz...@gmail.com wrote: You need to require `org-e-html' first. Well, that was easy. It works fine now. Thanks. Same void-variable error, and Renaming: permission denied error, with multiple init.elc3996DWC, etc. this is (eval-after-load 'org-e-html ...). Could you elaborate, or point me to some docs? Thanks again, -BC
Re: [O] Inhibit converting -- to ndash;
Hello, On Mon, Jun 18, 2012 at 5:42 PM, Nicolas Goaziou n.goaz...@gmail.com wrote: William Crandall bc3141...@gmail.com writes: this is (eval-after-load 'org-e-html ...). Could you elaborate, or point me to some docs? That's on the same basis as above. Evaluating your code once org.el has been loaded is too early. You need to ensure `org-e-html' feature has been provided first. Thus, (eval-after-load org-e-html ...) is more appropriate than (eval-after-load org ...). Ah, got it. All is clear now. Thanks, -BC
Re: [O] New Link Syntax: Adding ATTRIBUTES (Was: org-e-html: Including ATTR_HTML)
Hello Avdi, I'm glad you like it! On Fri, Jun 15, 2012 at 8:15 AM, Avdi Grimm gro...@inbox.avdi.org wrote: I really like this idea! This change may be Herculean--giving links full access to target attributes--but I certainly hope not. As I thought about it, it seems like fair amount of abstraction will be possible, creating one org-attribute name that would export appropriately to each target, without attaching destination prefixes to every item. But some will likely need to be target specific. Thanks again, -BC On Thu, Jun 14, 2012 at 8:53 PM, William Crandall bc3141...@gmail.com wrote: ATTRIBUTES would consisting of name:value pairs, perhaps giving names export-type prefixes, such as HTML_STYLE and HTML_TITLE, or LATEX_PDFBORDER and LATEX_URLCOLOR. HTML ATTRIBUTES would map to HTML 'attributes': http://www.w3.org/TR/html5/section-index.html#attributes-1 LATEX ATTRIBUTES would map to Latex \hypersetup 'options': http://en.wikibooks.org/wiki/LaTeX/Hyperlinks#.5Chyperref (Subsection: Customization) -- This would be a significant change, but it would make LINKS first class objects, and allow Org mode users to directly apply rich families of link attributes/options. I really like this idea! -- Avdi
Re: [O] Inhibit converting -- to ndash;
Kai, With the old exporter, you could make your own special-string and convert it. In init.el: -- ;; For old exporter: C-c C-e h (eval-after-load org '(setq org-export-html-special-string-regexps (append org-export-html-special-string-regexps '((-nd- . --) -- I've not been able to get special-strings working with the new exporter, but it should be something like: -- ;; For new exporter (but not yet) (eval-after-load org '(setq org-e-html-special-string-regexps (append org-e-html-special-string-regexps '((-nd- . --) -- HTH -BC
Re: [O] New Link Syntax: Adding ATTRIBUTES (Was: org-e-html: Including ATTR_HTML)
Hello Nicolas, Many thanks for expanded clarity, and a new direction. On Thu, Jun 14, 2012 at 2:51 AM, Nicolas Goaziou n.goaz...@gmail.com wrote: I understand your problem, but inserting ATTR_HTML keywords in a paragraph isn't possible anymore. I cannot allow that as it would defeat a fundamental change in the new Org syntax. This is good. While not familiar with the details, I clearly see the value of maintaining the logical integrity of the new architecture. ATTR_HTML could ... accept a list of properties that would be applied in order to each link in the paragraph. But it wouldn't scale well... Agreed; this is not the way to go. I'm open to any other suggestion. For example, link's syntax could be extended to allow attributes. I like this idea, and think it is the way to go. -- One approach would be to expand the current link syntax from TWO to THREE pairs of square brackets. Current syntax: http://orgmode.org/org.html#Link-format New syntax: [[link]] [[link][description]] [[link][description][ATTRIBUTES]] Description and attributes would be optional. ATTRIBUTES would consisting of name:value pairs, perhaps giving names export-type prefixes, such as HTML_STYLE and HTML_TITLE, or LATEX_PDFBORDER and LATEX_URLCOLOR. HTML ATTRIBUTES would map to HTML 'attributes': http://www.w3.org/TR/html5/section-index.html#attributes-1 LATEX ATTRIBUTES would map to Latex \hypersetup 'options': http://en.wikibooks.org/wiki/LaTeX/Hyperlinks#.5Chyperref (Subsection: Customization) -- This would be a significant change, but it would make LINKS first class objects, and allow Org mode users to directly apply rich families of link attributes/options. The Manual should then indicate that ATTR_HTML is a /paragraph/-level mechanism, and is no longer intended for use with links: http://orgmode.org/org.html#Links-in-HTML-export There may, of course, be different/better solutions. Thanks for continuing to move this forward! -BC
Re: [O] org-e-html: Including ATTR_HTML: title=hover text
Hello Nicolas, Many thanks for explaining the logic and functionality of the new exporter. I confess I am puzzled by the choice to drop the ability to apply attributes to links. The use case I'm aiming for is a standard HTML feature: 3.2.3.2 The 'title' attribute The title attribute represents advisory information for the element, such as would be appropriate for a tooltip. On a link, this could be the title or a description of the target resource; on an image, it could be the image credit or a description of the image; on a paragraph, it could be a footnote or commentary on the text; on a citation, it could be further information about the source; and so forth. http://www.w3.org/TR/html5/global-attributes.html#the-title-attribute In org-e-html today, it is only possible to attach a unique attribute to a paragraph; all links within that paragraph inherit its attributes. If a paragraph contains two links, they are both forced to show the same tooltip. The old exporter allowed this specificity, correctly interleaving link and image titles in one paragraph: Org input: -- A paragraph with three papers, and an image: #+ATTR_HTML: title=Paper #1 [[./local/01.html][a first paper]] followed by #+ATTR_HTML: title=Paper #2 [[./local/02.html][a second paper]] which describe stuff. It then offers a cat #+ATTR_HTML: title=Some cats alt=Cat image [[./local/cats.png]] and finally a third, PDF paper #+ATTR_HTML: title=Paper #3 [[./local/03.pdf][a third paper]] -- Old exporter: -- p A paragraph with three papers, and an image: a href=./local/01.html title=Paper #1a first paper/a followed by a href=./local/02.html title=Paper #2a second paper/a which describe stuff. It then offers a cat img src=./local/cats.png title=Some cats alt=Cat image / and finally a third, PDF paper a href=./local/03.pdf title=Paper #3a third paper/a /p -- I believe that this ability, this specificity within paragraphs, is generally quite useful, and I hope that you will consider it for the new exporter. If I'm missing something, if there /is/ a way to add individual link attributes, please let me know. It doesn't sound like filters allow that. Thanks again, for building and explaining. -BC Org-mode version 7.8.11 (release_7.8.11-64-g168c83) GNU Emacs 24.1.50.1 (i386-mingw-nt6.1.7601) Windows 7
Re: [O] org-e-html: Including ATTR_HTML: title=hover text
Hello Nicolas, Yes, thanks for explanation and code update. It works as you describe, as you can see below. This is a change; now all links within a paragraph are given (inherit) the same ATTR_HTML. Is it possible with the new exporter to add ATTR_HTML attributes to individual link elements? Thanks again for all your work on this! -BC Org-mode: 7.8.11 (release_7.8.11-55-g3f0f87) Emacs: 24.1.50.1 Windows 7 Org input: -- #+ATTR_HTML: title=The Org mode homepage style=color:red; [[http://orgmode.org]] #+ATTR_HTML: title=Link hover text [[http://www.orgmode.org][This paragraph]] describes how to use orgmode. A paragraph about #+ATTR_HTML: title=Link hover text [[./orgmode][org-mode]] which describes org-e-html... #+ATTR_HTML: title=Link hover text Another paragraph about [[./orgmode][org-mode]] which describes org-e-html... -- Old: -- p a href=http://orgmode.org; title=The Org mode homepage style=color:red;http://orgmode.org/a /p p a href=http://www.orgmode.org; title=Link hover textThis paragraph/a describes how to use orgmode. /p p A paragraph about a href=./orgmode title=Link hover textorg-mode/a which describes org-e-htmlhellip; /p p Another paragraph about a href=./orgmodeorg-mode/a which describes org-e-htmlhellip; /p -- New: -- p a href=http://orgmode.org; title=The Org mode homepage style=color:red;http://orgmode.org/a /p p a href=http://www.orgmode.org; title=Link hover textThis paragraph/a describes how to use orgmode. /p p A paragraph about /p p a href=./orgmode title=Link hover textorg-mode/a which describes org-e-htmlhellip; /p p Another paragraph about a href=./orgmode title=Link hover textorg-mode/a which describes org-e-htmlhellip; -- On Fri, Jun 8, 2012 at 6:28 AM, Nicolas Goaziou n.goaz...@gmail.com wrote: Hello, William Crandall bc3141...@gmail.com writes: ATTR_HTML is only for paragraphs, not links. This puzzles me, because (1) the old exporter works fine on links that are inside paragraphs, as my example showed, and (2) the Manual says ATTR_HTML lines are for links: That's a major change from previous exporter. Now, almost every element, including paragraphs, can have affiliated keywords at their beginning. Hence you can write: #+attr_latex: something - item 1 - item 2 or #+attr_html: something Some paragraph. This means that One paragraph. #+attr_html: something [[link]] Second paragraph is equivalent to: One paragraph. #+attr_html: something [[link]] Second paragraph Now let's have a look at your example. #+ATTR_HTML: title=The Org mode homepage style=color:red; [[http://orgmode.org]] In this case, the affiliated keyword is attached to the paragraph containing the link. But _the link can inherit from paragraph's attributes_. Since this is not the case yet in, I've added into code base. Is it working as expected? I hope I am clearer now. Regards, -- Nicolas Goaziou
[O] Using: org-e-html-special-string-regexps
Hello Jambunathan, I tried your suggestion of swapping -org-e-html-special-string-regexps- for -org-export-html-special-string-regexps- to add my own strings. I want this for an mdash; between words /without/ any spaces; the \mdash entity requires spaces. Results: The old exporter works as expected (below). The new exporter leads to an error mode I've not seen. With a new org-e-html-special-string-regexps code block in init.el (below), emacs reports: -- Wrote g:/dev/bin/emacs/.emacs.d/init.el Compiling g:/dev/bin/emacs/.emacs.d/init.el...done byte-compile-file: Renaming: permission denied, g:/dev/bin/emacs/.emacs.d/init.elc4856ijc, g:/dev/bin/emacs/.emacs.d/init.elc -- Each attempted compile generates a new init.elcX. I've never seen this before. Is it a known error? Attempts to use org-e-html-special-string-regexps naturally fail (see bottom). Any suggestions? Thanks again, for this, and for the /a tags on targets! -BC Org-mode: 7.8.11 (release_7.8.11-55-g3f0f87) Emacs: 24.1.50.1 Windows 7 -- -- org input: -- Testing: w/ spaces mdash \mdash yes, with spaces Testing: no-spaces mdash\mdashyes, without spaces Testing: my-string mdash-MDASH-yes, without spaces -- Old output: -- p Testing: w/ spaces mdash mdash; yes, with spaces Testing: no-spaces mdash\mdashyes, without spaces Testing: my-string mdashmdash;yes, without spaces /p -- Code in init.el: -- ;; For old exporter // WORKS (eval-after-load org '(setq org-export-html-special-string-regexps (append org-export-html-special-string-regexps '((-MDASH- . mdash;) ;; For new exporter // ERROR (eval-after-load org '(setq org-e-html-special-string-regexps (append org-e-html-special-string-regexps '((-MDASH- . mdash;) -- Debugger: -- Debugger entered--Lisp error: (void-variable org-e-html-special-string-regexps) (append org-e-html-special-string-regexps (quote ((-MDASH- . mdash; (setq org-e-html-special-string-regexps (append org-e-html-special-string-regexps (quote ((-MDASH- . mdash;) [...] --[end]---
Re: [O] Using: org-e-html-special-string-regexps
So you can! Splendid. Thanks, -BC On Fri, Jun 8, 2012 at 3:38 PM, Nicolas Goaziou n.goaz...@gmail.com wrote: Hello, William Crandall bc3141...@gmail.com writes: I want this for an mdash; between words /without/ any spaces; the \mdash entity requires spaces. You may use \mdash{} like in: a\mdash{}b Regards, -- Nicolas Goaziou
Re: [O] org-e-html: Including ATTR_HTML: title=hover text
Ah, that is a pity. Seems like a step back, in allowable specificity. As it was possible in the old. You mentioned before using filters. I take it these are the ones described in org-export-filters.el (line 1775), The Filter System. Has anyone written up any worked examples of these? And, is that the best tool for adding attributes to links? Thanks again, -BC On Fri, Jun 8, 2012 at 3:37 PM, Nicolas Goaziou n.goaz...@gmail.com wrote: Hello, William Crandall bc3141...@gmail.com writes: This is a change; now all links within a paragraph are given (inherit) the same ATTR_HTML. Indeed. Is it possible with the new exporter to add ATTR_HTML attributes to individual link elements? No, it isn't possible to control individual link elements with affiliated keywords. Regards, -- Nicolas Goaziou
Re: [O] org-e-html: Including ATTR_HTML: title=hover text
Hello Nicolas, Thanks for your email. You write: ATTR_HTML is only for paragraphs, not links. This puzzles me, because (1) the old exporter works fine on links that are inside paragraphs, as my example showed, and (2) the Manual says ATTR_HTML lines are for links: 12.5.4 Links in HTML export http://orgmode.org/org.html#Links-in-HTML-export If you want to specify attributes for links, you can do so using a special #+ATTR_HTML line to define attributes that will be added to the a or img tags. Here is an example that sets title and style attributes for a link: #+ATTR_HTML: title=The Org mode homepage style=color:red; [[http://orgmode.org]] Thanks for looking at this again! -BC On Thu, Jun 7, 2012 at 12:28 PM, Nicolas Goaziou n.goaz...@gmail.com wrote: Hello, William Crandall bc3141...@gmail.com writes: If org-mode source text is: -- A paragraph about #+ATTR_HTML: title=Link hover text [[http://orgmode.org]] exalting new emacs mode... -- M-x org-export-dispatch h generates: -- p A paragraph about /p p a href=http://orgmode.org;http://orgmode.org/a exalting new emacs modehellip; /p -- which is less grand. I see two needed fixes, reading http://orgmode.org/org.html#Links-in-HTML-export 1. A new /pp should not be inserted before lines starting #+ATTR_HTML. It sure should: you're starting a new paragraph containing a link and exalting new emacs mode... text. ATTR_HTML is an attribute for paragraphs, not links (though it may apply on links within the paragraph). You may want to add your title attribute with filters. Regards, -- Nicolas Goaziou
[O] org-e-html: Including ATTR_HTML: title=hover text
Hello Jambunathan and Nicolas, If org-mode source text is: -- A paragraph about #+ATTR_HTML: title=Link hover text [[http://orgmode.org]] exalting new emacs mode... -- M-x org-export h generates: -- p A paragraph about a href=http://orgmode.org; title=Link hover texthttp://orgmode.org/a exalting new emacs modehellip; /p -- which is grand. M-x org-export-dispatch h generates: -- p A paragraph about /p p a href=http://orgmode.org;http://orgmode.org/a exalting new emacs modehellip; /p -- which is less grand. I see two needed fixes, reading http://orgmode.org/org.html#Links-in-HTML-export 1. A new /pp should not be inserted before lines starting #+ATTR_HTML. 2. The title attribute needs to go into the a link. Thanks again! -BC Org-mode: 7.8.11 (release_7.8.11-52-g451191) Emacs: 24.1.50.1 Windows 7
Re: [O] org-e-html: Including ATTR_HTML: title=hover text
Also, any chance of getting (parentheses) around a link WITH a title, but without ( extra spaces )? Org input: -- A paragraph about a new mode ( #+ATTR_HTML: title=Link hover text [[./orgmode][org-mode]] ) that is really cool... -- M-x org-export h, generates: -- A paragraph about a new mode ( a href=./orgmode title=Link hover textorg-mode/a ) that is really coolhellip; /p -- which adds the title just fine, but it renders: ( org-mode ) ^^ * Putting the opening parentheses at the start of the #+ATTR_HTML line kills it. * Putting the closing parentheses at the end of the link line: ]]) kills the title attribute. It would be great, though perhaps tricky, for org-e-html to be able to generate a titled link, inside parentheses, WITHOUT extra spaces. But that may be a bridge too far. Thanks for giving it a try! -BC Org-mode: 7.8.11 (release_7.8.11-52-g451191) Emacs: 24.1.50.1 Windows 7 On Wed, Jun 6, 2012 at 7:08 PM, William Crandall bc3141...@gmail.com wrote: Hello Jambunathan and Nicolas, If org-mode source text is: -- A paragraph about #+ATTR_HTML: title=Link hover text [[http://orgmode.org]] exalting new emacs mode... --
Re: [O] Testing: org-export-e-html
Jambunathan, Thanks to you, and Nicolas, for your patience. I now see (blindingly, now that I do see) that the export engine adds the # to internal links, not me. The only trailing issue I see is the soft error of no /a tag on targets (see W3C notes below). This (org): Link and description, to anchor in paragraph: [[bc][BC]] Paragraph with a /dedicated target/: bcBC Exports to (new): p Link and description, to anchor in paragraph: a href=#bcBC/a /p p Paragraph with a idedicated target/i: a id=bc name=bc/BC /p Success! And headlines with a target are also fine: This (org): Link and description, to anchor in headline: [[directors][Directors]] * directorsDirectors Exports to (new): p Link and description, to anchor in headline: a href=#directorsDirectors/a /p div id=outline-container-1 class=outline-2 h2 id=sec-1a id=directors name=directors/Directors/h2 div class=outline-text-2 id=text-1 Success! And I /understand/ how :PROPERTIES: :CUSTOM_ID: directors in a headline, can be linked to with: [[#directors][Directors]], WITH a # that I, not the engine, insert. So I'm good to go! Many thanks. One trailing point: You may want to consider adding a formal closing /a tag for target elements (as the old engine does) rather than just self-closing the a tag with a /. A Firefox comment (viewing source) caught my attention: Self-closing syntax (/) used on a non-void HTML element. Ignoring the slash and treating as a start tag. Then I found this: http://www.w3.org/TR/html-markup/syntax.html#syntax-elements A non-void element must have an end tag, unless the subsection for that element in the HTML elements section of this reference indicates that its end tag can be omitted. And this: http://www.w3.org/TR/html-markup/a.html#a-tags An a element must have both a start tag and an end tag. -- I take all of this to mean that it would be best to use /a closing tags, rather than self-closing an a ... with a /. But again, the way it is works for me. Many thanks. Best of luck on the rest of it! -BC On Fri, Jun 1, 2012 at 10:04 PM, Jambunathan K kjambunat...@gmail.com wrote: Crandall There is some confusion on your end :-).
Re: [O] Testing: org-export-e-html
Hello Jambunathan and Nicolas, Thanks for your recent updates! Links are proving to be quite a challenge. Here is my new test file, and new and old HTML output, comparing the two engines: old: C-c C-e h (org-export, in org-exp.el) new: M-x org-export-dispatch h (in org-export.el) The entire content of test.org: -- - Org (input): Link and description, to anchor in headline: [[#directors][Directors]] Link and description, to anchor in paragraph: [[#bc][BC]] * directorsDirectors Paragraph with a /dedicated target/: bc -[end] -- Reading the Manual (7.8.11), Section 4.2, this org code should, I think, export exactly as the old engine does it, with anchor href's linking to two targets (Firefox renders it perfectly): -- - Old HTML (output): p Link and description, to anchor in headline: a href=#directorsDirectors/a /p p Link and description, to anchor in paragraph: a href=#bcBC/a /p div id=outline-container-1 class=outline-2 h2 id=sec-1a name=directors class=targetdirectors/a Directors/h2 div class=outline-text-2 id=text-1 p Paragraph with a idedicated target/i: a name=bc class=targetbc/a BC /p /div /div -[end] -- The old engine is fine (if attuned to HTML4 more than HTML5). Here is the new output (Org-mode release_7.8.11-32-g02f3ee). -- - New HTML (output): p Link and description, to anchor in headline: iDirectors/i /p p Link and description, to anchor in paragraph: iBC/i /p div id=outline-container-1 class=outline-2 h2 id=sec-1a id=directors name=directors/Directors/h2 div class=outline-text-2 id=text-1 p Paragraph with a idedicated target/i: a id=bc name=bc/BC /p /div /div -[end] -- I see four discrepancies, in two groups: 1. Both links out (first two p's), to id's in an h and a p, do not generate links (a href=#foofoo/a). 2. At both anchors, a, in the h2 and the p, the a tag is not closed with an /a. This may be related to the errors noted in point one, as the HTML is malformed without them. I *really like* the direction the new engine is heading, with id attributes in a tags, and making the target non-visible. And tighter spacing. All good stuff! Many thanks for doing the heavy lifting! I look forward to your next commits. -BC Org-mode: 7.8.11 (release_7.8.11-32-g02f3ee) Emacs: 24.1.50.1 Windows 7 On Fri, Jun 1, 2012 at 9:38 AM, Nicolas Goaziou n.goaz...@gmail.com wrote: Hello, William Crandall bc3141...@gmail.com writes:
Re: [O] Testing: org-export-e-html
Hello Jambunathan, UTF-8! Yes! Many thanks. Now: ?xml version=1.0 encoding=utf-8? Still snagging on targets and links. Will detail in next message. -BC Org-mode: 7.8.11 (release_7.8.11-24-g4144c5) Emacs: 24.1.50.1 Windows 7 On Wed, May 30, 2012 at 11:42 PM, Jambunathan K kjambunat...@gmail.comwrote: But first line of test.html: ?xml version=1.0 encoding=iso-8859-1? This is fixed. Please pull again. There was one another issue: Heading with CUSTOM_IDS were not getting the associated property as an anchor. This is also fixed. Issues wrt images links and target links are still *pending*. Hopefully, it will be fixed in the next iteration.
Re: [O] Testing: org-export-e-html
Hello Nicolas, To wrap my neurons around linking, I made a small test batch. There appear to be several difference between the old HTML export engine and the current version of the new. Testing org-to-HTML export: old: C-c C-e h (org-export, in org-exp.el) new: M-x org-export-dispatch h (in org-export.el) Four input permutations: 1. [[directors]] 2. [[#directors]] 3. [[directors][Directors]] 4. [[#directors][Directors]] As I see it (do let me know what I'm getting wrong!), the old version gets all links right. (But old makes one error(?) see next section.) 1. [[directors]] old: a href=#sec-1directors/a new: idirectors/i 2. [[#directors]] old: a href=#directors#directors/a new: a href=#sec-1Directors/a 3. [[directors][Directors]] old: a href=#sec-1Directors/a new: iDirectors/i 4. [[#directors][Directors]] old: a href=#directorsDirectors/a new: a href=#sec-1Directors/a In no case is the output the same! #4 would be most useful for my purposes, as it allows identifying target links precisely. -- Turning to the output for targets, the new version does not close the a tag (as the old version does). Other than that, new seems fine. (Old generates a pre section from the PROPERTIES drawer, whether it is open or closed, with your encoding. Not my focus, but is this an old bug?) Org-mode input: * Directors :PROPERTIES: :CUSTOM_ID: directors :END: HTML output: old: div id=outline-container-directors class=outline-2 h2 id=directorsa name=sec-1 id=sec-1/aDirectors/h2 div class=outline-text-2 id=text-directors pre class=example PROPERTIES :CUSTOM_ID: directors /pre new: div id=outline-container-directors class=outline-2 h2 id=directorsa id=sec-1 name=sec-1/Directors/h2 div class=outline-text-2 id=text-directors [no pre section] -- Thanks again for moving this forward! -BC Org-mode: 7.8.11 (release_7.8.11-24-g4144c5) Emacs: 24.1.50.1 Windows 7 -- Full text excerpts follow:input(org) / output(new) / output(old) -- Input (org-mode) -- #+OPTIONS: H:3 -:t *:t #+OPTIONS: num:nil toc:nil #+OPTIONS: :nil timestamp:nil #+OPTIONS: author:nil creator:nil This is the first paragraph, before any links or sections. First try, with only word {{directors}}: [[directors]] Second, with word and hash {{#directors}}: [[#directors]] Third, with word and target, {{directors}{Directors}}: [[directors][Directors]] Fourth, hash-word and target, {{#directors}{Directors}}: [[#directors][Directors]] A blank, spacer paragraph, before the target. * Directors :PROPERTIES: :CUSTOM_ID: directors :END: Just to end, a closing paragraph. -- Output (new engine) (Also: two extra blank-lines before each p): -- p This is the first paragraph, before any links or sections. /p p First try, with only word {{directors}}: idirectors/i /p p Second, with word and hash {{#directors}}: a href=#sec-1Directors/a /p p Third, with word and target, {{directors}{Directors}}: iDirectors/i /p p Fourth, hash-word and target, {{#directors}{Directors}}: a href=#sec-1Directors/a /p p A blank, spacer paragraph, before the target. /p div id=outline-container-directors class=outline-2 h2 id=directorsa id=sec-1 name=sec-1/Directors/h2 div class=outline-text-2 id=text-directors p Just to end, a closing paragraph. /p /div /div -- Output (old engine): -- pThis is the first paragraph, before any links or sections. /p p First try, with only word {{directors}}: a href=#sec-1directors/a /p p Second, with word and hash {{#directors}}: a href=#directors#directors/a /p p Third, with word and target, {{directors}{Directors}}: a href=#sec-1Directors/a /p p Fourth, hash-word and target, {{#directors}{Directors}}: a href=#directorsDirectors/a /p p A blank, spacer paragraph, before the target. /p div id=outline-container-directors class=outline-2 h2 id=directorsa name=sec-1 id=sec-1/aDirectors/h2 div class=outline-text-2 id=text-directors pre class=example PROPERTIES :CUSTOM_ID: directors /pre p Just to end, a closing paragraph. /p/div /div -[end] On Thu, May 31, 2012 at 5:08 AM, Nicolas Goaziou n.goaz...@gmail.comwrote: Hello, [...] Again, #crandall syntax should be used to target an headline with crandall as value for its custom-id property. See section 4.2 in the manual. --8---cut
[O] Testing: org-export-e-html (was: Drupal syntax on html-export)
Hello Nicolas and Jambunathan, Thanks again for your responses to my questions. I report some success and some in process. 1. Stylesheet attachment (with #+STYLE:) works fine now. 2. Your special string example (replace-regexp-in-string), Nicolas, as well as the better entity solution (\trade), both work splendidly. I'm looking now at three issues. Please let me know what I can/should change. Thanks again for this new export engine! Cheers, -BC Testing: M-x org-export-dispatch h Org-mode: 7.8.11 (release_7.8.11-18-g244331) Emacs: 24.1.50.1 Windows 7 -- 1. UTF-8 XML Encoding In my init.el: (setq org-e-html-coding-system 'utf-8) But first line of test.html: ?xml version=1.0 encoding=iso-8859-1? In test.org: org-e-html-coding-system is a variable defined in `org-e-html.el'. Its value is utf-8 Original value was nil Documentation: Coding system for HTML export. Use `org-export-coding-system' as the default value. And: buffer-file-coding-system is a variable defined in `C source code'. Its value is utf-8-dos Local in buffer 6-test.org; global value is utf-8-dos -- 2a. Internal HTML links (#) Neither links nor destinations make it into the html. This: an internal section link [[#directors][Directors]]. becomes: an internal section link: iDirectors/i. Was expecting (without italics): an internal section link: a href=#directorsDirectors/a 2b. This target: # directors * A First Section becomes: div id=outline-container-1 class=outline-2 h2 id=sec-1A First Section/h2 div class=outline-text-2 id=text-1 Was expecting: div id=outline-container-1 class=outline-2 h2 id=sec-1a name=directors id=directors/aA First Section/h2 div class=outline-text-2 id=text-1 -- 3. Image and file prefixes are as they were. This (image): [[/sites/a.png]] becomes: img src=g:/sites/a.png/ And this (file): [[/sites/my-file][My link]] becomes: a href=file://g:/sites/my-fileMy link/a I'd love an option to change it not for both, so that neither g: nor file://g: is added to / I could strip them out, after exporting, but I think this is an option that others would also value. (External links, to an http://...;, work fine.) --[end]--- On Sun, May 27, 2012 at 9:00 AM, William Crandall bc3141...@gmail.comwrote: Hello Nicolas and Jambunathan, Many thanks, to you both, for such quick and detailed responses!
Re: [O] Testing: org-export-e-html
Thanks Sebastien! Sometimes its the smallest things; in this case . A single point, and figures work in my setup. That is: [[./sites/a.png]] becomes: img src=./sites/a.png alt=a.png/ -- Alas, FILES do not now behave the same way. Using M-x org-export-dispatch h this: [[./sites/my-file][My link]] becomes: a href=file://./sites/my-fileMy link/a So, org-export-dispatch (on Windows), adds file:// if the first char is ., and it adds file://g: if the first char is /. (With g: the root drive letter.) Still hoping for a switch that will add [nothing]. +1 for solving the img challenge! -BC Hi William, William Crandall wrote: * 3. Image and file prefixes are as they were.* * This (image):* *[[/sites/a.png]]* * becomes:* *img src=g:/sites/a.png/* * And this (file):* *[[/sites/my-file][My link]]* * becomes:* *a href=file://g:/sites/my-fileMy link/a* * I'd love an option to change it not for both, so that* * neither g: nor file://g: is added to /* * I could strip them out, after exporting, but I think* * this is an option that others would also value.* * (External links, to an http://...;;, work fine.)* A quick note on this one: I think adding . does work, so use ./sites/a.png instead. Dunno if that suits your need, though. Best regards, Seb -- Sebastien Vauban
Re: [O] Testing: org-export-e-html
Hello Nicolas, Thanks for clarifying link syntax. I think I'm more than half way there! I can now create targets/destinations: This: ** crandallBC Crandall becomes: h3 id=sec-1-1a id=crandall name=crandall/BC Crandall/h3 As expected. But creating a link TO that id target eludes me. This: [[#crandall][BC Crandall]] becomes: iBC Crandall/i Was expecting: a href=#crandallBC Crandall/a I was expecting that link (not italicized) because of the a id=crandall/ in the h3, in that file. Sorry if I'm being obtuse here! Thanks again for your help, -BC Hello, William Crandall address@hidden writes: * 2a. Internal HTML links (#)* * Neither links nor destinations make it into the html.* * This:* * an internal section link [[#directors][Directors]].* * becomes:* *an internal section link: iDirectors/i.* * Was expecting (without italics):* *an internal section link: a href=#directorsDirectors/a* I think your mixing up syntax here: # stands for custom-id links. In other words, [[#directors][Directors]] is a link pointing to an headline whose CUSTOM-ID property is directors. If there's no such headline, it will return Directors italicized. If you're targeting an headline, provide it an appropriate CUSTOM-ID. Otherwise, just use a target. * 2b. This target:* *# directors* ** A First Section* * becomes:* *div id=outline-container-1 class=outline-2* *h2 id=sec-1A First Section/h2* *div class=outline-text-2 id=text-1* * Was expecting:* *div id=outline-container-1 class=outline-2* *h2 id=sec-1a name=directors id=directors/aA First* * Section/h2* *div class=outline-text-2 id=text-1* # target syntax has been dropped since every target is now invisible. Use : * directors A First Section instead. Regards, -- Nicolas Goaziou
Re: [O] Windows (Cygwin) make: Works, but org-release(void)
Thanks Jonathan! Yes, I had commented out =(require 'org-install)= . I'd taken the FAQ instructions for ELPA installations to apply more broadly than they do: ;; Functionality of Org-mode's org-install.el is supplanted by ;; Package Manager's org-autoloads.el. Since Package Manager ;; autoloads Org-mode, the following line (require 'org-install) in ;; your .emacs is no longer required and can be safely removed. http://orgmode.org/worg/org-faq.html Now M-x org-version gives (correctly): Org-mode version 7.8.11 (release_7.8.11-16-ge67734 @ g:/dev/bin/emacs/.emacs.d/org-7.8.11-dev/lisp/) Thanks again! -BC On Tue, May 29, 2012 at 5:29 AM, Jonathan Leech-Pepin jonathan.leechpe...@gmail.com wrote: Hello, I haven't had any issues with Org and Cygwin lately. I did however come across this issue on a fresh install of Debian last week. I was able to resolve it by adding =(require 'org-install)= to the initialization (or calling it manually from the *scratch* buffer) before checking the version. Do you have (require 'org-install) in your initialization file already? And if not does it fix the issue? Regards, Jonathan On Tue, May 29, 2012 at 1:15 AM, William Crandall bc3141...@gmail.com wrote: Hello, I know this has been an issue: http://lists.gnu.org/archive/html/emacs-orgmode/2012-05/msg00552.html http://lists.gnu.org/archive/html/emacs-orgmode/2012-04/msg01144.html So I was glad to get Cygwin to make the current org-mode master (git), seemingly with success. But restarting emacs brings up: Debugger entered--Lisp error: (void-function org-release) org-release() org-version() (if (fboundp (quote org-version)) (org-version) (Unknown)) (format Generated by Org mode %s in Emacs %s. (if (fboundp (quote org-version)) (org-version) (Unknown)) emacs-version) eval((format Generated by Org mode %s in Emacs %s. (if (fboundp (quote org-version)) (org-version) (Unknown)) emacs-version))
Re: [O] Drupal syntax on html-export for image links
Hello Nicolas and Jambunathan, Many thanks, to you both, for such quick and detailed responses! I look forward to checking things out later today. And yes, +1 to Bastien for recommending! Regarding your notes on image and file paths: JK I will respond to 3 and 4 separately. I need to look at JK this area closely. (I know nothing about HTML or HTML exporter.) JK What is g:/ here. Is it the publishing directory or JK the current directory. Given that, does removing the leading JK g:/ a specific requirement of yours or is it generally useful JK to anyone. The g:/ is a Windows artifact, indicating the drive. On Unix systems, root / is unique; on Windows there can be many drives indicated by letters at the root (c:/, d:/, .. z:/). The most common default for first hard disk is c:/, but other letters are often used. http://en.wikipedia.org/wiki/Drive_letter_assignment I think that it would be generally useful to be able to remove the drive letter, so that c:/ or g:/ is transposed into just / so that when the link-string is passed to a publishing system, such as Drupal, it can easily digest it for further processing. Thanks again for all your work on this! -BC On Sun, May 27, 2012 at 5:37 AM, Jambunathan K kjambunat...@gmail.comwrote: The exporter is new. Needless to say there are bugs, known and unknown. (Think, Rome wasn't built in a day) [. . .] 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-fileMy link/a How can I keep the path as it was, and get this: a href=/sites/my-fileMy link/a without file://g: -- I will respond to 3 and 4 separately. I need to look at this area closely. (I know nothing about HTML or HTML exporter.) What is g:/ here. Is it the publishing directory or the current directory. Given that, does removing the leading g:/ a specific requirement of yours or is it generally useful to anyone.
Re: [O] Drupal syntax on html-export for image links
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-fileMy link/a How can I keep the path as it was, and get this: a href=/sites/my-fileMy 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 b...@gnu.org wrote: Hi William, William Crandall bc3141...@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
[O] Drupal syntax on html-export for image links
Hello, I'm drafting pages for publication on a Drupal website. I've set up a draft-review cycle using Org-mode and some simplified CSS, for a light-weight type-and-read process. When I'm happy with the text, I'd like to cut-and-paste from the generated html output directly into Drupal. Links to external http files work fine, but image links (and internal links) are confounding me. -- 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 / Which really won't do. Before hauling out my wheel-creation tools, has anyone created a Drupal-link type for Org-mode? Or some other solution? -- I found one Drupal thread in the archives: http://lists.gnu.org/archive/html/emacs-orgmode/2009-11/msg00473.html But I don't need or want to push the button and publish. I'd just like to modify the html-export output for images. (And then adapt that to internal links.) -- Thanks for any suggestions or references. And for Org-mode, which is great! -BC Org-mode: 7.8.09 Emacs: 24.1.50.1 Windows 7