From 29dedfed4dd82eb4d043d98380e129c8ae515263 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 12 Jul 2019 14:01:19 +0200 Subject: [PATCH] documentation/python: test link formatting also for type links. --- .../c.link_formatting.Class.html | 2 +- .../link_formatting/__init__.py | 18 ++++++++++-------- .../link_formatting/m.link_formatting.html | 6 +++--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/documentation/test_python/link_formatting/c.link_formatting.Class.html b/documentation/test_python/link_formatting/c.link_formatting.Class.html index 4989c9b0..2fb12127 100644 --- a/documentation/test_python/link_formatting/c.link_formatting.Class.html +++ b/documentation/test_python/link_formatting/c.link_formatting.Class.html @@ -64,7 +64,7 @@

Properties

- property get + property: Enum get
A property.
diff --git a/documentation/test_python/link_formatting/link_formatting/__init__.py b/documentation/test_python/link_formatting/link_formatting/__init__.py index 7e1c65d2..df961e2e 100644 --- a/documentation/test_python/link_formatting/link_formatting/__init__.py +++ b/documentation/test_python/link_formatting/link_formatting/__init__.py @@ -4,6 +4,14 @@ import enum from . import sub, pybind +class Enum(enum.Enum): + """An enum""" + + FIRST_VALUE = 1 + SECOND_VALUE = 2 + +SOME_DATA: Enum = Enum.FIRST_VALUE + class Class: """This is a nice class.""" @@ -11,14 +19,8 @@ class Class: """And a nice subclass, oh.""" @property - def property(self): + def property(self) -> Enum: """A property.""" -def function(): +def function(a: Class) -> Enum: """A function.""" - -SOME_DATA = 3.14 - -class Enum(enum.Enum): - FIRST_VALUE = 1 - SECOND_VALUE = 2 diff --git a/documentation/test_python/link_formatting/m.link_formatting.html b/documentation/test_python/link_formatting/m.link_formatting.html index 13a7059a..76dc48b7 100644 --- a/documentation/test_python/link_formatting/m.link_formatting.html +++ b/documentation/test_python/link_formatting/m.link_formatting.html @@ -79,14 +79,14 @@ class Enum(enum.Enum): FIRST_VALUE = 1 SECOND_VALUE = 2 -
+
An enum

Functions

- def function() + def function(a: Class) -> Enum
A function.
@@ -95,7 +95,7 @@

Data

- SOME_DATA = 3.14 + SOME_DATA: Enum
-- 2.30.2