* [PATCH] lisp/ox-html.el: reorder output of meta data in head
@ 2015-06-09 4:48 apersaud
2015-06-09 5:23 ` Arun Persaud
2015-06-09 19:09 ` Nicolas Goaziou
0 siblings, 2 replies; 3+ messages in thread
From: apersaud @ 2015-06-09 4:48 UTC (permalink / raw
To: emacs-orgmode; +Cc: Arun Persaud
From: Arun Persaud <apersaud@lbl.gov>
* lisp/ox-html.el (org-html--build-meta-info ): charset and viewport
meta data should come first in `head'. As mentioned for example in:
- https://code.google.com/p/doctype-mirror/wiki/MetaCharsetAttribute
- http://getbootstrap.com/getting-started/#template
Only reordered output, no other code changes.
TINYCHANGE
---
lisp/ox-html.el | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 75c6993..d50ff5e 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1701,7 +1701,6 @@ INFO is a plist used as a communication channel."
'mime-charset))
"iso-8859-1")))
(concat
- (format "<title>%s</title>\n" title)
(when (plist-get info :time-stamp-file)
(format-time-string
(concat "<!-- "
@@ -1714,6 +1713,20 @@ INFO is a plist used as a communication channel."
"meta" " http-equiv=\"Content-Type\" content=\"text/html;charset=%s\""
info))
charset) "\n"
+ (let ((viewport-options
+ (org-remove-if-not (lambda (cell) (org-string-nw-p (cadr cell)))
+ (plist-get info :html-viewport))))
+ (and viewport-options
+ (concat
+ (org-html-close-tag
+ "meta"
+ (format " name=\"viewport\" content=\"%s\""
+ (mapconcat
+ (lambda (elm) (format "%s=%s" (car elm) (cadr elm)))
+ viewport-options ", "))
+ info)
+ "\n")))
+ (format "<title>%s</title>\n" title)
(org-html-close-tag "meta" " name=\"generator\" content=\"Org-mode\"" info)
"\n"
(and (org-string-nw-p author)
@@ -1736,20 +1749,7 @@ INFO is a plist used as a communication channel."
(format " name=\"keywords\" content=\"%s\""
(funcall protect-string keywords))
info)
- "\n"))
- (let ((viewport-options
- (org-remove-if-not (lambda (cell) (org-string-nw-p (cadr cell)))
- (plist-get info :html-viewport))))
- (and viewport-options
- (concat
- (org-html-close-tag
- "meta"
- (format " name=\"viewport\" content=\"%s\""
- (mapconcat
- (lambda (elm) (format "%s=%s" (car elm) (cadr elm)))
- viewport-options ", "))
- info)
- "\n"))))))
+ "\n")))))
(defun org-html--build-head (info)
"Return information for the <head>..</head> of the HTML output.
--
2.4.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] lisp/ox-html.el: reorder output of meta data in head
2015-06-09 4:48 [PATCH] lisp/ox-html.el: reorder output of meta data in head apersaud
@ 2015-06-09 5:23 ` Arun Persaud
2015-06-09 19:09 ` Nicolas Goaziou
1 sibling, 0 replies; 3+ messages in thread
From: Arun Persaud @ 2015-06-09 5:23 UTC (permalink / raw
To: emacs-orgmode
Hi
just as a quick follow up. I found this earlier message on the topic
http://thread.gmane.org/gmane.emacs.orgmode/84306/focus=84355
I would like to push for a change though. I don't have a test case where
charset doesn't work, but
https://code.google.com/p/doctype-mirror/wiki/MetaCharsetAttribute
claims that a title tag before a charset tag would not work in all
browsers which would be nice and seems easy to fix.
Arun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] lisp/ox-html.el: reorder output of meta data in head
2015-06-09 4:48 [PATCH] lisp/ox-html.el: reorder output of meta data in head apersaud
2015-06-09 5:23 ` Arun Persaud
@ 2015-06-09 19:09 ` Nicolas Goaziou
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2015-06-09 19:09 UTC (permalink / raw
To: apersaud; +Cc: emacs-orgmode
Hello,
apersaud@lbl.gov writes:
> * lisp/ox-html.el (org-html--build-meta-info ): charset and viewport
> meta data should come first in `head'. As mentioned for example in:
> - https://code.google.com/p/doctype-mirror/wiki/MetaCharsetAttribute
> - http://getbootstrap.com/getting-started/#template
> Only reordered output, no other code changes.
Applied. Thank you.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-09 19:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09 4:48 [PATCH] lisp/ox-html.el: reorder output of meta data in head apersaud
2015-06-09 5:23 ` Arun Persaud
2015-06-09 19:09 ` Nicolas Goaziou
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.