emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] html export with htmlized code blocks [SOLVED, but...]


From: Sebastian Rose
Subject: Re: [Orgmode] html export with htmlized code blocks [SOLVED, but...]
Date: Mon, 25 May 2009 22:03:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux)

"Dirk-Jan C. Binnema" <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]