From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Reeve Subject: Export results of code literal blocks (Jekyll directory structure) xpost emacs.stackexchange Date: Sun, 25 Jun 2017 11:33:39 +1200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dOuYg-00020t-7A for emacs-orgmode@gnu.org; Sat, 24 Jun 2017 19:33:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dOuYf-0002pu-6F for emacs-orgmode@gnu.org; Sat, 24 Jun 2017 19:33:42 -0400 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:33970) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dOuYe-0002pT-UU for emacs-orgmode@gnu.org; Sat, 24 Jun 2017 19:33:41 -0400 Received: by mail-wr0-x236.google.com with SMTP id 77so108531649wrb.1 for ; Sat, 24 Jun 2017 16:33:40 -0700 (PDT) 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: emacs-orgmode@gnu.org Org-mode newbie here. Please be gentle. Posted on Stack Exchange before I found the official list. I'm trying to follow the recipe for exporting Org-mode documents for processing by Jekyll. My publishing org-publish-project-alist is configured to place exported html in my _posts directory and take images and place them in _posts/assets with org-publish-attachment. This modification of directory structure seems to be the root of the problem. #+BEGIN_SRC python :results value file import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D p1 = np.array([0,4,4]) p2 = np.array([4,-4,4]) p3 = np.array([2,2,-4]) fig = plt.figure() ax = fig.gca(projection='3d') ax.set_aspect("equal") #draw the arrow ax.quiver(p1[0],p1[1],p1[2],p2[0],p2[1],p2[2],length=1.0) ax.quiver(p1[0],p1[1],p1[2],p3[0],p3[1],p3[2],length=1.0) ax.set_xlim([-5, 5]) ax.set_ylim([-5, 5]) ax.set_zlim([-5, 5]) plt.savefig('../images/hw1-p3.png') return '../images/hw1-p3.png' #+END_SRC #+RESULTS: [[file:../images/hw1-p3.png]] #+BEGIN_EXPORT html
Problem 3 visualisation
Problem 3 visualisation
#+END_EXPORT html The end result I would like is to have the link to the result of the literal code block automatically generated either such that it is not exported as an inline image (as the relative path is incorrect) and be forced to manually add a correct link for HTML export or have the inline image link transformed such that it is correct. Suggestions like "Don't use Jekyll" are fine so long as it is accompanied with an alternative and explanation as to why. I see some people have written custom Org-mode Jekyll plugins like https://github.com/eggcaker/jekyll-org and am wondering if these are a better route. Also, the above snippet exports everything including the "BEGIN export" which I think shouldn't happen but I'll examine that separately. Regards...Jeremy Org mode version 9.0.5 (9.0.5-elpa @ /Users/xxx/.emacs.d/elpa/org-20170210/) GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911)) of 2016-09-18