Re: [Orgmode] html export
Eric Schulte wrote: > Hi Tom, > > "Thomas S. Dye" writes: > > > Aloha all, > > > > Exporting this small file to html here doesn't put a caption on the > > figure. > > > > * No caption > > > > #+CAPTION: Histogram of adze weights on a logarithmic scale > > #+LABEL: fig:wt-log > > > > [[file:~/Public/projects/903_adzes/r/sr-nb-scatter.png]] > > > > Does anyone else see this? > > > > Try removing the empty line between the #+LABEL:... line and the > [[file:... line, that worked for me. or rather the following worked for > me > > * No caption > > #+CAPTION: Histogram of adze weights on a logarithmic scale > #+LABEL: fig:wt-log > [[file:graph.png]] > > > also, if the file doesn't exist, then neither the file, nor the label or > caption will export. > I can't get it to work with or without the empty line: Org-mode version 6.36trans (release_6.36.264.g74d3) Be that as it may, I compared the html export code with the latex export code and it seems to me that the caption is calculated too late in the html code: it's done in org-export-html-format-image by looking for the org-caption text property on its ``src'' argument, but afaict, the argument is just a string - no text properties. I tried the following patch, which makes the html caption handling look a bit more like what the latex exporter does, and it seems to work in this case, but I have not tested it any further. Thanks, Nick diff --git a/lisp/org-html.el b/lisp/org-html.el index d5809ab..73cba14 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -621,7 +621,8 @@ MAY-INLINE-P allows inlining it as an image." opt-plist components-1) components-1)) (type(first components-2)) - (thefile (second components-2))) + (thefile (second components-2)) + (caption (org-find-text-property-in-string 'org-caption path))) ;;Third pass. Build final link except for leading type @@ -651,7 +652,7 @@ MAY-INLINE-P allows inlining it as an image." (not fragment)) (progn (message "image %s %s" thefile org-par-open) - (org-export-html-format-image thefile org-par-open)) + (org-export-html-format-image thefile caption org-par-open)) (concat "" (org-export-html-format-desc desc) @@ -1674,14 +1675,13 @@ lang=\"%s\" xml:lang=\"%s\"> (org-html-do-expand s)) s)) -(defun org-export-html-format-image (src par-open) +(defun org-export-html-format-image (src caption par-open) "Create image tag with source and attributes." (save-match-data (if (string-match "^ltxpng/" src) (format "" src (org-find-text-property-in-string 'org-latex-src src)) - (let* ((caption (org-find-text-property-in-string 'org-caption src)) -(attr (org-find-text-property-in-string 'org-attributes src)) + (let* ((attr (org-find-text-property-in-string 'org-attributes src)) (label (org-find-text-property-in-string 'org-label src))) (setq caption (and caption (org-html-do-expand caption))) (concat ___ 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
Re: [Orgmode] html export
Hi Tom, "Thomas S. Dye" writes: > Aloha all, > > Exporting this small file to html here doesn't put a caption on the > figure. > > * No caption > > #+CAPTION: Histogram of adze weights on a logarithmic scale > #+LABEL: fig:wt-log > > [[file:~/Public/projects/903_adzes/r/sr-nb-scatter.png]] > > Does anyone else see this? > Try removing the empty line between the #+LABEL:... line and the [[file:... line, that worked for me. or rather the following worked for me --8<---cut here---start->8--- * No caption #+CAPTION: Histogram of adze weights on a logarithmic scale #+LABEL: fig:wt-log [[file:graph.png]] --8<---cut here---end--->8--- also, if the file doesn't exist, then neither the file, nor the label or caption will export. > > All of a sudden, I'm having the devil's own time with html export. I > made small changes to a large export project file and was surprised > when none of the links were exported. The project has been exporting > perfectly for months now. > I agree it seems that the html export has been a little bit less stable as of late. Best -- Eric > > All the best, > Tom > > > > ___ > 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 ___ 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
[Orgmode] html export
Aloha all, Exporting this small file to html here doesn't put a caption on the figure. * No caption #+CAPTION: Histogram of adze weights on a logarithmic scale #+LABEL: fig:wt-log [[file:~/Public/projects/903_adzes/r/sr-nb-scatter.png]] Does anyone else see this? All of a sudden, I'm having the devil's own time with html export. I made small changes to a large export project file and was surprised when none of the links were exported. The project has been exporting perfectly for months now. All the best, Tom ___ 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
Re: [Orgmode] restart numbering
On Sat, 19 Jun 2010 18:00:46 +0100, Dave Pawson wrote: > > http://orgmode.org/manual/Plain-lists.html#Plain-lists > Tells me that > > 1. [...@start:20]The author adds the metadata > 1. A markup geek adds it, given guidance (from whom?) > > Should start the enumerated list at 20? > > What I'm seeing is > > > [...@start:20]The author adds the metadata > > > A markup geek adds it, given guidance (from whom?) > > > > > Terminates with > HTML generated by org-mode 6.33x in emacs 23 > > is this feature available in 6.33 please? No. It was introduced by commit 3fb4f288 on 26 April of this year which I believe was after 6.35... Definitely works with current Org-mode version 6.36trans (release_6.36.291.gaf90f) -- Eric S Fraga GnuPG: 8F5C 279D 3907 E14A 5C29 570D C891 93D8 FFFC F67D ___ 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
[Orgmode] [PATCH] orphaned captions and labels
Hello, This patch corrects the following problem : - #+caption: I'm not removed from export #+label: also-not-removed | A | B | | 1 | 2 | - Since org-handle-comments is only removing comments, #+caption, #+label and friends were left in the export file. Regards, -- Nicolas 0001-captions-labels-are-now-properly-cleaned-before-expo.patch Description: Binary data ___ 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
[Orgmode] restart numbering
http://orgmode.org/manual/Plain-lists.html#Plain-lists Tells me that 1. [...@start:20]The author adds the metadata 1. A markup geek adds it, given guidance (from whom?) Should start the enumerated list at 20? What I'm seeing is [...@start:20]The author adds the metadata A markup geek adds it, given guidance (from whom?) Terminates with HTML generated by org-mode 6.33x in emacs 23 is this feature available in 6.33 please? TIA -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk ___ 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
[Orgmode] [PATCH] Remove superfluous lambda.
Argh. Just realized that (lambda (e) (car e)) is equivalent to (car e). This one goes on top of the patches. * org-feed.el (org-feed-unescape): Remove superfluous lambda. --- lisp/org-feed.el |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/lisp/org-feed.el b/lisp/org-feed.el index 3edcf1a..cda7368 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -271,8 +271,7 @@ have been saved." (defun org-feed-unescape (s) "Unescape protected entities in S." (let ((re (concat "&\\(" - (mapconcat (lambda (e) -(car e)) xml-entity-alist "\\|") + (mapconcat 'car xml-entity-alist "\\|") "\\);"))) (while (string-match re s) (setq s (replace-match -- 1.7.1 ___ 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
[Orgmode] [PATCH 4/4] Unescape rss element content.
* org-feed.el (org-feed-parse-rss-entry): Unescape rss element content. --- lisp/org-feed.el |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-feed.el b/lisp/org-feed.el index 2621008..e7fd0f2 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -617,7 +617,7 @@ containing the properties `:guid' and `:item-full-text'." nil t) (setq entry (plist-put entry (intern (concat ":" (match-string 1))) -(match-string 2 +(org-feed-unescape (match-string 2) (goto-char (point-min)) (unless (re-search-forward "isPermaLink[ \t]*=[ \t]*\"false\"" nil t) (setq entry (plist-put entry :guid-permalink t @@ -650,8 +650,8 @@ formatted as a string, not the original XML data." 'href))) ;; Add as :title. (setq entry (plist-put entry :title - (car (xml-node-children - (car (xml-get-children xml 'title)) + (org-feed-unescape (car (xml-node-children + (car (xml-get-children xml 'title))) (let* ((content (car (xml-get-children xml 'content))) (type (xml-get-attribute-or-nil content 'type))) (when content -- 1.7.1 ___ 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
[Orgmode] [PATCH] Declare variable `xml-entity-alist' for byte compiler.
* org-feed.el (xml-entity-alist): Declare variable `xml-entity-alist' for byte compiler. --- lisp/org-feed.el |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lisp/org-feed.el b/lisp/org-feed.el index e7fd0f2..3edcf1a 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -99,6 +99,7 @@ (declare-function xml-get-children "xml" (node child-name)) (declare-function xml-get-attribute "xml" (node attribute)) (declare-function xml-get-attribute-or-nil "xml" (node attribute)) +(defvar xml-entity-alist) (defgroup org-feed nil "Options concerning RSS feeds as inputs for Org files." -- 1.7.1 ___ 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
[Orgmode] [PATCH 3/4] Unescape protected entities defined in `xml-entity-alist'.
* org-feed.el (org-feed-unescape): New function. Unescape protected entities. (org-feed-parse-atom-entry): Use function for atom:content type text and html. --- lisp/org-feed.el | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lisp/org-feed.el b/lisp/org-feed.el index b0373e5..2621008 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -267,6 +267,17 @@ have been saved." (defvar org-feed-buffer "*Org feed*" "The buffer used to retrieve a feed.") +(defun org-feed-unescape (s) + "Unescape protected entities in S." + (let ((re (concat "&\\(" + (mapconcat (lambda (e) +(car e)) xml-entity-alist "\\|") + "\\);"))) +(while (string-match re s) + (setq s (replace-match + (cdr (assoc (match-string 1 s) xml-entity-alist)) nil nil s))) +s)) + ;;;###autoload (defun org-feed-update-all () "Get inbox items from all feeds in `org-feed-alist'." @@ -647,10 +658,10 @@ formatted as a string, not the original XML data." (cond ((string= type "text") ;; We like plain text. - (setq entry (plist-put entry :description (car (xml-node-children content) + (setq entry (plist-put entry :description (org-feed-unescape (car (xml-node-children content)) ((string= type "html") ;; TODO: convert HTML to Org markup. - (setq entry (plist-put entry :description (car (xml-node-children content) + (setq entry (plist-put entry :description (org-feed-unescape (car (xml-node-children content)) ((string= type "xhtml") ;; TODO: convert XHTML to Org markup. (setq entry (plist-put entry :description (prin1-to-string (xml-node-children content) -- 1.7.1 ___ 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
[Orgmode] [PATCH 1/4] Respect possible XML namespace of rss:item elements.
* org-feed.el (org-feed-parse-rss-feed): Respect possible XML namespace of rss:item elements. --- lisp/org-feed.el |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org-feed.el b/lisp/org-feed.el index 37b2327..c86ca90 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -583,7 +583,7 @@ containing the properties `:guid' and `:item-full-text'." (with-current-buffer buffer (widen) (goto-char (point-min)) - (while (re-search-forward "" nil t) + (while (re-search-forward ".*?>" nil t) (setq beg (point) end (and (re-search-forward "" nil t) (match-beginning 0))) -- 1.7.1 ___ 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
[Orgmode] [PATCH 2/4] Ignore case of rss element names.
* org-feed.el (org-feed-parse-rss-feed): Ignore case of rss element names. --- lisp/org-feed.el |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/org-feed.el b/lisp/org-feed.el index c86ca90..b0373e5 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -579,7 +579,8 @@ Assumes headers are indeed present!" "Parse BUFFER for RSS feed entries. Returns a list of entries, with each entry a property list, containing the properties `:guid' and `:item-full-text'." - (let (entries beg end item guid entry) + (let ((case-fold-search t) + entries beg end item guid entry) (with-current-buffer buffer (widen) (goto-char (point-min)) -- 1.7.1 ___ 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
[Orgmode] [PATCH 0/4] org-feed: Improve feed parsing
Four patches to improve feed parsing: - respect XML namespace of rss:item elements (fixes reported problem with codeproject.com's feed) - ignore case of rss element names (dto., codeproject uses upper case letters for rss:guid element) - provide and use function to unescape XML entities. Some characters must be escaped for XML transport (e.g. &), they are properly unescaped using `xml-entity-alist' David Maus (4): Respect possible XML namespace of rss:item elements. Ignore case of rss element names. Unescape protected entities defined in `xml-entity-alist'. Unescape rss element content. lisp/org-feed.el | 26 +++--- 1 files changed, 19 insertions(+), 7 deletions(-) ___ 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
[Orgmode] Re: org-feed not working for codeproject
David Maus writes: > zwz wrote: >>I have the feed >>("codeproject" >> "http://www.codeproject.com/webservices/articlerss.aspx?cat=2"; >> "~/feeds.org" "C++ on CodeProject") >>in the org-feed-alist. > >>Everytime I update the feed, I got a new headline "* codeproject" added >>into the file feeds.org without any new items. > > I can reproduce this. Although I get the headline "C++ on CodeProject" > but this one without entries. > > Going to look into this one. > > -- David > Yes, you are right. The new added headline is "C++ on CodeProject". :) And if you try org-feed-update again, a new headline "C++ on CodeProject" is added again without any entries. ___ 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
Re: [Orgmode] org-feed not working for codeproject
zwz wrote: >I have the feed >("codeproject" > "http://www.codeproject.com/webservices/articlerss.aspx?cat=2"; > "~/feeds.org" "C++ on CodeProject") >in the org-feed-alist. >Everytime I update the feed, I got a new headline "* codeproject" added >into the file feeds.org without any new items. I can reproduce this. Although I get the headline "C++ on CodeProject" but this one without entries. Going to look into this one. -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpPDirOpGffw.pgp Description: PGP signature ___ 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