On Mon, 12 Dec 2016, Matt Price wrote:
On Mon, Dec 12, 2016 at 12:16 PM, Charles C. Berry <ccberry@ucsd.edu> wrote:
On Mon, 12 Dec 2016, Matt Price wrote:ah, ok. Now I will reveal some of the depths of my ignorance. Looks like
[snip]
My questions are:
1. can I pass this html attribute to the <pre><code> block somehow?
Yes.
ATTR_HTML doesn't seem to work. Is this a bug? If so, should I try to fix
it?
No and no.
Did you try
: (plist-get (cadr src-block) :attr_html)
in `org-html-src-block' ?
:attr_html is a plist (right?).
No, it is a property name. (cadr src-block) is the plist.
See (info "(elisp) Property Lists")
(a) what is the appropriate way to identify an attribute here. should I
write, e.g.:
#+ATTR_HTML: :data-external-libs "http://underscorejs.org/underscore-min.js "
:class "list of classes"
Any could be made to work, but I'd use (a). Then
: (org-babel-parse-header-arguments
: (car (plist-get (cadr src-block) :attr_html)))
will give you
: ((:data-external-libs . "http://underscorejs.org/underscore-min.js ") : (:class . "list of classes"))
And then, if I want to transform this into:
data-external-libs="http://underscorejs.org/underscore-min.j " class="lists
of classes"
can I just do something like:
(let ((attributes (org-export-get-attribute :attr_html src-block))
(cl-loop for (key value) in attributes
(collect (concat key "=" "\"" value "\" " ))))
or do I need to transform the key into a string first?
Well, I'd just try it and see.
I'm sorry to be writing such basic lisp questions; obviously I need to read
a really good lisp introduction, but I haven't found one yet.
This is what I use:
* Elisp: (elisp). The Emacs Lisp Reference Manual.
* Emacs Lisp Intro: (eintr). A simple introduction to Emacs Lisp programming.
and ample Googling, usually leading to StackOverflow, to get hints on stuff I am fuzzy on. And I read docstrings over and over and ...
Best,
Chuck