emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rafael <rvf0068@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: How to customize the org-mode's BEGIN_SRC HTML output
Date: Tue, 24 Aug 2010 21:36:40 -0500	[thread overview]
Message-ID: <87bp8rwh8n.fsfhello@somewhere.com> (raw)
In-Reply-To: AANLkTinLUSkXJRk3Co_yJrPWcfhPULuVG_JkuEc+nMtt@mail.gmail.com

Benjamin Beckwith <bnbeckwith@gmail.com> writes:

> Hi, I also was interested in posting these blocks (through org2blog in
> wordpress).  The code I posted below is added to
> 'org-export-preprocess-hooks' where it looks for BEGIN_SRC blocks as
> well as ':' blocks of code.
>
> In the case of BEGIN_SRC blocks, I add a header option, :syntaxhl where
> I can pass in additional settings to the syntaxhighlighter code.
>
> The code below uses Wordpress shortcodes, but I am sure that you can
> adapt for your own purposes.

Thanks! that seems to almost work for me, if I replace your penultimate
line:

> (concat "\n\n[" lang syntaxhl "]\n" body "[/" lang "]\n")

by

(concat "\n\n[sourcecode language=\"" lang syntaxhl "\"]\n"
                                          body "[/sourcecode]\n")

but then the line breaks are lost, and the latex exporter tries to be
too smart and replace the code.. Please see

http://rvftestblog.wordpress.com/2010/08/24/code-blocks-again/

which was intended as a result of posting the following:

#+POSTID: 17
#+DATE: [2010-08-24 Tue 20:43]
#+OPTIONS: toc:nil num:nil todo:nil pri:nil tags:nil ^:{}
#+DESCRIPTION: Testing
#+KEYWORDS: test
#+TITLE: Code blocks again

A perl example:

#+BEGIN_SRC perl 
   for (my $i = 0; $i != 10; ++i) {
        print "hello, world!\n";
   }
#+END_SRC

another

#+BEGIN_SRC latex
\begin{theorem}
  \label{theorem:1}
  {\normalfont (Augmentation Theorem)} Let $M=(S,I)$ be a matroid, and
  $X,Y\subseteq I$ with $|X|<|Y|$. Then there is $Z\subseteq
  Y\setminus X$ such that $|X\cup Z|=|Y|$ and $X\cup Z\in I$.
\end{theorem}
#+END_SRC

update 8: let's see if it works now...

  reply	other threads:[~2010-08-25  2:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 13:39 How to customize the org-mode's BEGIN_SRC HTML output Benjamin Beckwith
2010-08-25  2:36 ` Rafael [this message]
2010-08-25  8:19   ` Eric S Fraga
  -- strict thread matches above, loose matches on Subject: below --
2010-08-25  3:32 Benjamin Beckwith
2010-08-25  8:30 ` Eric S Fraga
2010-08-25 12:23   ` Rafael
2010-08-25 12:51     ` Puneeth
2010-08-26  1:54       ` Rafael
2010-08-29  9:37       ` Puneeth
2010-08-29 18:18         ` Rafael
2010-09-01 10:42           ` Puneeth
2010-09-01 14:38             ` Rafael
2010-08-23  9:41 卓强 Will Zhuo
2010-08-23 19:03 ` Erik Iverson
2010-08-26  3:22   ` Andrei Jirnyi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bp8rwh8n.fsfhello@somewhere.com \
    --to=rvf0068@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).