From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: seeking good practices for writing about org using org Date: Thu, 4 Aug 2016 20:05:30 -0700 Message-ID: References: <682129b907fb4b438f5571483c797797@exchsrv2.sgc.loc> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVVS6-0006cQ-Bi for emacs-orgmode@gnu.org; Thu, 04 Aug 2016 23:05:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVVS1-0005hT-5F for emacs-orgmode@gnu.org; Thu, 04 Aug 2016 23:05:38 -0400 Received: from iport-acv3-out.ucsd.edu ([132.239.0.4]:58929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVVS0-0005hG-OJ for emacs-orgmode@gnu.org; Thu, 04 Aug 2016 23:05:33 -0400 In-Reply-To: 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" To: "Cook, Malcolm" Cc: "'emacs-orgmode@gnu.org'" On Thu, 4 Aug 2016, Cook, Malcolm wrote: > Hi Charles, >> On Wed, 3 Aug 2016, Cook, Malcolm wrote: >> > > > Thanks. Much closer. Still some issues. Mind taking another >>> gander.... (hoping the attached jpeg of the webpage rendered comes >>> through as an attachment).... >>> If my emacs buffer holds... >>> ---------------------------------------------- >>> #+BEGIN_SRC org :exports both :results value ascii > >> > > ...............................................^^^^^>> > > what is the `ascii' doing? >> > > Can you provide a link to documentation in the manual or a >> docstring describing its function? > > I cannot! I learned this from reading the code. In ob-org.el we > find provision for this as well as `html' and `latex' > > > (defun org-babel-execute:org (body params) > "Execute a block of Org code with. > This function is called by `org-babel-execute-src-block'." > (let ((result-params (split-string (or (cdr (assoc :results params)) ""))) > (body (org-babel-expand-body:org > (replace-regexp-in-string "^," "" body) params))) > (cond > ((member "latex" result-params) > (org-export-string-as (concat "#+Title: \n" body) 'latex t)) > ((member "html" result-params) (org-export-string-as body 'html t)) > ((member "ascii" result-params) (org-export-string-as body 'ascii t)) > (t body) > ))) > > > This is all undocumented. I think it is a 'nod in the direction' of > what I am trying to accomplish, allowing to see as "results" the org > markup transcoded into the markup of a backend. See below for my > hack extension on this idea. Argh! Not even a mention in the docstring! I think there was a plea a while back for updates for the missing entries in ./worg/org-contrib/babel/languages.org but I see `org' has nothing. Sigh! > >> > > Why don't you have 'replace' in the :results args? > > Oops. Of course. While trying to understand all this, I had done this to similar effect instead: > > (setq org-babel-default-header-args:org nil) ; fix bug? NOT silent If this is set as a default, it is deliberate. But you can just set it as a property in the buffer. [stuff deleted] > I played with extending org-babel-execute:org to allow including > MULTIPLE transcoded markdown results using screwy variant syntax of > `:results +ascii +html +latex` with some success. [Malcolm's extension of `org-babel-execute:org' deleted] Writing a custom org-babel-execute:org is one way to go. Or slurp the code into another babel block, format it there, and wrap the results accordingly. This might be best for your purposes. You can write a block to format the original code, one to format it as latex, one as html, one as markdown, etc. Put them in your personal library-of-babel and ingest them. Then #+CALL lines will create the markup you need for any src block (which you will mark `:exports none' so all formatting is done by #+CALL's). HTH, Chuck