@@ -40,19 +40,31 @@ def field_names(cls) -> set[str]:
4040 "schema" : {
4141 "type" : "object" ,
4242 "properties" : {
43- "row" : {"type" : "integer" },
44- "column" : {"type" : "integer" },
43+ "start" : {
44+ "type" : "object" ,
45+ "properties" : {
46+ "row" : {"type" : "integer" },
47+ "column" : {"type" : "integer" },
48+ },
49+ "required" : ["row" , "column" ],
50+ },
51+ "end" : {
52+ "type" : "object" ,
53+ "properties" : {
54+ "row" : {"type" : "integer" },
55+ "column" : {"type" : "integer" },
56+ },
57+ "required" : ["row" , "column" ],
58+ },
4559 },
46- "required" : ["row " , "column " ],
60+ "required" : ["start " , "end " ],
4761 "additionalProperties" : False ,
4862 }
4963 }
5064 )
5165 """Coordinate of the marked content in a file"""
5266
53- tagged_scope : str | None = field (
54- metadata = {"schema" : {"type" : "string" , "nullable" : True }}
55- )
67+ tagged_scope : str | None = field (metadata = {"schema" : {"type" : ["string" , "null" ]}})
5668 """The scoped tagged by the marked content"""
5769
5870 type : MarkedContentType = field (
@@ -66,20 +78,20 @@ def field_names(cls) -> set[str]:
6678 """Type of the marked content."""
6779
6880 marker : str | None = field (
69- default = None , metadata = {"schema" : {"type" : "string" , "nullable" : True }}
81+ default = None , metadata = {"schema" : {"type" : [ "string" , "null" ] }}
7082 )
7183 """Marker of the marked content."""
7284
7385 need_ids : list [str ] | None = field (
7486 default = None ,
75- metadata = {"schema" : {"type" : "array" , "items" : {"type" : "string" }}},
87+ metadata = {"schema" : {"type" : [ "array" , "null" ] , "items" : {"type" : "string" }}},
7688 )
7789 """Need id refs which is associated to the need items in the documentation."""
7890 need : dict [str , str | list [str ]] | None = field (
7991 default = None ,
8092 metadata = {
8193 "schema" : {
82- "type" : "object" ,
94+ "type" : [ "object" , "null" ] ,
8395 "properties" : {"title" : {"type" : "string" }, "id" : {"title" : "string" }},
8496 "required" : ["title" , "id" ],
8597 "additionalProperties" : True ,
@@ -89,7 +101,7 @@ def field_names(cls) -> set[str]:
89101 """Definition of a need item"""
90102
91103 rst : str | None = field (
92- default = None , metadata = {"schema" : {"type" : "string" , "nullable" : True }}
104+ default = None , metadata = {"schema" : {"type" : [ "string" , "null" ] }}
93105 )
94106 """Extracted rst text."""
95107
@@ -151,7 +163,7 @@ class MarkedObjType(TypedDict):
151163 rst : str | None
152164
153165
154- def convert_makred_content (
166+ def convert_marked_content (
155167 jsonpath : Path , outdir : Path , remote_url_field : str = "remote_url"
156168) -> None :
157169 """Convert marked objects extracted by anaylse CLI to needextend in RST"""
@@ -172,7 +184,7 @@ def convert_makred_content(
172184 obj_warnings .extend (schema .check_schema ())
173185 obj_warnings .extend (schema .check_conditional_required_fields ())
174186 if obj_warnings :
175- obj_warnings .appendleft (f"Marked object { obj } has the following warnings:" )
187+ obj_warnings .appendleft (f"{ obj } has the following warnings:" )
176188 warnings .extend (list (obj_warnings ))
177189
178190 if warnings :
@@ -193,3 +205,5 @@ def convert_makred_content(
193205 needextend_path = outdir / "needextend.rst"
194206 with needextend_path .open ("w" ) as f :
195207 f .writelines (needextend_texts )
208+
209+ logger .info (f"Generated needextend.rst in { needextend_path } " )
0 commit comments