[gtkmm-documentation/gtkmm-2-22] Link to the stable gtkmm API reference and the branch of the example code.



commit 151d8502eee2b8203f7eabc3db0ba21f57ba9c89
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Oct 28 11:50:24 2010 +0200

    Link to the stable gtkmm API reference and the branch of the example code.
    
    * examples/others/base/: Move this to examples/book/ because it is really
    used in the book, in the Basics section.
    * docs/tutorial/C/gtkmm-tutorial-in.xml: Link to stable/ for the API
    reference to avoid linking to the unstable API, which is different.
    * docs/tutorial/insert_example_code.pl: Append the branch parameter
    (an entity in the .xml file) to the git.gnome.org URL so people see the
    correct version of the source code. Also add a comment that this is for
    gtkmm 2, not gtkmm 3.

 ChangeLog                              |   13 +++++++++++++
 docs/tutorial/C/gtkmm-tutorial-in.xml  |    8 ++++----
 docs/tutorial/insert_example_code.pl   |   15 +++++++++++----
 examples/Makefile.am                   |    8 ++++----
 examples/{others => book}/base/base.cc |    0
 5 files changed, 32 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 12cd7bf..b37b404 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2010-10-28  Murray Cumming  <murrayc murrayc com>
 
+	Link to the stable gtkmm API reference and the branch of the example code.
+
+	* examples/others/base/: Move this to examples/book/ because it is really
+	used in the book, in the Basics section.
+	* docs/tutorial/C/gtkmm-tutorial-in.xml: Link to stable/ for the API
+	reference to avoid linking to the unstable API, which is different.
+	* docs/tutorial/insert_example_code.pl: Append the branch parameter
+	(an entity in the .xml file) to the git.gnome.org URL so people see the
+	correct version of the source code. Also add a comment that this is for
+	gtkmm 2, not gtkmm 3.
+
+2010-10-28  Murray Cumming  <murrayc murrayc com>
+
 	Tutorial: Deal with some TODOs and hide others.
 
 	* docs/tutorial/C/gtkmm-tutorial-in.xml: Label section: Describe the use of
diff --git a/docs/tutorial/C/gtkmm-tutorial-in.xml b/docs/tutorial/C/gtkmm-tutorial-in.xml
index 4d1015a..1577bbe 100644
--- a/docs/tutorial/C/gtkmm-tutorial-in.xml
+++ b/docs/tutorial/C/gtkmm-tutorial-in.xml
@@ -3,12 +3,12 @@
   "http://docbook.org/docbook/xml/4.5/docbookx.dtd"; [
   <!ENTITY url_refdocs_base_glib_html "http://library.gnome.org/devel/glibmm/unstable/";>
   <!ENTITY url_refdocs_base_glib "&url_refdocs_base_glib_html;classGlib_1_1">
-  <!ENTITY url_refdocs_base_gtk_html "http://library.gnome.org/devel/gtkmm/unstable/";>
+  <!ENTITY url_refdocs_base_gtk_html "http://library.gnome.org/devel/gtkmm/stable/";>
   <!ENTITY url_refdocs_base_gtk "&url_refdocs_base_gtk_html;classGtk_1_1">
   <!ENTITY url_refdocs_base_gtk_namespace "&url_refdocs_base_gtk_html;namespaceGtk_1_1">
   <!ENTITY url_figures_base "figures/">
-  <!ENTITY url_examples_others_base "http://git.gnome.org/cgit/gtkmm-documentation/tree/examples/others/";>
-  <!ENTITY url_examples_base "http://git.gnome.org/cgit/gtkmm-documentation/tree/examples/book/";>
+  <!ENTITY url_examples_base "http://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/";>
+  <!ENTITY url_examples_branchsuffix "?h=gtkmm-2-22">
   <!ENTITY gtkmm "<application>gtkmm</application>">
   <!ENTITY uuml "&#252;" >
   <!ENTITY szlig "&#223;" >
@@ -312,7 +312,7 @@ To begin our introduction to &gtkmm;, we'll start with the simplest
 program possible. This program will create an empty 200 x 200 pixel window.
 </para>
 
-<para><ulink url="&url_examples_others_base;base">Source Code</ulink></para>
+<para><ulink url="&url_examples_base;base">Source Code</ulink></para>
 
 <para>We will now explain each line of the example</para>
 <programlisting>#include &lt;gtkmm.h&gt;</programlisting>
diff --git a/docs/tutorial/insert_example_code.pl b/docs/tutorial/insert_example_code.pl
index 358ed93..6dfec19 100755
--- a/docs/tutorial/insert_example_code.pl
+++ b/docs/tutorial/insert_example_code.pl
@@ -12,14 +12,17 @@
 
     while(<FILE>)
     {
-      print $_;
-
       #Beginning of comment:
       # Look for
       # <para><ulink url="&url_examples_base;helloworld">Source Code</ulink></para>
 
       if(/<para><ulink url=\"&url_examples_base;([\/\w]+)\">Source Code<\/ulink><\/para>/)
       {
+        #Modify the line to add the branch, so people see the correct version.
+        #This is particularly important during major API changes every few years,
+        #when the API might no longer even exist in the new version.
+        print "<para><ulink url=\"&url_examples_base;${1}?h=&url_examples_branchsuffix;\">Source Code<\/ulink><\/para>\n";
+
         #List all the source files in that directory:
         my $directory = $examples_base . $1;
 
@@ -34,7 +37,7 @@
 
         foreach $source_file (@header_files, @source_files)
         {
-           print "<para>File: <filename>${source_file}</filename>\n";
+           print "<para>File: <filename>${source_file}</filename> (For use with gtkmm 2, not gtkmm 3)\n";
            print "</para>\n";
            print "<programlisting>\n";
 
@@ -45,6 +48,11 @@
 
         print "<!-- end inserted example code -->\n";
       }
+      else
+      {
+        # Just print the line without changes:
+        print $_;
+      }
     }
 
     close(FILE);
@@ -79,4 +87,3 @@ sub process_source_file($)
 
   close(SOURCE_FILE);
 }
-
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 7be786a..5c5401f 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -10,6 +10,7 @@ check_PROGRAMS =					\
 	book/alignment/example				\
 	book/aspectframe/example			\
 	book/assistant/example				\
+	book/base/base				\
 	book/box/example				\
 	book/builder/basic/example			\
 	book/builder/derived/example			\
@@ -97,7 +98,6 @@ check_PROGRAMS =					\
 	book/update_ui/example				\
 	others/arrow/arrow				\
 	others/arrow/direction				\
-	others/base/base				\
 	others/calendar/calendar			\
 	others/cellrenderercustom/cellrenderertoggle	\
 	others/cellrenderercustom/testpopup		\
@@ -146,6 +146,9 @@ book_assistant_example_SOURCES =		\
 	book/assistant/examplewindow.h		\
 	book/assistant/main.cc
 
+book_base_base_SOURCES = \
+	book/base/base.cc
+
 book_box_example_SOURCES =			\
 	book/box/examplewindow.cc		\
 	book/box/examplewindow.h		\
@@ -587,9 +590,6 @@ others_arrow_arrow_SOURCES = \
 others_arrow_direction_SOURCES = \
 	others/arrow/direction.cc
 
-others_base_base_SOURCES = \
-	others/base/base.cc
-
 others_calendar_calendar_SOURCES = \
 	others/calendar/calendar.cc
 
diff --git a/examples/others/base/base.cc b/examples/book/base/base.cc
similarity index 100%
rename from examples/others/base/base.cc
rename to examples/book/base/base.cc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]