Re: [O] Is it possible to add a class to a paragraph in HTML export?

2014-04-17 Thread Bastien
Rick Frankel r...@rickster.com writes:

 A version of this patch using Nicolas' approach has been pushed to
 master.

Thanks!

-- 
 Bastien



Re: [O] Is it possible to add a class to a paragraph in HTML export?

2014-04-16 Thread Rick Frankel
On Wed, Apr 02, 2014 at 09:06:48AM +0200, Nicolas Goaziou wrote:

 If deemed useful, I think this patch should use
 `org-html--make-attribute-string' instead of hard-coding class
 attribute:

   (attributes (org-html--make-attribute-string
(org-export-read-attribute :attr_html paragraph)))

 ...

   (t (format p%s%s\n%s/p attributes extra contents))

 This way, attributes will not be limited to class only. See, for
 example, `org-html-special-block'.

A version of this patch using Nicolas' approach has been pushed to master.

rick



Re: [O] Is it possible to add a class to a paragraph in HTML export?

2014-04-02 Thread Nicolas Goaziou
Hello,

Bastien b...@gnu.org writes:

 +  (class0 (org-export-read-attribute :attr_html paragraph :class))
 +  (class (if class0 (format  class=\%s\ class0)))
(extra (or (cadr (assoc parent-type style)) )))
  (cond
   ((and (eq (org-element-type parent) 'item)
 @@ -2925,7 +2927,7 @@ the plist used as a communication channel.
   (label (org-element-property :name paragraph)))
   (org-html--wrap-image contents info caption label)))
   ;; Regular paragraph.
 - (t (format p%s\n%s/p extra contents)
 + (t (format p%s%s\n%s/p class extra contents)

If deemed useful, I think this patch should use
`org-html--make-attribute-string' instead of hard-coding class
attribute:

  (attributes (org-html--make-attribute-string
   (org-export-read-attribute :attr_html paragraph)))

...

  (t (format p%s%s\n%s/p attributes extra contents))

This way, attributes will not be limited to class only. See, for
example, `org-html-special-block'.


Regards,

-- 
Nicolas Goaziou



Re: [O] Is it possible to add a class to a paragraph in HTML export?

2014-04-02 Thread Christian Moe

Nicolas Goaziou writes:

 If deemed useful, I think this patch should use
 `org-html--make-attribute-string' instead of hard-coding class
 attribute

+1. I would find this change useful.

Yours,
Christian



[O] Is it possible to add a class to a paragraph in HTML export?

2014-04-01 Thread Marcin Borkowski
Hi,

I'd like to have a p class=myfunnyclass in export.  I tried
#+ATTR_HTML :class myfunnyclass
but it didn't work.

Is there any way to do it?

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



Re: [O] Is it possible to add a class to a paragraph in HTML export?

2014-04-01 Thread Bastien
Hi Marcin,

Marcin Borkowski mb...@wmi.amu.edu.pl writes:

 I'd like to have a p class=myfunnyclass in export.  I tried
 #+ATTR_HTML :class myfunnyclass
 but it didn't work.

You can't for now but this patch will make it work.

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index a843441..76472c7 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2899,6 +2899,8 @@ the plist used as a communication channel.
   (let* ((parent (org-export-get-parent paragraph))
 	 (parent-type (org-element-type parent))
 	 (style '((footnote-definition  class=\footpara\)))
+	 (class0 (org-export-read-attribute :attr_html paragraph :class))
+	 (class (if class0 (format  class=\%s\ class0)))
 	 (extra (or (cadr (assoc parent-type style)) )))
 (cond
  ((and (eq (org-element-type parent) 'item)
@@ -2925,7 +2927,7 @@ the plist used as a communication channel.
 	(label (org-element-property :name paragraph)))
 	(org-html--wrap-image contents info caption label)))
  ;; Regular paragraph.
- (t (format p%s\n%s/p extra contents)
+ (t (format p%s%s\n%s/p class extra contents)
 
  Plain List
 

-- 
 Bastien


Re: [O] Is it possible to add a class to a paragraph in HTML export?

2014-04-01 Thread Marcin Borkowski
Dnia 2014-04-01, o godz. 21:37:06
Bastien b...@gnu.org napisaƂ(a):

 Hi Marcin,
 
 Marcin Borkowski mb...@wmi.amu.edu.pl writes:
 
  I'd like to have a p class=myfunnyclass in export.  I tried
  #+ATTR_HTML :class myfunnyclass
  but it didn't work.
 
 You can't for now but this patch will make it work.
 

Wow, thanks a lot?  Any chance this will land in the official
Org-mode repo soon?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University