jed-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Mixing HTML and S-Lang ... easy way to do a mode?


Using Jed, a HTML mode exists, and obviously a S-Lang mode exists. Is it
somehow possible to mix these two modes together? Here's an example
file:

------------

<%
  variable title = "Greetings";
  
  define say_hello(name) {
    %>Hello, <%= name %><br /><%
  }
%>
<html>
  <head><title><%= title %></title></head>
  
  <body>
  <h1><%= title %></h1>
  <hr />
  
  <p>If you are reading this, it mean's that it's probably a
success!</p>
  
  <p>Let's try a for loop</p>
  
  <% _for(1,10,1) 
    {
        variable i = ();
        say_hello("World " + string(i));
    } %>
  
  <h2>Let's try something different</h2>
  
  <% _for(1,10,1) { %>
      Hello, World!<br />
  <% } %>

  </body>
</html>

------------

Anything inside of <% ... %> blocks is S-Lang code, outside HTML code. 

Thanks for any pointers, hints or tips!

----
jeremy <jc@xxxxxxxxxx>

The idle man does not know what it is to enjoy rest.

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]