emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastian Rose <sebastian_rose@gmx.de>
To: djcb@djcbsoftware.nl
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: html export with htmlized code blocks [SOLVED, but...]
Date: Mon, 25 May 2009 22:03:37 +0200	[thread overview]
Message-ID: <87prdxlzl2.fsf@kassiopeya.MSHEIMNETZ> (raw)
In-Reply-To: <20090525180436.GB6128@mindcrime> (Dirk-Jan C. Binnema's message of "Mon, 25 May 2009 21:04:36 +0300")

"Dirk-Jan C. Binnema" <djcb.bulk@gmail.com> writes:
> So, either I'd like the <pre> to have the styles inline (like the rest
> of the code, I think this is the nicer solution) *or* make the 'pre'
> element do something like:
>    "<pre class="src src-emacs-lisp" style="color:#edebc4; background-color:black>"

Nice, until you change your style (or spread your HTML over the
world). Then all that hardcoded colors get in the way. I'd strongly
recommend the CSS version of highlighting.

The coloring depends on the environment. I sometimes switch to dark
background colors (bash alias: dmacs) at night and light background in
the day time for readability. I could even change the colors of my code
depending on the time of day by serving different stylesheets.



Untested:




In the HTML files:

   <link rel="stylesheet" type="text/css" href="css.php" />



<?php
/*
    css.php 
    Prints our stylesheets depending of the time of day.
*/


header("Contet-Type: text/css");

$t = date("H");

if ( $t > 7 && $t < 20)
{
  fpassthrough("/var/www/daylight.css");
}
else if ( ($t > 6 && $t < 7) ||  ($t > 20 && $t < 21))
{
  fpassthrough("/var/www/twighlight.css");
}
else
{
  fpassthrough("/var/www/nighttime.css");
}

?>




Or how about different themes for the users to choose from, like many
CMS systems provide?



This can be done on any standard Linux installation in about half an
hour (apt-get install apache2 libapache2-mod-php5  - done). I couldn't
live without a database, php and apache (as a minimum).


The are so many goooood arguments to use css.

Readable HTML code or detecting the syntax of a token inside the code
block through the style class assigned to it. CSS classes are no color
values. CSS classes `classify' a container/string/token so we can learn
something more usefull about it, then just the color it has.

Please, use CSS. You won't regret it!


See:

http://cloud.github.com/downloads/SebastianRose/org-search.php/list-snippets.png




    Sebastian

  parent reply	other threads:[~2009-05-25 20:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 18:19 html export with htmlized code blocks Dirk-Jan C. Binnema
2009-05-19 19:10 ` Dan Davison
2009-05-19 20:04   ` html export with htmlized code blocks [SOLVED] Dirk-Jan C. Binnema
2009-05-19 20:07   ` Dirk-Jan C. Binnema
2009-05-25 18:04     ` html export with htmlized code blocks [SOLVED, but...] Dirk-Jan C. Binnema
2009-05-25 18:33       ` Sebastian Rose
2009-05-25 18:35       ` Sebastian Rose
2009-05-25 20:03       ` Sebastian Rose [this message]
2009-05-19 20:20 ` html export with htmlized code blocks Sebastian Rose

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=87prdxlzl2.fsf@kassiopeya.MSHEIMNETZ \
    --to=sebastian_rose@gmx.de \
    --cc=djcb@djcbsoftware.nl \
    --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).