mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-19 14:50:07 +03:00
updated doc, added a documentation lookup module, Daniel.
This commit is contained in:
parent
f302982d37
commit
c310d56482
@ -1,3 +1,10 @@
|
||||
Fri Jun 23 22:26:07 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||
|
||||
* doc/xml.html: various patches and improvements typo fixed by
|
||||
Felix Natter
|
||||
* doc/libxml-doc.el: Emacs module to lookup the libxml documentation
|
||||
from Felix Natter <fnatter@gmx.net>
|
||||
|
||||
Sat May 6 10:09:45 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||
|
||||
* doc/upgrade.html: updated with instructions for support of both
|
||||
|
140
doc/libxml-doc.el
Normal file
140
doc/libxml-doc.el
Normal file
@ -0,0 +1,140 @@
|
||||
;;; libxml-doc.el - look up libxml-symbols and start browser on documentation
|
||||
|
||||
;; Author: Felix Natter <fnatter@gmx.net>
|
||||
;; Created: Jun 21 2000
|
||||
;; Keywords: libxml documentation
|
||||
|
||||
;; This program is free software; you can redistribute it and/or
|
||||
;; modify it under the terms of the GNU General Public License
|
||||
;; as published by the Free Software Foundation; either version 2
|
||||
;; of the License, or (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program; if not, write to the Free Software
|
||||
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
;;; Commentary / README
|
||||
|
||||
;; these functions allow you to browse the libxml documentation
|
||||
;; (using lynx within emacs by default;
|
||||
;; ----- Installing
|
||||
;; 1. add the following to ~/.emacs (adapt path and remove comments !)
|
||||
;; (load ~/elisp/libxml-doc.el)
|
||||
;; you can also load this conditionally in a c-mode-hook (preferred)
|
||||
;;
|
||||
;;(add-hook 'c-mode-hook (lambda()
|
||||
;; (load-file "~/elisp/libxml-doc.el")))
|
||||
;;
|
||||
;; or you can use this if you are using libxml2
|
||||
;;(add-hook 'c-mode-hook (lambda()
|
||||
;; (save-excursion
|
||||
;; (if (search-forward "#include <libxml/" nil t nil)
|
||||
;; (load-file "~/elisp/libxml-doc.el"))
|
||||
;; )))
|
||||
;;
|
||||
;; 2. adapt libxmldoc-root:
|
||||
;; i.e. (setq libxmldoc-root "~/libxml2-2.0.0/doc/html/")
|
||||
;; 3. change the filter-regex: by default, cpp-defines, callbacks and
|
||||
;; html-functions are excluded (C-h v libxmldoc-filter-regexp)
|
||||
;; 4. consider customizing libxmldoc-browse-url (lynx by default);
|
||||
;; cannot use Emacs/W3 4.0pre46 because it has problems with the html
|
||||
;; ----- Using
|
||||
;; call M-x libxmldoc-lookup-symbol: this will prompt with completion
|
||||
;; and then open the browser showing the documentation. If the word
|
||||
;; around the point matches a symbol, that is used instead (no completion).
|
||||
|
||||
;;; ChangeLog:
|
||||
;; Wed Jun 21 01:07:12 2000: initial release
|
||||
;; Wed Jun 21 01:45:29 2000: added libxmldoc-lookup-symbol-at-point
|
||||
;; Wed Jun 21 23:37:58 2000: libxmldoc-lookup-symbol now uses
|
||||
;; (thing-at-point 'word) if it matches a symbol
|
||||
;; Thu Jun 22 02:37:46 2000: filtering is only done for completion
|
||||
;; Thu Jun 22 21:03:41 2000: libxmldoc-browse-url can be customized
|
||||
|
||||
;;; TODO:
|
||||
;; use command-execute for libxml-browse-url
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defvar libxmldoc-root "~/libxml/www.xmlsoft.org"
|
||||
"The root-directory of the libxml2-documentation (~ will be expanded).")
|
||||
(defvar libxmldoc-filter-regexp "^html\\|^\\*\\|^[A-Z_]+\\|^$"
|
||||
"Symbols that match this regular expression will be excluded when doing
|
||||
completion.
|
||||
For example:
|
||||
callbacks: \"^\\\\*\"
|
||||
cpp-defines: \"[A-Z_]+\"
|
||||
xml-functions \"^xml\"
|
||||
html-functions \"^html\"
|
||||
sax-functions \".*SAX\"
|
||||
By default, callbacks, cpp-defines and html* are excluded. If you redefine
|
||||
this, you should include \"^$\" as alternative, which removes empty
|
||||
tokens. i.e. removing \"^html\\\\|\" from the above regexp causes html* to
|
||||
be shown.")
|
||||
(defvar libxmldoc-browse-url 'browse-url-lynx-emacs
|
||||
"Browser used for browsing documentation. Emacs/W3 4.0pre46 cannot handle
|
||||
the html, so lynx-emacs is used by default.")
|
||||
(defvar libxmldoc-symbol-history nil
|
||||
"History for looking up libxml-symbols.")
|
||||
|
||||
;;;; public functions
|
||||
|
||||
(defun libxmldoc-lookup-symbol(&optional symbol)
|
||||
"Look up xml-symbol." (interactive)
|
||||
(let ((symbols)
|
||||
(real-symbol symbol)
|
||||
(url))
|
||||
(if symbol
|
||||
(setq symbols (libxmldoc-get-list-of-symbols t))
|
||||
(setq symbols (libxmldoc-get-list-of-symbols nil)))
|
||||
(if (null real-symbol)
|
||||
(if (assoc (thing-at-point 'word) symbols)
|
||||
(setq real-symbol (thing-at-point 'word))
|
||||
(setq real-symbol (completing-read "Libxml: " symbols nil t ""
|
||||
'libxmldoc-symbol-history "" t))))
|
||||
(if (null (assoc real-symbol symbols))
|
||||
(error (concat "libxmldoc: '" real-symbol "' not found !")))
|
||||
(setq url (cdr (assoc real-symbol symbols)))
|
||||
;; (minibuffer-message uri)
|
||||
(apply libxmldoc-browse-url (list url))))
|
||||
|
||||
;;(defun libxmldoc-lookup-symbol-at-point()
|
||||
;; "Look up libxml-symbol at point." (interactive)
|
||||
;; (libxmldoc-lookup-symbol (thing-at-point 'word)))
|
||||
|
||||
;;;; internal
|
||||
|
||||
(defun libxmldoc-get-list-of-symbols(&optional nofilter)
|
||||
"Get the list of html-links in the libxml-documentation."
|
||||
(let ((files (directory-files libxmldoc-root t
|
||||
"^gnome-xml-.*\\.html$" t))
|
||||
(symbols ())
|
||||
(case-fold-search t)
|
||||
(symbol)
|
||||
(uri))
|
||||
;; (minibuffer-message "collecting libxml-symbols...")
|
||||
(while (car files)
|
||||
(find-file (car files))
|
||||
(while (re-search-forward
|
||||
"<a[^>]*href[ \t\n]*=[ \t\n]*\"\\([^=>]*\\)\"[^>]*>" nil t nil)
|
||||
(setq uri (concat "file://" (expand-file-name libxmldoc-root) "/"
|
||||
(match-string 1)))
|
||||
(if (not (re-search-forward "\\([^<]*\\)<" nil t nil))
|
||||
(error "regexp error while finding libxml-symbols.."))
|
||||
(setq symbol (match-string 1))
|
||||
(setq case-fold-search nil)
|
||||
(if (or nofilter
|
||||
(null (string-match libxmldoc-filter-regexp symbol)))
|
||||
(add-to-list 'symbols (cons symbol uri)))
|
||||
(setq case-fold-search t)
|
||||
)
|
||||
(kill-buffer (current-buffer))
|
||||
(setq files (cdr files)))
|
||||
symbols))
|
||||
|
||||
;;; libxml-doc.el ends here
|
34
doc/xml.html
34
doc/xml.html
@ -3,7 +3,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>The XML library for Gnome</title>
|
||||
<meta name="GENERATOR" content="amaya V3.0">
|
||||
<meta name="GENERATOR" content="amaya V3.1">
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
</head>
|
||||
|
||||
@ -42,6 +42,7 @@ Logo"></a></p>
|
||||
<li><a href="#Validation">Validation</a></li>
|
||||
<li><a href="#Principles">DOM principles</a></li>
|
||||
<li><a href="#real">A real example</a></li>
|
||||
<li><a href="#Contributi">Contribution</a></li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="Introducti">Introduction</a></h2>
|
||||
@ -66,7 +67,7 @@ building tag-based structured documents/data.</p>
|
||||
href="http://www.w3.org/Consortium/Legal/copyright-software-19980720.html">W3C
|
||||
IPR</a> and the GNU LGPL. Use either at your convenience, basically this
|
||||
should make everybody happy, if not, drop me a mail.</li>
|
||||
<li>There is <a href="upgrade.html">a first set of instruction</a>
|
||||
<li>There is <a href="upgrade.html">a first set of instructions</a>
|
||||
concerning upgrade from libxml-1.x to libxml-2.x</li>
|
||||
</ul>
|
||||
|
||||
@ -99,7 +100,7 @@ building tag-based structured documents/data.</p>
|
||||
starting a new project using libxml you should really use the 2.x
|
||||
version.</li>
|
||||
<li>And don't forget to look at the <a href="/messages/">mailing-list
|
||||
archive</a>, too.</li>
|
||||
archive</a>.</li>
|
||||
</ol>
|
||||
|
||||
<h3>Reporting bugs and getting help</h3>
|
||||
@ -138,7 +139,7 @@ about Docbook), but it's a good starting point.</p>
|
||||
href="ftp://rpmfind.net/pub/libxml/">rpmfind.net</a> or on the <a
|
||||
href="ftp://ftp.gnome.org/pub/GNOME/MIRRORS.html">Gnome FTP server</a> either
|
||||
as a <a href="ftp://ftp.gnome.org/pub/GNOME/stable/sources/libxml/">source
|
||||
archive</a> or <a href="ftp://ftp.gnome.org/pub/GNOME/contrib/rpms/">RPMs
|
||||
archive</a> or <a href="ftp://ftp.gnome.org/pub/GNOME/contrib/rpms/">RPM
|
||||
packages</a>. (NOTE that you need both the <a
|
||||
href="http://rpmfind.net/linux/RPM/libxml.html">libxml</a> and <a
|
||||
href="http://rpmfind.net/linux/RPM/libxml-devel.html">libxml-devel</a>
|
||||
@ -158,7 +159,7 @@ packages installed to compile applications using libxml.)</p>
|
||||
platform, get in touch with me to upload the package. I will keep them in the
|
||||
<a href="ftp://rpmfind.net/pub/libxml/contribs/">contrib directory</a></p>
|
||||
|
||||
<p>Libxml is also available from 2 CVs bases:</p>
|
||||
<p>Libxml is also available from 2 CVS bases:</p>
|
||||
<ul>
|
||||
<li><p>The <a href="http://dev.w3.org/cvsweb/XML/">W3C CVS base</a>,
|
||||
available read-only using the CVS pserver authentification (I tend to use
|
||||
@ -1134,10 +1135,31 @@ XML storage. This is left as an exercise to the reader :-)</p>
|
||||
example</a> as a template, it is also available with Makefile in the Gnome CVS
|
||||
base under gnome-xml/example</p>
|
||||
|
||||
<h2><a name="Contributi">Contributions</a></h2>
|
||||
<ul>
|
||||
<li><a href="mailto:ari@btigate.com">Ari Johnson</a> provides a C++ wrapper
|
||||
for libxml:
|
||||
<p>Website: <a
|
||||
href="http://lusis.org/~ari/xml++/">http://lusis.org/~ari/xml++/</a></p>
|
||||
<p>Download: <a
|
||||
href="http://lusis.org/~ari/xml++/libxml++.tar.gz">http://lusis.org/~ari/xml++/libxml++.tar.gz</a></p>
|
||||
</li>
|
||||
<li><a href="mailto:doolin@cs.utk.edu">David Doolin</a> provides a
|
||||
precompiled Windows version
|
||||
<p><a
|
||||
href="http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/">http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/</a></p>
|
||||
</li>
|
||||
<li><a href="mailto:fnatter@gmx.net">Felix Natter</a> provided a emacs
|
||||
module to lookup libxml functions documentation</li>
|
||||
<li><a href="mailto:sherwin@nlm.nih.gov">Ziying Sherwin</a> provided <a
|
||||
href="http://xmlsoft.org/messages/0488.html">man pages</a> (not yet
|
||||
integrated in the distribution)</li>
|
||||
</ul>
|
||||
|
||||
<p></p>
|
||||
|
||||
<p><a href="mailto:Daniel.Veillard@w3.org">Daniel Veillard</a></p>
|
||||
|
||||
<p>$Id: xml.html,v 1.32 2000/04/03 19:48:13 veillard Exp $</p>
|
||||
<p>$Id: xml.html,v 1.33 2000/04/16 08:52:20 veillard Exp $</p>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user