Commits

Mark Story committed 5ea836c

Fix error when creating namespace at top of document.

Fix errors when a namespace is the first node in
a document. Fixes Pull request #6

Comments (0)

Files changed (3)

phpdomain/sphinxcontrib/phpdomain.py

                 modname = self.options.get(
                     'namespace', self.env.temp_data.get('php:namespace'))
 
-                if modname and 'php:in_class' in self.env.temp_data and not self.env.temp_data['php:in_class']:
+                if modname and not self.env.temp_data.get('php:in_class', False):
                     nodetext = modname + NS
                     signode += addnodes.desc_addname(nodetext, nodetext)
 

phpdomain/test/index.rst

    :maxdepth: 2
 
    test_doc
+   test_doc2
    
 Indices and tables
 ==================

phpdomain/test/test_doc2.rst

+Top Level Namespace
+###################
+
+namespace ``Imagine\Draw``
+
+.. php:namespace:: Imagine\Draw
+
+.. php:class:: DrawerInterface
+
+Instance of this interface is returned by :php:meth:`Imagine\Image\ImageInterface::draw`.
+
+.. php:method:: arc(PointInterface $center, BoxInterface $size, $start, $end, Color $color)
+
+    Draws an arc on a starting at a given x, y coordinates under a given start and end angles
+
+    :param Imagine\Image\PointInterface $center: Center of the arc. 
+    :param Imagine\Image\BoxInterface $size: Size of the bounding box.
+    :param integer $start: Start angle.
+    :param integer $end: End angle.
+    :param Imagine\Image\Color $color: Line color.
+
+    :throws: Imagine\Exception\RuntimeException
+
+    :returns: Imagine\Draw\DrawerInterface
+