From mboxrd@z Thu Jan 1 00:00:00 1970 From: Justin Gordon Subject: Exporter and src blocks Date: Wed, 5 Mar 2014 23:09:29 -1000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1135f1b0d8313304f3ec7f9d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLUJM-0003YD-Et for emacs-orgmode@gnu.org; Thu, 06 Mar 2014 04:09:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLUJK-0003mq-Sr for emacs-orgmode@gnu.org; Thu, 06 Mar 2014 04:09:52 -0500 Received: from mail-oa0-x233.google.com ([2607:f8b0:4003:c02::233]:36943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLUJK-0003me-LU for emacs-orgmode@gnu.org; Thu, 06 Mar 2014 04:09:50 -0500 Received: by mail-oa0-f51.google.com with SMTP id i4so2268331oah.38 for ; Thu, 06 Mar 2014 01:09:49 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Yoshinari Nomura --001a1135f1b0d8313304f3ec7f9d Content-Type: text/plain; charset=ISO-8859-1 I'm trying to fix this issue: https://github.com/yoshinari-nomura/org-octopress/issues/14 Here's a copy of that message Per: justin808@27357ca I would like this to work: #+BEGIN_SRC css sass/custom/_fonts.scss b { font-weight: bold; } i { font-style: italic; } #+END_SRC And have that generate {% codeblock lang:css sass/custom/_fonts.scss %} b { font-weight: bold; } i { font-style: italic; } {% endcodeblock %} The lang goes in fine. I'd like the ability to have the other parameters picked up. Any chance you can give me a tip on the right change to the ox-jekyll.el? Here's an example of "header arguments": http://orgmode.org/manual/Code-block-specific-header-arguments.html#Code-block-specific-header-arguments I'm guessing that it's not necessary to use this syntax (prepend :title before the title) #+BEGIN_SRC css :title sass/custom/_fonts.scss b { font-weight: bold; } i { font-style: italic; } #+END_SRC In the method of ox-jekyll, if I print out the value of src-block, i get this: src-block is (src-block (:language css :switches nil :parameters nil :begin 1 :end 78 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t :label-fmt nil :value b { font-weight: bold; } i { font-style: italic; } :post-blank 0 :post-affiliated 1 :parent (section (:begin 1 :end 78 :contents-begin 1 :contents-end 78 :post-blank 0 :parent (org-data nil #2)) #0))) I never can see the title. Here's the method to fix: (defun org-jekyll-src-block (src-block contents info) "Transcode SRC-BLOCK element into jekyll code template format if `org-jekyll-use-src-plugin` is t. Otherwise, perform as `org-html-src-block`. CONTENTS holds the contents of the item. INFO is a plist used as a communication channel." (if org-jekyll-use-src-plugin (let ((language (org-element-property :language src-block)) (value (org-remove-indentation (org-element-property :value src-block)))) (message "src-block is %s" src-block) (format "{%% codeblock lang:%s %%}\n%s{%% endcodeblock %%}" language value)) (org-export-with-backend 'html src-block contents info))) -- Justin Gordon | 808-877-6461 | m: 808-281-7272 www.railsonmaui.com | twitter: @railsonmaui | sugarranchmaui.com | Sugar Ranch Blog --001a1135f1b0d8313304f3ec7f9d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I'm trying to fix this issue:=A0https://github.com/yoshin= ari-nomura/org-octopress/issues/14

Here's a copy= of that message

Per:=A0justin808@27357ca

I would like this to work:


#+BEGIN_SRC css sass/cust=
om/_fonts.scss
b { font-weight: bold; }
i { font-style: italic; }
#+END_SRC

And have that generate


{% codeblock lang:css sas=
s/custom/_fonts.scss %}
b { font-weight: bold; }
i { font-style: italic; }
{% endcodeblock %}

The lang goes in fine. I'd like the ability to have the o= ther parameters picked up.

Any chance you can give me a tip on the right change to the ox-jekyll.el?<= /p>

Here's an example of "header arguments":=A0http://orgmode.org/manual/Code-block-specific-header-arguments.html#Code= -block-specific-header-arguments

I'm guessing that it's not necessary to use this syntax (prepend := title before the title)


#+BEGIN_SRC css :title sa=
ss/custom/_fonts.scss
b { font-weight: bold; }
i { font-style: italic; }
#+END_SRC



In the method of ox-jekyll, if I print ou= t the value of src-block, i get this:

src-blo= ck is (src-block (:language css :switches nil :parameters nil :begin 1 :end= 78 :number-lines nil :preserve-indent nil :retain-labels t :use-labels t := label-fmt nil :value b { font-weight: bold; }
i { font-style: italic; }
=A0:post-blank 0 :post-affiliated = 1 :parent (section (:begin 1 :end 78 :contents-begin 1 :contents-end 78 :po= st-blank 0 :parent (org-data nil #2)) #0)))

I never can see the title.

Here's the method t= o fix:

= (defun org-jekyll-src-block (src-block contents info)
=A0 "Transcode SRC-BLOCK element int= o jekyll code template format
if `org-jekyll-use-src-plugin` i= s t. Otherwise, perform as
`org-html-src-block`. CONTENTS holds the contents of the item.
INFO is a plist used as a commun= ication channel."
=A0 (if org-jekyll-use-src-plugin
=A0 =A0 =A0 (let ((language (org-element-property :languag= e src-block))
=A0 =A0 =A0 =A0 =A0 =A0 (value (= org-remove-indentation
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (org-element-property :value src= -block))))
=A0 =A0 = =A0 =A0 (message "src-block is %s" src-block)
=A0 =A0 =A0 =A0 (format "{%= % codeblock lang:%s %%}\n%s{%% endcodeblock %%}"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 language = value))
=A0 =A0 (org-export-with-backend '= ;html src-block contents info)))


=




<= div>
--
Justin Gordon |=A0808-877-6461 |=A0m= : 808-281-7272
--001a1135f1b0d8313304f3ec7f9d--