getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r4878 - in /trunk/getfem: bin/split_cmdref doc/sphinx/M


From: Yves . Renard
Subject: [Getfem-commits] r4878 - in /trunk/getfem: bin/split_cmdref doc/sphinx/Makefile.am doc/sphinx/source/userdoc/model.rst
Date: Tue, 10 Mar 2015 14:23:11 -0000

Author: renard
Date: Tue Mar 10 15:23:10 2015
New Revision: 4878

URL: http://svn.gna.org/viewcvs/getfem?rev=4878&view=rev
Log:
Interface documentation : one file per command

Added:
    trunk/getfem/bin/split_cmdref
Modified:
    trunk/getfem/doc/sphinx/Makefile.am
    trunk/getfem/doc/sphinx/source/userdoc/model.rst

Added: trunk/getfem/bin/split_cmdref
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/bin/split_cmdref?rev=4878&view=auto
==============================================================================
--- trunk/getfem/bin/split_cmdref       (added)
+++ trunk/getfem/bin/split_cmdref       Tue Mar 10 15:23:10 2015
@@ -0,0 +1,91 @@
+#!/usr/bin/env python
+# -*- python -*-
+#
+# Copyright (C) 2004-2015 Yves Renard.
+#                                                       
+# This file is a part of GETFEM++                                         
+#                                                                         
+# GetFEM++  is  free software;  you  can  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.
+# 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 Lesser General Public
+# License for more details.
+# You  should  have received a copy of the GNU Lesser General Public License
+# along  with  this program;  if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
+#
+############################################################################
+"""  Autofunc and autodoc for Python, Matlab and Scilab interfaces.
+
+  This program is used to the command ref documentation produced by the
+  script extract_doc.
+
+  $Id: extract_doc 3304 2009-11-03 13:17:46Z renard $
+"""
+import re
+import string
+import os
+import textwrap
+import sys
+
+class ParseError(Exception):
+    def __init__(self, value):
+      self.value = value
+    def __str__(self):
+      return repr(self.value)
+
+
+
+if (len(sys.argv) != 2):
+    raise SystemExit, 'Format : split_cmdref directory'
+
+directory = sys.argv[1]
+
+os.system('rm -f ' + directory + '/cmdref_*.rst')
+
+fl = open(directory + '/cmdref.rst')
+flw = open(directory + '/cmdref_new.rst', 'w')
+flcom = 0;
+state = 0 # 0 = preambule, 1 = read a command
+old_l = '';
+for l in fl:
+    if (l[0:21] == "---------------------"):
+        command_name = old_l.strip();
+        if (state == 0):
+            flw.write('\n');
+            flw.write('.. toctree::\n');
+            flw.write('   :maxdepth: 2\n\n');
+        flw.write('   cmdref_' + command_name + '\n');    
+        state = 1
+        if (flcom):
+            flcom.close()
+        flcom = open(directory + '/cmdref_' + command_name + '.rst', 'w')
+        flcom.write('.. Automatically generated file, do not edit it.\n')
+        flcom.write('.. If some modification are necessary, please modify\n')
+        flcom.write('.. the corresponding C++ source or the python program 
extract_doc.\n\n')
+        flcom.write('.. include:: ../replaces.txt\n\n')        
+        flcom.write(command_name+'\n')
+    else:
+        if (state == 0):
+            flw.write(old_l)
+        else:
+            flcom.write(old_l)
+    old_l = l
+
+
+if (state == 0):
+    flw.write(l)
+else:
+    flcom.write(l)
+
+
+flw.close()
+if (flcom):
+    flcom.close()
+
+os.system('mv -f '+directory+'/cmdref.rst '+directory+'/cmdref.rst.org')
+os.system('mv -f '+directory+'/cmdref_new.rst '+directory+'/cmdref.rst')
+

Modified: trunk/getfem/doc/sphinx/Makefile.am
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/doc/sphinx/Makefile.am?rev=4878&r1=4877&r2=4878&view=diff
==============================================================================
--- trunk/getfem/doc/sphinx/Makefile.am (original)
+++ trunk/getfem/doc/sphinx/Makefile.am Tue Mar 10 15:23:10 2015
@@ -117,14 +117,14 @@
        -rm -f $(srcdir)/source/scilab/cmdref.rst
        -rm -f $(srcdir)/source/python/cmdref.rst
 
-$(srcdir)/source/matlab/cmdref.rst : $(top_srcdir)/interface/src/*.cc 
$(top_srcdir)/bin/extract_doc
-       $(top_srcdir)/bin/extract_doc $(top_srcdir)/interface/src matlab-doc > 
$(srcdir)/source/matlab/cmdref.rst || (rm -f 
$(srcdir)/source/matlab/cmdref.rst; /bin/false )
+$(srcdir)/source/matlab/cmdref.rst : $(top_srcdir)/interface/src/*.cc 
$(top_srcdir)/bin/extract_doc $(top_srcdir)/bin/split_cmdref
+       ($(top_srcdir)/bin/extract_doc $(top_srcdir)/interface/src matlab-doc > 
$(srcdir)/source/matlab/cmdref.rst &&  $(top_srcdir)/bin/split_cmdref 
$(srcdir)/source/matlab) || (rm -f $(srcdir)/source/matlab/cmdref.rst; 
/bin/false )
 
-$(srcdir)/source/scilab/cmdref.rst : $(top_srcdir)/interface/src/*.cc 
$(top_srcdir)/bin/extract_doc
-       $(top_srcdir)/bin/extract_doc $(top_srcdir)/interface/src 
scilab-doc-rst > $(srcdir)/source/scilab/cmdref.rst || (rm -f 
$(srcdir)/source/scilab/cmdref.rst; /bin/false )
+$(srcdir)/source/scilab/cmdref.rst : $(top_srcdir)/interface/src/*.cc 
$(top_srcdir)/bin/extract_doc $(top_srcdir)/bin/split_cmdref
+       ($(top_srcdir)/bin/extract_doc $(top_srcdir)/interface/src 
scilab-doc-rst > $(srcdir)/source/scilab/cmdref.rst  &&  
$(top_srcdir)/bin/split_cmdref $(srcdir)/source/scilab) || (rm -f 
$(srcdir)/source/scilab/cmdref.rst; /bin/false )
 
-$(srcdir)/source/python/cmdref.rst : $(top_srcdir)/interface/src/*.cc 
$(top_srcdir)/bin/extract_doc
-       $(top_srcdir)/bin/extract_doc $(top_srcdir)/interface/src python-doc > 
$(srcdir)/source/python/cmdref.rst || (rm -f 
$(srcdir)/source/python/cmdref.rst; /bin/false )
+$(srcdir)/source/python/cmdref.rst : $(top_srcdir)/interface/src/*.cc 
$(top_srcdir)/bin/extract_doc $(top_srcdir)/bin/split_cmdref
+       ($(top_srcdir)/bin/extract_doc $(top_srcdir)/interface/src python-doc > 
$(srcdir)/source/python/cmdref.rst  &&  $(top_srcdir)/bin/split_cmdref 
$(srcdir)/source/python) || (rm -f $(srcdir)/source/python/cmdref.rst; 
/bin/false )
 
 upload:
        rm -fr build

Modified: trunk/getfem/doc/sphinx/source/userdoc/model.rst
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/doc/sphinx/source/userdoc/model.rst?rev=4878&r1=4877&r2=4878&view=diff
==============================================================================
--- trunk/getfem/doc/sphinx/source/userdoc/model.rst    (original)
+++ trunk/getfem/doc/sphinx/source/userdoc/model.rst    Tue Mar 10 15:23:10 2015
@@ -38,24 +38,24 @@
 .. toctree::
    :maxdepth: 2
   
-   model_object.rst
-   model_generic_assembly.rst
-   model_generic_elliptic.rst
-   model_dirichlet.rst
-   model_source_term.rst
-   model_solvers.rst
-   model_poisson.rst
-   model_Nitsche.rst
-   model_constraint.rst
-   model_explicit.rst
-   model_helmholtz.rst
-   model_fourier_robin.rst
-   model_linear_elasticity.rst
-   model_mass.rst
-   model_time_integration.rst
-   model_nonlinear_elasticity.rst
-   model_contact_friction.rst
-   model_contact_friction_large_sliding.rst
-   model_elastoplasticity.rst
-   model_bilaplacian.rst
-   model_continuation.rst
+   model_object
+   model_generic_assembly
+   model_generic_elliptic
+   model_dirichlet
+   model_source_term
+   model_solvers
+   model_poisson
+   model_Nitsche
+   model_constraint
+   model_explicit
+   model_helmholtz
+   model_fourier_robin
+   model_linear_elasticity
+   model_mass
+   model_time_integration
+   model_nonlinear_elasticity
+   model_contact_friction
+   model_contact_friction_large_sliding
+   model_elastoplasticity
+   model_bilaplacian
+   model_continuation




reply via email to

[Prev in Thread] Current Thread [Next in Thread]