Re: [O] Support Freemind/Freeplane export
On 03/03/2013 08:33 PM, François Pinard wrote: Jambunathan K kjambunat...@gmail.com writes: How many people are going to read HTML code? [...] In short, the concern you have raised is more cosmetic than functional. Replying to the org-mode mailing list. I did not closely followed the discussion, so maybe I'm missing the point. A lot of people are not going to read HTML, but it does not mean that nobody does. Many people still read HTML code, for a variety of reasons. I find HTML code should stay as legible as possible. I agree. I read the HTML code that org generates and there other are people who read the same code and don't use org. Legibility of the code generated by org is a necessity for me. Scott Randby
Re: [O] Support Freemind/Freeplane export
Bastien writes: Also, the change in ox-html.el is not good IMHO: it will populate everyone's HTML code with unfamiliar strings (like #xa0; instead of nbsp;) just for the sake of keeping ox-freemind.el users happy. It also requires that the HTML is output in UTF-8. I would (reluctantly, I don't really know much about how this would work) suggest that the export should always be done with symbolic entities and a post-export filter should then replace them with whatever the particular backend prefers. Does that work? Regards, Achim. -- +[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+ SD adaptation for Waldorf microQ V2.22R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada
Re: [O] Support Freemind/Freeplane export
Achim Gratz strom...@nexgo.de writes: It also requires that the HTML is output in UTF-8. I would (reluctantly, I don't really know much about how this would work) suggest that the export should always be done with symbolic entities and a post-export filter should then replace them with whatever the particular backend prefers. Does that work? This seems a good idea to me. Nicolas, do you think so? -- Bastien
Re: [O] Support Freemind/Freeplane export
Bastien b...@altern.org writes: Achim Gratz strom...@nexgo.de writes: It also requires that the HTML is output in UTF-8. I would (reluctantly, I don't really know much about how this would work) suggest that the export should always be done with symbolic entities and a post-export filter should then replace them with whatever the particular backend prefers. Does that work? This seems a good idea to me. Nicolas, do you think so? Yes. We can add a defconst associating each HTML entity to its utf-8 counterpart, and add a filter to :filter-final-output in freemind back-end definition (not to `org-export-filter-final-output-functions', which is user-oriented). Any taker? Jambunathan? Regards, -- Nicolas Goaziou
Re: [O] Support Freemind/Freeplane export
Nicolas Goaziou n.goaz...@gmail.com writes: Bastien b...@altern.org writes: Achim Gratz strom...@nexgo.de writes: It also requires that the HTML is output in UTF-8. I would (reluctantly, I don't really know much about how this would work) suggest that the export should always be done with symbolic entities and a post-export filter should then replace them with whatever the particular backend prefers. Does that work? This seems a good idea to me. Nicolas, do you think so? Yes. We can add a defconst associating each HTML entity to its utf-8 counterpart, and add a filter to :filter-final-output in freemind back-end definition (not to `org-export-filter-final-output-functions', which is user-oriented). Any taker? Jambunathan? Please merge , http://repo.or.cz/w/org-mode/org-kjn.git | | URL git://repo.or.cz/org-mode/org-kjn.git | http://repo.or.cz/r/org-mode/org-kjn.git | ` I will submit more changes to ox-html.el and ox-odt.el. It's going to some time though. ps: I have a feeling that `org-html-display-buffer-mode' is superfluous. A simple `set-auto-mode' will do the trick. , | kjambunathan@debian-6:~/src/org-mode$ git log upstream/master.. | commit b8d0b1ae89bd769a898aba90f6c85c680963e0ed | Author: Jambunathan K kjambunat...@gmail.com | Date: Sun Mar 3 20:21:07 2013 +0530 | | doc/org.texi: Replace org-export-odt with org-odt | | commit c5d46d21b5a3f902cfd7b9d709660b493f67bd94 | Author: Jambunathan K kjambunat...@gmail.com | Date: Sun Mar 3 20:15:10 2013 +0530 | | Always use utf-8 encoding for HTML export | | * ox-html.el (org-html-coding-system): Removed. Always use | utf-8 for HTML export. | (org-html--build-meta-info, org-html-template) | (org-html-entity, org-html-export-to-html): Propagate above | change. | (org-html-table--table.el-table): Replace nbsp; with it's | utf-8 equivalent. | (org-html-special-string-regexps, org-html--tags) | (org-html-format-headline, org-html--format-toc-headline) | (org-html-checkbox, org-html-table-cell, org-html-timestamp) | (org-html-verse-block): Replace numeric entities with their | utf-8 equivalent. | | Mark ox-html.el as utf-8 encoded. | | commit 75708cf644944d301e57bc343db8749b8fa3c242 | Author: Jambunathan K kjambunat...@gmail.com | Date: Sun Mar 3 13:51:32 2013 +0530 | | ox-html.el (org-html-code, org-html-verbatim): Transcode value | | * lisp/ox-html.el (org-html-code, org-html-verbatim): | Transcode value. ` Regards, --
Re: [O] Support Freemind/Freeplane export
Jambunathan K kjambunat...@gmail.com writes: Nicolas Goaziou n.goaz...@gmail.com writes: Bastien b...@altern.org writes: Achim Gratz strom...@nexgo.de writes: It also requires that the HTML is output in UTF-8. I would (reluctantly, I don't really know much about how this would work) suggest that the export should always be done with symbolic entities and a post-export filter should then replace them with whatever the particular backend prefers. Does that work? This seems a good idea to me. Nicolas, do you think so? Yes. We can add a defconst associating each HTML entity to its utf-8 counterpart, and add a filter to :filter-final-output in freemind back-end definition (not to `org-export-filter-final-output-functions', which is user-oriented). Any taker? Jambunathan? Please merge , http://repo.or.cz/w/org-mode/org-kjn.git | | URL git://repo.or.cz/org-mode/org-kjn.git | http://repo.or.cz/r/org-mode/org-kjn.git | ` Sorry for the double post. Here comes the patch file(s). From 75708cf644944d301e57bc343db8749b8fa3c242 Mon Sep 17 00:00:00 2001 From: Jambunathan K kjambunat...@gmail.com Date: Sun, 3 Mar 2013 13:51:32 +0530 Subject: [PATCH 1/3] ox-html.el (org-html-code, org-html-verbatim): Transcode value * lisp/ox-html.el (org-html-code, org-html-verbatim): Transcode value. --- lisp/ox-html.el |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index a0f3f4f..3a4c0e7 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1899,7 +1899,7 @@ channel. CONTENTS is nil. INFO is a plist holding contextual information. (format (or (cdr (assq 'code org-html-text-markup-alist)) %s) - (org-element-property :value code))) + (org-html-plain-text (org-element-property :value code) info))) Drawer @@ -3029,7 +3029,7 @@ holding contextual information. CONTENTS is nil. INFO is a plist holding contextual information. (format (or (cdr (assq 'verbatim org-html-text-markup-alist)) %s) - (org-element-property :value verbatim))) + (org-html-plain-text (org-element-property :value verbatim) info))) Verse Block -- 1.7.2.5 From c5d46d21b5a3f902cfd7b9d709660b493f67bd94 Mon Sep 17 00:00:00 2001 From: Jambunathan K kjambunat...@gmail.com Date: Sun, 3 Mar 2013 20:15:10 +0530 Subject: [PATCH 2/3] Always use utf-8 encoding for HTML export * ox-html.el (org-html-coding-system): Removed. Always use utf-8 for HTML export. (org-html--build-meta-info, org-html-template) (org-html-entity, org-html-export-to-html): Propagate above change. (org-html-table--table.el-table): Replace nbsp; with it's utf-8 equivalent. (org-html-special-string-regexps, org-html--tags) (org-html-format-headline, org-html--format-toc-headline) (org-html-checkbox, org-html-table-cell, org-html-timestamp) (org-html-verse-block): Replace numeric entities with their utf-8 equivalent. Mark ox-html.el as utf-8 encoded. --- lisp/ox-html.el | 55 +-- 1 files changed, 21 insertions(+), 34 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 3a4c0e7..efd9b2f 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -136,10 +136,10 @@ (defvar htmlize-buffer-places) ; from htmlize.el (defconst org-html-special-string-regexps - '((- . #x00ad;) ; shy -(---\\([^-]\\) . #x2014;\\1) ; mdash -(--\\([^-]\\) . #x2013;\\1) ; ndash -(\\.\\.\\. . #x2026;)) ; hellip + '((- . ) ; shy +(---\\([^-]\\) . —\\1) ; mdash +(--\\([^-]\\) . –\\1) ; ndash +(\\.\\.\\. . …)) ; hellip Regular expressions for special string conversion.) (defconst org-html-scripts @@ -821,12 +821,6 @@ and corresponding declarations. (cons (string :tag Extension) (string :tag Declaration) -(defcustom org-html-coding-system 'utf-8 - Coding system for HTML export. -Use utf-8 as the default value. - :group 'org-export-html - :type 'coding-system) - (defcustom org-html-divs '(preamble content postamble) The name of the main divs for HTML export. This is a list of three strings, the first one for the preamble @@ -1337,12 +1331,7 @@ INFO is a plist used as a communication channel. (keywords (plist-get info :keywords))) (concat (format title%s/title\n title) - (format - meta http-equiv=\Content-Type\ content=\text/html;charset=%s\/\n - (or (and org-html-coding-system - (fboundp 'coding-system-get) - (coding-system-get org-html-coding-system 'mime-charset)) - iso-8859-1)) + meta http-equiv=\Content-Type\ content=\text/html;charset=utf-8\/\n (format meta name=\title\ content=\%s\/\n title) (format meta name=\generator\ content=\Org-mode\/\n) (and date (format meta name=\generated\ content=\%s\/\n date)) @@ -1515,10 +1504,7 @@ holding export options. (cdr (assoc html org-html-xml-declaration)) ) -(or (and org-html-coding-system - (fboundp 'coding-system-get) -
Re: [O] Support Freemind/Freeplane export
Jambunathan K kjambunat...@gmail.com writes: ps: I have a feeling that `org-html-display-buffer-mode' is superfluous. A simple `set-auto-mode' will do the trick. Indeed, I applied a patch using `set-auto-mode'. Thanks for the suggestion! -- Bastien
Re: [O] Support Freemind/Freeplane export
Bastien b...@altern.org writes: Also, the change in ox-html.el is not good IMHO: it will populate everyone's HTML code with unfamiliar strings (like #xa0; instead of nbsp;) just for the sake of keeping ox-freemind.el users happy. How many people are going to read HTML code? There is correctness and there is readability. Those who actually read HTML code better know what they are looking at. Remember the character in question are occurring here and there and not everywhere. Adding a filter function will only add a moving part. It could be a robust moving part, but it is a moving part nevertheless. In short, the concern you have raised is more cosmetic than functional. --
Re: [O] Support Freemind/Freeplane export
Jambunathan K kjambunat...@gmail.com writes: In short, the concern you have raised is more cosmetic than functional. I trust you. The thing is, I have this small incertainty in my mind on whether there is something functional involved here or not. Also, IIUC the change is triggered only because ox-freemind.el needs it, so the little incertainty + why it's needed makes me think twice. Is it fine to assume that all users want utf8 for their HTML files? If so, I'm fine with the patch. I'm just asking confirmation from (other) HTML/coding system experts. Achim, what do you think? (The local variable coding: utf-8 should be coding: utf-8-emacs I think.) -- Bastien
Re: [O] Support Freemind/Freeplane export
Jambunathan K kjambunat...@gmail.com writes: Jambunathan K kjambunat...@gmail.com writes: Nicolas Goaziou n.goaz...@gmail.com writes: Bastien b...@altern.org writes: Achim Gratz strom...@nexgo.de writes: It also requires that the HTML is output in UTF-8. I would (reluctantly, I don't really know much about how this would work) suggest that the export should always be done with symbolic entities and a post-export filter should then replace them with whatever the particular backend prefers. Does that work? This seems a good idea to me. Nicolas, do you think so? Yes. We can add a defconst associating each HTML entity to its utf-8 counterpart, and add a filter to :filter-final-output in freemind back-end definition (not to `org-export-filter-final-output-functions', which is user-oriented). Any taker? Jambunathan? Please merge , http://repo.or.cz/w/org-mode/org-kjn.git | | URLgit://repo.or.cz/org-mode/org-kjn.git |http://repo.or.cz/r/org-mode/org-kjn.git | ` Sorry for the double post. Here comes the patch file(s). I have applied the first patch (about verbatim and code markup), the other one still being debated. Thank you. Regards, -- Nicolas Goaziou
Re: [O] Support Freemind/Freeplane export
Jambunathan K kjambunat...@gmail.com writes: How many people are going to read HTML code? [...] In short, the concern you have raised is more cosmetic than functional. Replying to the org-mode mailing list. I did not closely followed the discussion, so maybe I'm missing the point. A lot of people are not going to read HTML, but it does not mean that nobody does. Many people still read HTML code, for a variety of reasons. I find HTML code should stay as legible as possible. As long as legibility is at stake, character entities are a pain in the neck (or anywhere else of your choice along the spine!). So, if the charset of the HTML can be ascertained, usually within the headers, the remainder of the HTML file should take full advantage of it, and limit character entities as much as possible. Character set entities are meaningful when the HTML file does not declare a charset. They should be avoided otherwise, in my opinion. François
Re: [O] Support Freemind/Freeplane export
Hello, Jambunathan K kjambunat...@gmail.com writes: I have added support for Freemind/Freeplane Mindmap export. I am attaching sample files produced with the new exporter. You are welcome to merge the changes to Org repo. Done. Thank you! Regards, -- Nicolas Goaziou
Re: [O] Support Freemind/Freeplane export
Hi Nicolas, Nicolas Goaziou n.goaz...@gmail.com writes: I have added support for Freemind/Freeplane Mindmap export. I am attaching sample files produced with the new exporter. You are welcome to merge the changes to Org repo. Done. Thank you! We encourage contributors without commit access to share patches on the list so that everyone can review and test them. Let's stick to this policy and avoid applying patches that have been sent in private -- I always ask people who send me patches in private to send them to the list. Also, the change in ox-html.el is not good IMHO: it will populate everyone's HTML code with unfamiliar strings (like #xa0; instead of nbsp;) just for the sake of keeping ox-freemind.el users happy. Is there no other way to get the same result for the Freemind export? Thanks, -- Bastien
Re: [O] Support Freemind/Freeplane export
Bastien b...@altern.org writes: We encourage contributors without commit access to share patches on the list so that everyone can review and test them. Ignore this, I just received Jambunathan contribution on the list. Thanks for applying it, and thanks for the patch Jambunathan. I'm still wondering if we can use nbsp; instead of the numeric representation. Jambunathan, do you have any idea? -- Bastien