emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BABEL][PROPOSAL] headlines as executable srcnames
Date: Fri, 10 Sep 2010 10:21:15 +0530	[thread overview]
Message-ID: <81bp86nqv0.fsf@gmail.com> (raw)
In-Reply-To: <81k4mv7wq9.fsf@gmail.com> (Jambunathan K.'s message of "Thu, 09 Sep 2010 21:08:54 +0530")


I am slightly drifting a bit. I think the broader theme that is emerging
in this thread is this - how Babel as a Org's VM would enable one to
create useful text mashups. Call it Org 2.0 if you may like.

Needless, to say I am having a hammer and everything looks nail to
me. Please be patient with my regurgitations! Read on ...

,----
| "*Article*" #("From: Vinh Nguyen <vinhdizzo@gmail.com>
| Subject: Re: text color + highlight
| Newsgroups: gmane.emacs.orgmode
| To: emacs-orgmode@gnu.org
| Date: Thu, 9 Sep 2010 09:15:05 -0700
| Message-ID: <AANLkTinr_ZoRpygJPkSkYUo6pt1t3-ztOtHo32fnhscd@mail.gmail.com>
| Archived-At: <http://permalink.gmane.org/gmane.emacs.orgmode/30143>
| 
| I'd like to write a concluding email for this thread for future
| searchers to find.  This easy solution is brought to you by Eric
| Schulte and Christian Moe.
| 
| Place the following in your .emacs or init.el file:
| ;; org-mode color
| (org-add-link-type
|  \"color\" nil
|  (lambda (path desc format)p
|   (cond
|    ((eq format 'html)
|     (format \"<span style=\\\"color:%s;\\\">%s</span>\" path desc))
|    ((eq format 'latex)
|     (format \"{\\\\color{%s}%s}\" path desc)))))
| ;; org-mode highlight
| (org-add-link-type
|  \"hl\" nil
|  (lambda (path desc format)
|   (cond
|    ((eq format 'html)
|     (format \"<font style=\\\"background-color:%s;\\\">%s</font>\" path desc))
|    ((eq format 'latex)
|     (format \"\\\\colorbox{%s}{%s}\" path desc))))) ;; require \\usepackage{color}
| 
| Examples:
| [[color:blue][test this out]]
| [[hl:yellow][highlighted text]]
| 
| Remarks:
| * Pros
|   - don't need to modify org-mode source (just edit your .emacs)
|   - use the existing links syntax
| * Cons
|   - cannot be used concurrently or with other formatting
| * To Do
|   - Hopefully it will be implemented via extensible syntax in the
| future ($[options mytext])
|   - highlight and color paragraph or region
| 
| 
| -- Vinh
| 
| 
| 
| On Thu, Aug 5, 2010 at 1:42 PM, Vinh Nguyen <vinhdizzo@gmail.com> wrote:
| > Dear list,
| >
| > I was wondering if there is an easy way to markup the color of the
| > text for html output (and highlight as well).  When I prepare meeting
| > minutes I'd like to color some things and highlight certain things.
| > Right now, I am using emphasizing a major portion of the text.  It
| > would be great to have colors and highlights to draw attention to
| > certain items.
| >
| > Thanks.
| > Vinh
`----

I wonder whether there is a way to achieve the requested feature without
too much of elisp programming.

[[color:blue][test this out]]
 ^^^^^ ^^^^^  ^^^^^^^^^^^^^

If one imagines this as a macro call 

color => babel srcname [accessible through %0 in srcbody]
blue => param1 for srcname [accessible through %1 in srcbody]
test this out => text param for the macro ['this' param for text mashup]

In my earlier post, I tried to argue that if headlines could be srcnames
then the text content of the headline could be considered as an implicit
'this' param (which the 'headline macro' works upon)

Now if link syntax could be used as a macro call (as seen above) then
the description part of the link i.e., text contained within "inner []"
could be considered as the 'this' param for link-oriented
srcnames. (Think of links as mini, inline headlines and desc as headline
body)

It is important to note that the user still works with text documents
which are very much like existing org documents.

Note also that having positional params and having them canonically
accessible as %0, %1, %2 etc could have it's uses [1]. It is left to the
reader how color macro could be defined with above redefinitions.

Let me reiterate (and I think it is important) Babel's macro expansion
if tweaked and designed for 'text mashups and massages' then much of
user requirements (like the one above) could be implemented by the user
himself without any help from expert elisp programmers.

Footnotes:
[1] I believe babel as of this writing only permits named param list.

Jambunathan K.

  parent reply	other threads:[~2010-09-10  4:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 11:36 Composing letters using Org mode and the LaTeX isodoc class Sébastien Vauban
2010-09-07 18:46 ` Jambunathan K
2010-09-07 19:45   ` Sébastien Vauban
2010-09-08  0:56     ` Eric Schulte
2010-09-08  1:52       ` Thomas S. Dye
2010-09-08  4:39       ` Jambunathan K
2010-09-08 11:48         ` Sébastien Vauban
2010-09-08 15:15         ` Eric Schulte
2010-09-08 16:22           ` [BABEL][PROPOSAL] headlines as executable srcnames Jambunathan K
2010-09-08 21:30             ` Sébastien Vauban
2010-09-09 15:38             ` Jambunathan K
2010-09-09 16:30               ` Jambunathan K
2010-09-10  4:51               ` Jambunathan K [this message]
2010-09-20  4:03                 ` Eric Schulte
2010-09-20  7:39                   ` Jambunathan K
2010-09-20  4:15             ` Eric Schulte
2010-09-08 11:45       ` Composing letters using Org mode and the LaTeX isodoc class Sébastien Vauban
2010-09-08 15:38         ` Eric Schulte
2010-09-08 21:26           ` Sébastien Vauban
2010-09-10  8:51             ` Eric S Fraga
2010-09-10  9:13               ` Sébastien Vauban

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=81bp86nqv0.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    /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).