[Telepathy-commits] [telepathy-doc/master] Fix makefile for fragmentation

Davyd Madeley davyd at madeley.id.au
Sun Mar 1 21:47:51 PST 2009


---
 docs/book/Makefile.am            |   16 +++++--
 docs/book/insert_example_code.pl |   83 --------------------------------------
 2 files changed, 12 insertions(+), 87 deletions(-)
 delete mode 100755 docs/book/insert_example_code.pl

diff --git a/docs/book/Makefile.am b/docs/book/Makefile.am
index 484b2aa..f04bbe6 100644
--- a/docs/book/Makefile.am
+++ b/docs/book/Makefile.am
@@ -13,7 +13,16 @@ DOC_MODULE = telepathy
 DOC_ENTITIES =
 
 # The names of any files included by xincluded (preferred):
-DOC_INCLUDES = legal.xml
+DOC_INCLUDES = \
+	legal.xml \
+	introduction.xml \
+	basics.xml \
+	accounts.xml \
+	channel-dispatcher.xml \
+	connection-manager.xml \
+	connection.xml \
+	channel.xml \
+	tubes.xml
 
 # these are figures that need to be rasterised
 DOC_FIGURES_SRC = \
@@ -27,10 +36,9 @@ DOC_FIGURES =
 # The names of any locales for which documentation translations exist:
 DOC_LINGUAS = de
 
-
 # Create a DocBook source file that doesn't have the examples' comments blocks:
-C/telepathy-with-examples.xml: C/telepathy.xml insert-links.py insert-examples.py
-	$(srcdir)/insert-links.py <$< | $(srcdir)/insert-examples.py $(top_srcdir)/docs/examples/ >$@
+C/telepathy-with-examples.xml: $(_DOC_C_DOCS) insert-links.py insert-examples.py
+	$(srcdir)/insert-links.py $< | $(srcdir)/insert-examples.py $(top_srcdir)/docs/examples/ >$@
 
 
 # main xml file for the doc
diff --git a/docs/book/insert_example_code.pl b/docs/book/insert_example_code.pl
deleted file mode 100755
index 52f6770..0000000
--- a/docs/book/insert_example_code.pl
+++ /dev/null
@@ -1,83 +0,0 @@
-#! /usr/bin/perl -w
-
-#sub main()
-{
-  my $examples_base = shift(@ARGV);
-
-  $examples_base .= "/" unless($examples_base =~ /\/$/);
-
-  foreach $file (@ARGV)
-  {
-    open(FILE, $file);
-
-    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>/)
-      {
-        #List all the source files in that directory:
-        my $directory = $examples_base . $1;
-
-        opendir(DIR, $directory);
-        my @dir_contents = readdir(DIR);
-        closedir(DIR);
-
-        my @source_files = grep(/\.c$/, @dir_contents);
-        my @header_files = grep(/\.h$/,  @dir_contents);
-        my @python_source_files = grep(/\.py$/, @dir_contents);
-
-        print "<!-- start inserted example code -->\n";
-
-        foreach $source_file (@header_files, @source_files, @python_source_files)
-        {
-           print "<para>File: <filename>${source_file}</filename>\n";
-           print "</para>\n";
-           print "<programlisting>\n";
-
-           &process_source_file("${directory}/${source_file}");
-
-           print "</programlisting>\n";
-        }
-
-        print "<!-- end inserted example code -->\n";
-      }
-    }
-
-    close(FILE);
-  }
-
-  exit 0;
-}
-
-sub process_source_file($)
-{
-  my ($source_file) = @_;
-  my $found_start = 0;
-
-  open(SOURCE_FILE, $source_file);
-
-  while(<SOURCE_FILE>)
-  {
-    # Skip all text until the first code line.
-    if(!$found_start)
-    {
-      next unless /^[#\w]/;
-      $found_start = 1;
-    }
-
-    s/&/&amp;/g;
-    s/</&lt;/g;
-    s/>/&gt;/g;
-    s/"/&quot;/g;
-
-    print $_;
-  }
-
-  close(SOURCE_FILE);
-}
-
-- 
1.5.6.5




More information about the telepathy-commits mailing list