@@ -99,6 +99,7 @@ class Validator(object):
99
99
'type' : 'object' ,
100
100
'oneOf' : [
101
101
{'$ref' : '#/definitions/header' },
102
+ {'$ref' : '#/definitions/category' },
102
103
{'$ref' : '#/definitions/common' },
103
104
],
104
105
},
@@ -126,6 +127,30 @@ class Validator(object):
126
127
},
127
128
},
128
129
},
130
+ 'category' : {
131
+ 'require' : ['type' , 'key' ],
132
+ 'additionalProperties' : False ,
133
+ 'properties' : {
134
+ 'type' : {
135
+ 'type' : 'string' ,
136
+ 'enum' : ['category' ],
137
+ },
138
+ 'key' : {
139
+ 'type' : 'array' ,
140
+ 'items' : {
141
+ 'type' : 'string' ,
142
+ 'pattern' : '^[^"<>]+$' ,
143
+ },
144
+ },
145
+ 'cpp_namespace' : {
146
+ 'type' : 'array' ,
147
+ 'items' : {
148
+ 'type' : 'string' ,
149
+ 'pattern' : '^[^:]+$' ,
150
+ },
151
+ },
152
+ },
153
+ },
129
154
'common' : {
130
155
'require' : ['type' , 'key' ],
131
156
'additionalProperties' : False ,
@@ -250,12 +275,14 @@ def get_meta(self, md):
250
275
def identify_type (metas , names , nojump ):
251
276
# type 判別
252
277
# metas['id-type']: class, class template, function, function template, enum, variable, type-alias, concept, named requirement, macro, namespace
253
- # type: "header" / "class" / "function" / "mem_fun" / "macro" / "enum" / "variable"/ "type-alias" / "concept" / "named requirement" / "article"
278
+ # type: "header" / "category" / " class" / "function" / "mem_fun" / "macro" / "enum" / "variable"/ "type-alias" / "concept" / "named requirement" / "article"
254
279
if nojump :
255
280
return 'meta'
256
281
elif 'id-type' not in metas :
257
282
if 'header' in metas :
258
283
return 'header'
284
+ elif 'category' in metas :
285
+ return 'category'
259
286
elif names [0 ] == 'article' :
260
287
# それ以外の article/ の下は article 扱いにする
261
288
return 'article'
@@ -327,6 +354,11 @@ def make_index(self, md, names, idgen, nojump):
327
354
'type' : 'header' ,
328
355
'key' : metas ['header' ][0 ].split ('/' ),
329
356
}))
357
+ if 'category' in metas :
358
+ related_to .append (idgen .get_indexid ({
359
+ 'type' : 'category' ,
360
+ 'key' : metas ['category' ][0 ].split ('/' ),
361
+ }))
330
362
331
363
if len (related_to ) != 0 :
332
364
index ['related_to' ] = related_to
0 commit comments