Changeset 942
- Timestamp:
- Jun 18, 2012 6:19:12 PM (13 years ago)
- Location:
- specdomain/src/specdomain
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified specdomain/src/specdomain/LICENSE ¶
r912 r942 1 If not otherwise noted, the extensions in this package are licensed 2 under the following license. 1 Copyright (c) 2011-2012, UChicago Argonne, LLC 3 2 4 Copyright (c) 2010 by the contributors (see AUTHORS file). 5 All rights reserved. 3 All Rights Reserved 6 4 7 Redistribution and use in source and binary forms, with or without 8 modification, are permitted provided that the following conditions are 9 met: 5 specdomain 10 6 11 * Redistributions of source code must retain the above copyright 12 notice, this list of conditions and the following disclaimer. 7 BCDA, Advanced Photon Source, Argonne National Laboratory 13 8 14 * Redistributions in binary form must reproduce the above copyright15 notice, this list of conditions and the following disclaimer in the16 documentation and/or other materials provided with the distribution.17 9 18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 OPEN SOURCE LICENSE 11 12 Redistribution and use in source and binary forms, with or without 13 modification, are permitted provided that the following conditions are met: 14 15 1. Redistributions of source code must retain the above copyright notice, 16 this list of conditions and the following disclaimer. Software changes, 17 modifications, or derivative works, should be noted with comments and 18 the author and organization's name. 19 20 2. Redistributions in binary form must reproduce the above copyright notice, 21 this list of conditions and the following disclaimer in the documentation 22 and/or other materials provided with the distribution. 23 24 3. Neither the names of UChicago Argonne, LLC or the Department of Energy 25 nor the names of its contributors may be used to endorse or promote 26 products derived from this software without specific prior written 27 permission. 28 29 4. The software and the end-user documentation included with the 30 redistribution, if any, must include the following acknowledgment: 31 32 "This product includes software produced by UChicago Argonne, LLC 33 under Contract No. DE-AC02-06CH11357 with the Department of Energy." 34 35 **************************************************************************** 36 37 DISCLAIMER 38 39 THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. 40 41 Neither the United States GOVERNMENT, nor the United States Department 42 of Energy, NOR uchicago argonne, LLC, nor any of their employees, makes 43 any warranty, express or implied, or assumes any legal liability or 44 responsibility for the accuracy, completeness, or usefulness of any 45 information, data, apparatus, product, or process disclosed, or 46 represents that its use would not infringe privately owned rights. 47 48 **************************************************************************** -
TabularUnified specdomain/src/specdomain/sphinxcontrib/specdomain.py ¶
r941 r942 4 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 5 6 SPEC domain. 7 8 :copyright: Copyright 2012 by Pete Jemian 9 :license: BSD, see LICENSE for details. 6 :synopsis: SPEC domain for Sphinx 7 8 Automatically insert ReST-formatted extended comments 9 from SPEC files for macro definitions and variable declarations into 10 the Sphinx doctree, thus avoiding duplication between docstrings and documentation 11 for those who like elaborate docstrings. 12 13 :copyright: Copyright 2012 by BCDA, Advanced Photon Source, Argonne National Laboratory 14 :license: ANL Open Source License, see LICENSE for details. 10 15 """ 11 16 … … 25 30 from sphinx.domains import Domain, ObjType, Index #@UnusedImport 26 31 from sphinx.util.compat import Directive #@UnusedImport 27 from sphinx.util.nodes import make_refnode 32 from sphinx.util.nodes import make_refnode, nested_parse_with_titles 28 33 from sphinx.util.docfields import Field, TypedField 29 34 from sphinx.util.docstrings import prepare_docstring #@UnusedImport 35 36 from docutils.statemachine import ViewList, string2lines 37 import sphinx.util.nodes 38 30 39 31 40 match_all = r'.*' … … 199 208 ''' 200 209 extended_comments_list = self.parse_macro_file(sig) 210 view = ViewList([u'TODO: recognize the ReST formatting in the following extended comment and it needs to be cleaned up']) 211 node = nodes.paragraph() 212 node.document = self.state.document 213 self.state.nested_parse(view, 0, signode) 214 # TODO: recognize the ReST formatting in the following extended comment and it needs to be cleaned up 201 215 for extended_comment in extended_comments_list: 202 linenumber = -1 # FIXME:203 #for line in prepare_docstring(extended_comment, ignore=1):204 # self.result.append(self.indent + line, sig, linenumber) # FIXME:216 for line in string2lines(extended_comment): 217 view = ViewList([line]) 218 nested_parse_with_titles(self.state, view, signode) 205 219 return sig 206 220 … … 227 241 #e = node.end() 228 242 #t = buf[s:e] 229 results.append(node.groups() ) # TODO: can we get line number also?243 results.append(node.groups()[0]) # TODO: can we get line number also? 230 244 return results 231 245 -
TabularUnified specdomain/src/specdomain/test/test_doc.rst ¶
r940 r942 147 147 .. This should document the Python module supporting the specdomain 148 148 149 .. py:function:: test.testdoc.radius(x, y) 150 151 :param float x: ordinate 152 :param float y: abcissa 153 :returns float: hypotenuse 154 155 return math.sqrt(x*x + y*y) 156 149 157 :class:`SpecVariableObject` (Python Module) 150 158 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ … … 160 168 161 169 162 SPEC macro source file 163 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 170 SPEC macro source file: ``cdef-examples.mac`` 171 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 164 172 165 173 .. spec:macrofile:: cdef-examples.mac 174 175 176 SPEC macro source file: ``test-battery.mac`` 177 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 178 179 .. spec:macrofile:: test-battery.mac
Note: See TracChangeset
for help on using the changeset viewer.