File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
packages/docusaurus-theme-openapi-docs/src/theme Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 6767 background-color : transparent ;
6868}
6969
70+ .openapi-schema__circular {
71+ display : inline-flex ;
72+ align-items : center ;
73+ font-size : 10.5px ;
74+ font-weight : bold ;
75+ text-transform : uppercase ;
76+ color : var (--openapi-circular );
77+ margin-left : 1% ;
78+ background-color : transparent ;
79+ }
80+
7081.openapi-schema__strikethrough {
7182 text-decoration : line-through ;
7283}
Original file line number Diff line number Diff line change @@ -92,6 +92,17 @@ export default function SchemaItem(props: Props) {
9292 < span className = "openapi-schema__nullable" > nullable</ span >
9393 ) ) ;
9494
95+ const circularMatch =
96+ typeof schemaName === "string" && schemaName . startsWith ( "circular(" )
97+ ? schemaName . match ( / ^ c i r c u l a r \\ ( ( [ ^ ) ] * ) \\ ) / )
98+ : null ;
99+
100+ const renderCircular = guard ( circularMatch , ( ) => (
101+ < span className = "openapi-schema__circular" >
102+ { circularMatch ? `circular(${ circularMatch [ 1 ] } )` : "circular" }
103+ </ span >
104+ ) ) ;
105+
95106 const renderEnumDescriptions = guard (
96107 getEnumDescriptionMarkdown ( enumDescriptions ) ,
97108 ( value ) => {
@@ -206,6 +217,7 @@ export default function SchemaItem(props: Props) {
206217 { renderNullable }
207218 { renderRequired }
208219 { renderDeprecated }
220+ { renderCircular }
209221 </ span >
210222 { renderSchemaDescription }
211223 { renderEnumDescriptions }
Original file line number Diff line number Diff line change 4646 --openapi-required : var (--ifm-color-danger );
4747 --openapi-deprecated : var (--ifm-color-warning );
4848 --openapi-nullable : var (--ifm-color-info );
49+ --openapi-circular : var (--ifm-color-primary );
4950 --openapi-code-blue : var (--ifm-color-info );
5051 --openapi-code-red : var (--ifm-color-danger );
5152 --openapi-code-orange : var (--ifm-color-warning );
You can’t perform that action at this time.
0 commit comments