Changeset 30


Ignore:
Timestamp:
12/17/14 19:46:16 (2 years ago)
Author:
rme
Message:

Add :stylesheet keyword argument.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/output-html.lisp

    r29 r30  
    22 
    33(defun output-html (doc filename &key external-format (if-exists :supersede) 
    4                                    style) 
     4                                   stylesheet) 
    55  (with-open-file (s filename :direction :output :if-exists if-exists 
    66                     :external-format external-format) 
    77    (format s "<!DOCTYPE html>~%") 
    88    (format s "<html>~%") 
     9    (format s "<head>~%") 
     10    (format s "<meta charset=\"utf-8\">~%") 
     11    (when stylesheet 
     12      (format s "<link rel=\"stylesheet\" type=\"text/css\" href=\"~a\" />~%" 
     13              stylesheet)) 
     14    (format s "<title>~%") 
     15    (write-html (clause-title doc) s) 
     16    (format s "</title>~%") 
     17    (format s "</head>~%") 
    918    (write-html doc s) 
    1019    (format s "</html>~%") 
     
    4150 
    4251(defmethod write-html ((clause document) stream) 
    43   (write-string "<head>" stream) 
    44   (terpri stream) 
    45   (format stream "<meta charset=\"utf-8\">~%") 
    46   (format stream "<link rel=\"stylesheet\" type=\"text/css\" href=\"~a\" />" 
    47           "ccl.css") 
    48   (write-string "<title>" stream) 
    49   (write-html (clause-title clause) stream) 
    50   (format stream "</title>~%") 
    51   (write-string "</head>" stream) 
    5252  (format stream "<body>~%") 
    5353  ;; (write-string "<h1>" stream) 
Note: See TracChangeset for help on using the changeset viewer.