@@ -81,13 +81,9 @@ type `Vector{Any}`.
81
81
82
82
- `x::String`
83
83
84
- - `y::Int`
84
+ - `y::Int`: Unlike the `x` field this field has been documented.
85
85
86
- Unlike the `x` field this field has been documented.
87
-
88
- - `z::Array{Any, 1}`
89
-
90
- Another documented field.
86
+ - `z::Array{Any, 1}`: Another documented field.
91
87
```
92
88
"""
93
89
const TYPEDFIELDS = TypeFields (true )
@@ -96,22 +92,20 @@ function format(abbrv::TypeFields, buf, doc)
96
92
local docs = get (doc. data, :fields , Dict ())
97
93
local binding = doc. data[:binding ]
98
94
local object = Docs. resolve (binding)
99
- # On 0.7 fieldnames() on an abstract type throws an error. We then explicitly return
100
- # an empty vector to be consistent with the behaviour on v0.6.
101
95
local fields = isabstracttype (object) ? Symbol[] : fieldnames (object)
102
96
if ! isempty (fields)
103
97
println (buf)
104
98
for field in fields
105
- if abbrv. types
106
- println (buf, " - `" , field, " ::" , fieldtype (object, field), " `" )
107
- else
108
- println (buf, " - `" , field, " `" )
109
- end
99
+ print (buf, " - `" , field)
100
+ abbrv. types && print (buf, " ::" , fieldtype (object, field))
101
+ println (buf, " `" )
110
102
# Print the field docs if they exist and aren't a `doc"..."` docstring.
111
103
if haskey (docs, field) && isa (docs[field], AbstractString)
112
- println (buf)
104
+ print (buf, " : " )
105
+ indented = true
113
106
for line in split (docs[field], " \n " )
114
- println (buf, isempty (line) ? " " : " " , rstrip (line))
107
+ println (buf, indented || isempty (line) ? " " : " " , rstrip (line))
108
+ indented = false
115
109
end
116
110
end
117
111
println (buf)
0 commit comments