Commit acc2d8ba authored by adriana's avatar adriana

Import with [PATCH sourceforge] Initial HTML fixes, new PSGML site validation...

Import with [PATCH sourceforge] Initial HTML fixes, new PSGML site validation <>

branch : adriana
parent 5e46a6b81984
2000-07-16 Adrian Aichner <>
* layout/template.html: Replace physical <b> markup with logical
<strong> markup.
2000-07-16 Adrian Aichner <>
* include/ Change $pattern string to regexp to avoid
genpage warning: Unrecognized escape \s passed through at
line 36.
2000-07-16 Adrian Aichner <>
* faq/xemacs-faq.html: Add completely missing DTD spec.
* faq/xemacs-faq_1.html: Ditto.
* faq/xemacs-faq_2.html: Ditto.
* faq/xemacs-faq_3.html: Ditto.
* faq/xemacs-faq_4.html: Ditto.
* faq/xemacs-faq_5.html: Ditto.
* faq/xemacs-faq_6.html: Ditto.
* faq/xemacs-faq_7.html: Ditto.
* faq/xemacs-faq_8.html: Ditto.
* faq/xemacs-faq_toc.html: Ditto.
* faq/xemacs-new.html: Ditto.
2000-07-16 Adrian Aichner <>
* upload/xemacs-faq.html: Remove empty lines after DTD.
* upload/xemacs-faq.html: Ditto.
* upload/xemacs-faq.html: Ditto.
* upload/xemacs-faq_2.html: Ditto.
* upload/xemacs-faq_3.html: Ditto.
* upload/xemacs-faq_4.html: Ditto.
* upload/xemacs-faq_5.html: Ditto.
* upload/xemacs-faq_6.html: Ditto.
* upload/xemacs-faq_8.html: Ditto.
* upload/xemacs-faq_toc.html: Ditto.
2000-07-16 Adrian Aichner <>
* oldstuff/index.html: Remove leading SPACE from file, translate
iso characters to SGML entities.
* oldstuff/xemacs-faq_1.html: Ditto.
* oldstuff/xemacs-faq_2.html: Ditto.
* oldstuff/xemacs-faq_3.html: Ditto.
* oldstuff/xemacs-faq_4.html: Ditto.
* oldstuff/xemacs-faq_4.html: Ditto.
* oldstuff/xemacs-faq_5.html: Ditto.
* oldstuff/xemacs-faq_6.html: Ditto.
* oldstuff/xemacs-faq_6.html: Ditto.
* oldstuff/xemacs-faq_7.html: Ditto.
* oldstuff/xemacs-faq_8.html: Ditto.
* oldstuff/xemacs-faq_toc.html: Ditto.
2000-07-16 Adrian Aichner <>
* old/index.html: Remove </PRE> garbage from BOF.
* old/xemacs-faq.html: Ditto.
2000-07-16 Adrian Aichner <>
* faq/index.content: Remove empty lines.
* faq/index.html: Remove leading SPACE in DTD spec.
2000-07-16 Adrian Aichner <>
* Links/tutorials_1.html: Add DTD spec.
* Links/tutorials_2.html: Ditto.
* Links/tutorials_3.html: Ditto.
* Links/tutorials_foot.html: Ditto.
* Links/tutorials_toc.html: Ditto.
2000-07-16 Adrian Aichner <>
* About/created.content: Fix HTML error.
2000-07-16 Adrian Aichner <>
* bin/genpage: UNIX/NT interpreter portability kludge, add XEmacs
mode selector -*-Perl-*-.
2000-07-16 Adrian Aichner <>
* Makefile (XEMACS): New.
* Makefile (WEBDIR): New.
* Makefile (gp): Use $(WEBDIR).
* Makefile (validate): New. Validate HTML documents with XEmacs.
* Makefile (extraclean): New. Clean examples and $(WEBDIR).
FLAGS=-batch -q -no-site-file
site: content/index.content
./bin/genpage -o $(WEBDIR)
$(XEMACS) $(FLAGS) -l ./batch-psgml-validate.el -f batch-psgml-validate $(WEBDIR)
rm -rf $(WEBDIR)
;;; $Id$
;;; Adrian Aichner,, Teradyne GmbH, 2000-07-16.
(require 'psgml)
(require 'psgml-parse) ;;; for sgml-element-context-string
(defconst psgml-validate-conform
"<small>Conform with "
"Phrase to insert for conforming SGML document.")
(defconst psgml-validate-non-conform
"<small><strong>Not</strong> conform with "
"Phrase to insert for non-conforming SGML document.")
(defun batch-psgml-validate (&optional file-or-dir)
"Uses `sgml-next-trouble-spot' from the PSGML package to validate
conformance of files in FILE-OR-DIR with the specified DTD. See
`batch-psgml-validate-buffer'. If FILE-OR-DIR is missing,
`batch-psgml-validate' is performed for each `command-line-args-left'."
(interactive "DHTML directory to validate: ")
(if (null file-or-dir)
(let (file-or-dir)
(while command-line-args-left
(setq file-or-dir (expand-file-name (car command-line-args-left)))
(batch-psgml-validate file-or-dir)
(setq command-line-args-left (cdr command-line-args-left)))))
(dolist (file (directory-files file-or-dir t nil nil nil))
((member (file-name-nondirectory file) (list "." ".."))
((file-directory-p file)
(batch-psgml-validate file))
(member (file-name-extension file) (list "htm" "html"))
(backup-file-name-p file)))
(message "validating %s" file)
(batch-psgml-validate-file file t t))))
(message "batch-psgml-validate %s is done" file-or-dir)))
(defun batch-psgml-validate-file (file &optional insert-result indent)
"Uses `sgml-next-trouble-spot' from the PSGML package to validate
conformance of FILE with the specified DTD. See
(read-file-name "HTML file to validate: ")
(yes-or-no-p "insert compliance text ")
(yes-or-no-p "indent buffer ")))
(find-file-noselect file)
(batch-psgml-validate-buffer insert-result indent)))
(defun batch-psgml-validate-buffer (&optional insert-result indent)
"Uses `sgml-next-trouble-spot' from the PSGML package to validate
conformance of buffer with the specified DTD. INSERT-RESULT inserts a
\(non-\)compliance messsage before \"</BODY>\". INDENT will
`indent-according-to-mode' as well. The buffer is saved in the end if
not called interactively."
(yes-or-no-p "insert compliance text ")
(yes-or-no-p "indent buffer ")))
(let (old-result-begin
(goto-char (point-min))
(condition-case err
(setq result (sgml-next-trouble-spot))
(error (message ">> Error: %s" (prin1-to-string err)))
(t (message "trouble: %s" (prin1-to-string err))))
(when insert-result
(goto-char (point-max))
(setq old-result-end
(re-search-backward "^\\s-*</body>" (point-min) t))
(format "^\\s-*\\(%s\\|%s\\)"
(point-min) t)
(setq old-result-begin (point)))
(format "%s"
(if (string= result "Ok")
(setq new-result-begin (point))
(unless (string= result "Ok")
(if sgml-last-element
(message "validation error in %s"
(sgml-element-context-string sgml-last-element)))
(message "validation error:%d:%s"
(count-lines (point-min) (point))
(insert html-helper-htmldtd-version)
(html-quote-region new-result-begin (point))
", PSGML "
psgml-version ", "
emacs-version ".</small>\n"))
(when indent
(indent-region (point-min) (point-max) nil))
(if (noninteractive)
(if (buffer-modified-p)
(progn (message "Saving modified %s" (buffer-file-name))
# Example paramaters for genpage.
# Note: It's case sensitive for now.
# Command line options override what's in here!
template = template.html
contentdir = content
layoutdir = layout
outputdir = ../docs
force = 0
debug = 0
quiet = 0
ignore_regexp = ^.*\.news$|CVS|.*,v$|^\#.*\#$|.*~$
suffix = .html
glossary = layout/glossary
afterpass =
evalparam =
execute =
includedir = include
recipes =
#! /usr/bin/perl -w
use File::Find;
find( \&changer , ( "content/Releases" ));
sub changer {
my $file = $_;
if ( $file =~ '.html' ) {
my $contents;
my $author;
my $title;
my $main;
my $newfile = $file;
$newfile =~ s/\.html/\.content/ ;
local $/;
undef $/;
open( IN , $file );
$contents = <IN>;
close( IN );
if ( $contents =~ m["author".*?content="(.*?)"]s ) { $author = $1; }
else { die( "no author in $file!\n") }
if ( $contents =~ m[<title>(.*?)</title>] ) { $title = $1; }
else { die( "no title in $file!\n" ) }
if ( $contents =~
m[<!-- content cell -->.*?<td align="left" valign="top">(.*)</td><!-- /content cell -->]s) {
$main = $1;
else { die( "no main in $file!\n" ) }
open( OUT , ">$newfile" );
print OUT <<EOF;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment