[cairo-commit] cairo/doc/reference crossreference.rb,NONE,1.1 ChangeLog,1.1,1.2 README,1.1,1.2 doc.xml,1.1,1.2

Thomas Hunger tom at pdx.freedesktop.org
Thu Oct 16 05:31:58 PDT 2003


Update of /cvs/cairo/cairo/doc/reference
In directory pdx:/tmp/cvs-serv16808

Modified Files:
	ChangeLog README doc.xml 
Added Files:
	crossreference.rb 
Log Message:
updated xml files to look more like gtk refence
and introduced  crossreferencing via script


--- NEW FILE: crossreference.rb ---
d = Dir.glob("xml/*.xml")

ids = []

# collect symbols 
d.each do |file|
  f = File.new(file)
  buf = f.read
  ids << buf.scan(/.*id="(.*)".*/)
end
ids = ids.flatten

#resolve symbols
d.each do |file|
  f = File.new(file,"r+")
  buf = f.read
  p file
  ids.each do |id|
    if "xml/"+id+".xml" == file
      next
    end
    re = Regexp.compile('([^"\w\d])('+id+')([^"\w\d])')
    buf.gsub!(re, '\1<link linkend="\2">\2</link>\3')
    buf.gsub!(/(<\/link>)+/, '\1')
    buf.gsub!(/(<link[^>]*>)+/, '\1')
  end
  f.rewind
  f.write buf
  f.rewind
end

Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo/doc/reference/ChangeLog,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ChangeLog	15 Oct 2003 15:51:06 -0000	1.1
+++ ChangeLog	16 Oct 2003 12:31:56 -0000	1.2
@@ -1,3 +1,11 @@
+2003-10-16 Thomas Hunger  <info at teh-web.de>
+
+	* xml/* changed all files in the xml directory to 
+	look more like gtk. now <link> elements may be 
+	embedded almost everywhere
+	* added ruby script crossreferences which puts
+	<link> tags around all known refentries
+
 2003-10-15 Thomas Hunger  <info at teh-web.de>
 
 	* doc.xml: some documentation skeleton

Index: README
===================================================================
RCS file: /cvs/cairo/cairo/doc/reference/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- README	15 Oct 2003 15:51:06 -0000	1.1
+++ README	16 Oct 2003 12:31:56 -0000	1.2
@@ -3,3 +3,9 @@
 $ xmlto html doc.xml
 from within the reference directory
 
+cross-referecing
+----------------
+there is a small ruby script which collects all id="" thingies from the xml files in xml and creates links around the symbols found in files.
+exceptions:
+- there is already a link around a symbol.
+- its part of a function: cairo_translate !=> <link>cairo_t</link>ranslate
\ No newline at end of file

Index: doc.xml
===================================================================
RCS file: /cvs/cairo/cairo/doc/reference/doc.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- doc.xml	15 Oct 2003 15:51:06 -0000	1.1
+++ doc.xml	16 Oct 2003 12:31:56 -0000	1.2
@@ -10,6 +10,7 @@
 <!ENTITY cairo_push_group SYSTEM "xml/cairo_push_group.xml">
 <!ENTITY cairo_pop_group SYSTEM "xml/cairo_pop_group.xml">
 <!ENTITY cairo_set_target_surface SYSTEM "xml/cairo_set_target_surface.xml">
+<!ENTITY cairo_set_target_image SYSTEM "xml/cairo_set_target_image.xml">
 <!ENTITY cairo_set_operator SYSTEM "xml/cairo_set_operator.xml">
 <!ENTITY cairo_set_rgb_color SYSTEM "xml/cairo_set_rgb_color.xml">
 <!ENTITY cairo_set_alpha SYSTEM "xml/cairo_set_alpha.xml">
@@ -39,9 +40,6 @@
 <!ENTITY cairo_close_path SYSTEM "xml/cairo_close_path.xml">
 <!ENTITY cairo_stroke SYSTEM "xml/cairo_stroke.xml">
 <!ENTITY cairo_fill SYSTEM "xml/cairo_fill.xml">
-<!ENTITY cairo_in_stroke SYSTEM "xml/cairo_in_stroke.xml">
-<!ENTITY cairo_in_fill SYSTEM "xml/cairo_in_fill.xml">
-<!ENTITY cairo_hit SYSTEM "xml/cairo_hit.xml">
 <!ENTITY cairo_clip SYSTEM "xml/cairo_clip.xml">
 <!ENTITY cairo_select_font SYSTEM "xml/cairo_select_font.xml">
 <!ENTITY cairo_scale_font SYSTEM "xml/cairo_scale_font.xml">
@@ -78,13 +76,17 @@
 <!ENTITY cairo_matrix_multiply SYSTEM "xml/cairo_matrix_multiply.xml">
 <!ENTITY cairo_matrix_transform_distance SYSTEM "xml/cairo_matrix_transform_distance.xml">
 <!ENTITY cairo_matrix_transform_point SYSTEM "xml/cairo_matrix_transform_point.xml">
+<!ENTITY cairo_t SYSTEM "xml/cairo_t.xml">
+<!ENTITY cairo_matrix_t SYSTEM "xml/cairo_matrix_t.xml">
+<!ENTITY cairo_surface_t SYSTEM "xml/cairo_surface_t.xml">
+<!ENTITY cairo_format_t SYSTEM "xml/cairo_format_t.xml">
 ]>
 <book lang="en"> 
 <title>Cairo: A Vector Graphics Library</title> 
 
 
 <reference>
-<title>Reference</title>
+<title>functions</title>
 &cairo_create;
 &cairo_reference;
 &cairo_destroy;
@@ -94,6 +96,7 @@
 &cairo_push_group;
 &cairo_pop_group;
 &cairo_set_target_surface;
+&cairo_set_target_image;
 &cairo_set_operator;
 &cairo_set_rgb_color;
 &cairo_set_alpha;
@@ -123,9 +126,6 @@
 &cairo_close_path;
 &cairo_stroke;
 &cairo_fill;
-&cairo_in_stroke;
-&cairo_in_fill;
-&cairo_hit;
 &cairo_clip;
 &cairo_select_font;
 &cairo_scale_font;
@@ -162,9 +162,14 @@
 &cairo_matrix_multiply;
 &cairo_matrix_transform_distance;
 &cairo_matrix_transform_point;
-
 </reference>
-
+<reference>
+<title>types and enums</title>
+&cairo_t;
+&cairo_matrix_t;
+&cairo_surface_t;
+&cairo_format_t;
+</reference>
 </book>
 
 





More information about the cairo-commit mailing list