]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Build and track a page that lists all code gallery programs. 2037/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 6 Jan 2016 17:07:12 +0000 (11:07 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 6 Jan 2016 17:09:34 +0000 (11:09 -0600)
doc/doxygen/CMakeLists.txt
doc/doxygen/code-gallery/CMakeLists.txt
doc/doxygen/code-gallery/code-gallery.h.in [new file with mode: 0644]
doc/doxygen/scripts/code-gallery.pl [new file with mode: 0644]
doc/doxygen/scripts/make_gallery.pl
doc/doxygen/tutorial/tutorial.h.in

index 490454dcaf572d45abe15ca478eb1c7b0e1c226f..8814c586e83ec8d73c18b2dbcd0492d7ffaf3b7b 100644 (file)
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2012 - 2015 by the deal.II authors
+## Copyright (C) 2012 - 2016 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -155,7 +155,14 @@ IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md)
     LIST(APPEND _doxygen_input
       ${CMAKE_CURRENT_BINARY_DIR}/code-gallery/${_step}.h
       )
+    LIST(APPEND _doxygen_input
+      ${CMAKE_CURRENT_BINARY_DIR}/code-gallery/code-gallery.h
+      )
   ENDFOREACH()
+
+  LIST(APPEND _doxygen_depend
+    ${CMAKE_CURRENT_BINARY_DIR}/code-gallery/code-gallery.h
+    )
 ENDIF()
 
 TO_STRING(_doxygen_image_path_string ${_doxygen_image_path})
index 8da41c57122c881d5c27e835fa69d6af6b9dbf9f..e98cae16c3b67453e05afc9566e5d4df214122a5 100644 (file)
@@ -44,8 +44,32 @@ IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md)
        "${DEAL_II_CODE_GALLERY_DIRECTORY}/*/doc/author")
   STRING(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_names}")
 
-  # Now set up targets for each of the code gallery programs
+  FOREACH(_step ${_code_gallery_names})
+    GET_FILENAME_COMPONENT(_step "${_step}" NAME)
+    LIST(APPEND _code_gallery_names_sans_dir "${_step}")
+  ENDFOREACH()
 
+  # Describe how to build code-gallery.h:
+  ADD_CUSTOM_COMMAND(
+    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/code-gallery.h
+    COMMAND ${PERL_EXECUTABLE}
+    ARGS
+      ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/code-gallery.pl
+      ${CMAKE_CURRENT_SOURCE_DIR}/code-gallery.h.in
+      ${DEAL_II_CODE_GALLERY_DIRECTORY}
+      ${_code_gallery_names_sans_dir}
+      > ${CMAKE_CURRENT_BINARY_DIR}/code-gallery.h
+    DEPENDS
+      ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/code-gallery.pl
+      ${CMAKE_CURRENT_SOURCE_DIR}/code-gallery.h.in
+      ${_code_gallery_names}
+    )
+  ADD_CUSTOM_TARGET(build_code-gallery_h
+    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/code-gallery.h)
+  ADD_DEPENDENCIES(code-gallery build_code-gallery_h)
+
+
+  # Now set up targets for each of the code gallery programs
   FOREACH(_step ${_code_gallery_names})
     GET_FILENAME_COMPONENT(_step "${_step}" NAME)
     MESSAGE(STATUS "  Setting up ${_step}")
diff --git a/doc/doxygen/code-gallery/code-gallery.h.in b/doc/doxygen/code-gallery/code-gallery.h.in
new file mode 100644 (file)
index 0000000..207b15b
--- /dev/null
@@ -0,0 +1,40 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2016 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+/**
+ * @page CodeGallery The deal.II code gallery
+ *
+ * The deal.II code gallery contains a collection of programs based on deal.II
+ * that were contributed by others to serve as starting points for more complex
+ * applications. The code gallery is an extension of the @ref Tutorial "tutorial"
+ * in that the programs are intended to show how applications can be
+ * implemented with deal.II, but without the requirement to have these code
+ * documented at the same, extensive level as used in the tutorial.
+ * Instructions for obtaining the code gallery programs can be found at
+ * http://dealii.org/code-gallery.html .
+ *
+ * @note The programs that form part of the code gallery are contributed by
+ *   others and are not part of deal.II itself. The deal.II authors make
+ *   no assurances that these programs are documented in any reasonable way,
+ *   nor that the programs are in fact correct. Please contact the authors
+ *   of the code gallery programs if you have questions.
+ *
+ * The code gallery currently consists of the following programs (with
+ * connections to other programs shown in the graph on the
+ * @ref TutorialConnectionGraph "tutorial page"):
+ *
+@@GALLERY_LIST@@
+ */
diff --git a/doc/doxygen/scripts/code-gallery.pl b/doc/doxygen/scripts/code-gallery.pl
new file mode 100644 (file)
index 0000000..0bc718c
--- /dev/null
@@ -0,0 +1,56 @@
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2016 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+use strict;
+
+my $gallery_file = shift;
+open GALLERY, "<$gallery_file";
+
+my $gallery_dir = shift;
+
+
+# Print the first part of gallery.h.in up until the point where we
+# find the line with '@@GALLERY_LIST@@'
+while (my $line = <GALLERY>)
+{
+  last if($line =~ m/\@\@GALLERY_LIST\@\@/);
+  print $line;
+}
+
+# print the list of code gallery programs as a descriptor/description
+# list
+print "<dl>\n";
+foreach my $gallery (sort @ARGV)
+{
+    my $gallery_underscore = $gallery;
+    $gallery_underscore    =~ s/-/_/;
+    print "  <dt><b>\@ref code_gallery_${gallery_underscore} \"$gallery\"</b></dt>\n";
+    print "    <dd>\n";
+    open TOOLTIP, "<$gallery_dir/$gallery/doc/tooltip";
+    while (my $line = <TOOLTIP>) {
+        print "      $line";
+    }
+    print "    </dd>\n";
+    print "\n";
+}
+print "</dl>\n";
+
+
+# Then print the rest of code-gallery.h.in
+while (my $line = <GALLERY>)
+{
+  print $line;
+}
+close GALLERY;
index 245bff90253e1b17bee54bc7bc40e44a0f4d4912..06a2ebf88cf866c72c01c318f5033e26000d6a0f 100644 (file)
@@ -56,7 +56,8 @@ print
 
 \@endhtmlonly
 
-This program consists of the following files (click to inspect):
+This program is part of the \@ref CodeGallery \"deal.II code gallery\" and
+consists of the following files (click to inspect):
 ";
 
 foreach my $file (@src_files)
index ad8af33fc30a37fbc974fe661e7bf49ccaea9bd6..e072441e06ae90e3439f66de01b9cc700b79b856 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2005 - 2015 by the deal.II authors
+// Copyright (C) 2005 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -43,9 +43,6 @@
  *     synopsis of each program.
  *   <li> or <b><a href="#topic">grouped by topic</a></b>.
  * </ol>
- * Some of the programs also jointly form
- * the <a href="../../doxygen/deal.II/group__geodynamics.html">geodynamics
- * demonstration suite</a>.
  *
  * The programs are in the <code>examples/</code> directory of your local
  * deal.II installation. After compiling the library itself, if you go into
  * different directories are based on the 
  * <a href="../../users/cmakelists.html" target="_top">small program Makefile template</a>.
  *
+ * @note Some of the tutorial programs also jointly form
+ *   the <a href="../../doxygen/deal.II/group__geodynamics.html">geodynamics
+ *   demonstration suite</a>. More, often more complex but less well documented,
+ *   deal.II-based programs than the ones that form the tutorial can also be
+ *   found in the @ref CodeGallery .
+ *
+ *
  * <a name="graph"></a>
+ * @anchor TutorialConnectionGraph
  * <h3>Connections between tutorial programs</h3>
  *
  * The following graph shows the connections between tutorial programs and

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.