raffel 1.1.76 → 1.1.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/docs/generators/http-generator.d.ts.map +1 -1
  2. package/dist/docs/generators/http-generator.js +20 -17
  3. package/dist/docs/generators/http-generator.js.map +1 -1
  4. package/dist/docs/generators/schema-converter.d.ts.map +1 -1
  5. package/dist/docs/generators/schema-converter.js +27 -10
  6. package/dist/docs/generators/schema-converter.js.map +1 -1
  7. package/dist/docs/ui/assets/code-block-toolbar.js +5 -1
  8. package/dist/docs/ui/assets/prism.js +549 -0
  9. package/dist/docs/ui/assets/raffel-docs.css +81 -2
  10. package/dist/docs/ui/assets/raffel-docs.js +35 -15
  11. package/dist/docs/ui/client-script/index.d.ts.map +1 -1
  12. package/dist/docs/ui/client-script/index.js +2 -1
  13. package/dist/docs/ui/client-script/index.js.map +1 -1
  14. package/dist/docs/ui/prism-browser-bundle.d.ts +3 -0
  15. package/dist/docs/ui/prism-browser-bundle.d.ts.map +1 -0
  16. package/dist/docs/ui/prism-browser-bundle.js +36 -0
  17. package/dist/docs/ui/prism-browser-bundle.js.map +1 -0
  18. package/dist/docs/ui/runtime/code-block-toolbar.d.ts.map +1 -1
  19. package/dist/docs/ui/runtime/code-block-toolbar.js +5 -1
  20. package/dist/docs/ui/runtime/code-block-toolbar.js.map +1 -1
  21. package/dist/docs/ui/runtime/index.js +35 -15
  22. package/dist/docs/ui/runtime/index.js.map +1 -1
  23. package/dist/docs/ui/style-sections/schema-code.d.ts +1 -1
  24. package/dist/docs/ui/style-sections/schema-code.d.ts.map +1 -1
  25. package/dist/docs/ui/style-sections/schema-code.js +81 -2
  26. package/dist/docs/ui/style-sections/schema-code.js.map +1 -1
  27. package/dist/ui/docs/generators/http-generator.d.ts.map +1 -1
  28. package/dist/ui/docs/generators/schema-converter.d.ts.map +1 -1
  29. package/dist/ui/docs/ui/client-script/index.d.ts.map +1 -1
  30. package/dist/ui/docs/ui/prism-browser-bundle.d.ts +3 -0
  31. package/dist/ui/docs/ui/prism-browser-bundle.d.ts.map +1 -0
  32. package/dist/ui/docs/ui/runtime/code-block-toolbar.d.ts.map +1 -1
  33. package/dist/ui/docs/ui/style-sections/schema-code.d.ts +1 -1
  34. package/dist/ui/docs/ui/style-sections/schema-code.d.ts.map +1 -1
  35. package/package.json +1 -1
@@ -1944,3 +1944,552 @@ Prism.languages.js = Prism.languages.javascript;
1944
1944
  };
1945
1945
 
1946
1946
  }());
1947
+
1948
+ (function (Prism) {
1949
+ // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
1950
+ // + LC_ALL, RANDOM, REPLY, SECONDS.
1951
+ // + make sure PS1..4 are here as they are not always set,
1952
+ // - some useless things.
1953
+ var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b';
1954
+
1955
+ var commandAfterHeredoc = {
1956
+ pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
1957
+ lookbehind: true,
1958
+ alias: 'punctuation', // this looks reasonably well in all themes
1959
+ inside: null // see below
1960
+ };
1961
+
1962
+ var insideString = {
1963
+ 'bash': commandAfterHeredoc,
1964
+ 'environment': {
1965
+ pattern: RegExp('\\$' + envVars),
1966
+ alias: 'constant'
1967
+ },
1968
+ 'variable': [
1969
+ // [0]: Arithmetic Environment
1970
+ {
1971
+ pattern: /\$?\(\([\s\S]+?\)\)/,
1972
+ greedy: true,
1973
+ inside: {
1974
+ // If there is a $ sign at the beginning highlight $(( and )) as variable
1975
+ 'variable': [
1976
+ {
1977
+ pattern: /(^\$\(\([\s\S]+)\)\)/,
1978
+ lookbehind: true
1979
+ },
1980
+ /^\$\(\(/
1981
+ ],
1982
+ 'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
1983
+ // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
1984
+ 'operator': /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
1985
+ // If there is no $ sign at the beginning highlight (( and )) as punctuation
1986
+ 'punctuation': /\(\(?|\)\)?|,|;/
1987
+ }
1988
+ },
1989
+ // [1]: Command Substitution
1990
+ {
1991
+ pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
1992
+ greedy: true,
1993
+ inside: {
1994
+ 'variable': /^\$\(|^`|\)$|`$/
1995
+ }
1996
+ },
1997
+ // [2]: Brace expansion
1998
+ {
1999
+ pattern: /\$\{[^}]+\}/,
2000
+ greedy: true,
2001
+ inside: {
2002
+ 'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
2003
+ 'punctuation': /[\[\]]/,
2004
+ 'environment': {
2005
+ pattern: RegExp('(\\{)' + envVars),
2006
+ lookbehind: true,
2007
+ alias: 'constant'
2008
+ }
2009
+ }
2010
+ },
2011
+ /\$(?:\w+|[#?*!@$])/
2012
+ ],
2013
+ // Escape sequences from echo and printf's manuals, and escaped quotes.
2014
+ 'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
2015
+ };
2016
+
2017
+ Prism.languages.bash = {
2018
+ 'shebang': {
2019
+ pattern: /^#!\s*\/.*/,
2020
+ alias: 'important'
2021
+ },
2022
+ 'comment': {
2023
+ pattern: /(^|[^"{\\$])#.*/,
2024
+ lookbehind: true
2025
+ },
2026
+ 'function-name': [
2027
+ // a) function foo {
2028
+ // b) foo() {
2029
+ // c) function foo() {
2030
+ // but not “foo {”
2031
+ {
2032
+ // a) and c)
2033
+ pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
2034
+ lookbehind: true,
2035
+ alias: 'function'
2036
+ },
2037
+ {
2038
+ // b)
2039
+ pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
2040
+ alias: 'function'
2041
+ }
2042
+ ],
2043
+ // Highlight variable names as variables in for and select beginnings.
2044
+ 'for-or-select': {
2045
+ pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
2046
+ alias: 'variable',
2047
+ lookbehind: true
2048
+ },
2049
+ // Highlight variable names as variables in the left-hand part
2050
+ // of assignments (“=” and “+=”).
2051
+ 'assign-left': {
2052
+ pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
2053
+ inside: {
2054
+ 'environment': {
2055
+ pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars),
2056
+ lookbehind: true,
2057
+ alias: 'constant'
2058
+ }
2059
+ },
2060
+ alias: 'variable',
2061
+ lookbehind: true
2062
+ },
2063
+ // Highlight parameter names as variables
2064
+ 'parameter': {
2065
+ pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
2066
+ alias: 'variable',
2067
+ lookbehind: true
2068
+ },
2069
+ 'string': [
2070
+ // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
2071
+ {
2072
+ pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
2073
+ lookbehind: true,
2074
+ greedy: true,
2075
+ inside: insideString
2076
+ },
2077
+ // Here-document with quotes around the tag
2078
+ // → No expansion (so no “inside”).
2079
+ {
2080
+ pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
2081
+ lookbehind: true,
2082
+ greedy: true,
2083
+ inside: {
2084
+ 'bash': commandAfterHeredoc
2085
+ }
2086
+ },
2087
+ // “Normal” string
2088
+ {
2089
+ // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
2090
+ pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
2091
+ lookbehind: true,
2092
+ greedy: true,
2093
+ inside: insideString
2094
+ },
2095
+ {
2096
+ // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
2097
+ pattern: /(^|[^$\\])'[^']*'/,
2098
+ lookbehind: true,
2099
+ greedy: true
2100
+ },
2101
+ {
2102
+ // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
2103
+ pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
2104
+ greedy: true,
2105
+ inside: {
2106
+ 'entity': insideString.entity
2107
+ }
2108
+ }
2109
+ ],
2110
+ 'environment': {
2111
+ pattern: RegExp('\\$?' + envVars),
2112
+ alias: 'constant'
2113
+ },
2114
+ 'variable': insideString.variable,
2115
+ 'function': {
2116
+ pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
2117
+ lookbehind: true
2118
+ },
2119
+ 'keyword': {
2120
+ pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
2121
+ lookbehind: true
2122
+ },
2123
+ // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
2124
+ 'builtin': {
2125
+ pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
2126
+ lookbehind: true,
2127
+ // Alias added to make those easier to distinguish from strings.
2128
+ alias: 'class-name'
2129
+ },
2130
+ 'boolean': {
2131
+ pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
2132
+ lookbehind: true
2133
+ },
2134
+ 'file-descriptor': {
2135
+ pattern: /\B&\d\b/,
2136
+ alias: 'important'
2137
+ },
2138
+ 'operator': {
2139
+ // Lots of redirections here, but not just that.
2140
+ pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
2141
+ inside: {
2142
+ 'file-descriptor': {
2143
+ pattern: /^\d/,
2144
+ alias: 'important'
2145
+ }
2146
+ }
2147
+ },
2148
+ 'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
2149
+ 'number': {
2150
+ pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
2151
+ lookbehind: true
2152
+ }
2153
+ };
2154
+
2155
+ commandAfterHeredoc.inside = Prism.languages.bash;
2156
+
2157
+ /* Patterns in command substitution. */
2158
+ var toBeCopied = [
2159
+ 'comment',
2160
+ 'function-name',
2161
+ 'for-or-select',
2162
+ 'assign-left',
2163
+ 'parameter',
2164
+ 'string',
2165
+ 'environment',
2166
+ 'function',
2167
+ 'keyword',
2168
+ 'builtin',
2169
+ 'boolean',
2170
+ 'file-descriptor',
2171
+ 'operator',
2172
+ 'punctuation',
2173
+ 'number'
2174
+ ];
2175
+ var inside = insideString.variable[1].inside;
2176
+ for (var i = 0; i < toBeCopied.length; i++) {
2177
+ inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];
2178
+ }
2179
+
2180
+ Prism.languages.sh = Prism.languages.bash;
2181
+ Prism.languages.shell = Prism.languages.bash;
2182
+ }(Prism));
2183
+
2184
+ (function (Prism) {
2185
+
2186
+ Prism.languages.typescript = Prism.languages.extend('javascript', {
2187
+ 'class-name': {
2188
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
2189
+ lookbehind: true,
2190
+ greedy: true,
2191
+ inside: null // see below
2192
+ },
2193
+ 'builtin': /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/,
2194
+ });
2195
+
2196
+ // The keywords TypeScript adds to JavaScript
2197
+ Prism.languages.typescript.keyword.push(
2198
+ /\b(?:abstract|declare|is|keyof|readonly|require)\b/,
2199
+ // keywords that have to be followed by an identifier
2200
+ /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
2201
+ // This is for `import type *, {}`
2202
+ /\btype\b(?=\s*(?:[\{*]|$))/
2203
+ );
2204
+
2205
+ // doesn't work with TS because TS is too complex
2206
+ delete Prism.languages.typescript['parameter'];
2207
+ delete Prism.languages.typescript['literal-property'];
2208
+
2209
+ // a version of typescript specifically for highlighting types
2210
+ var typeInside = Prism.languages.extend('typescript', {});
2211
+ delete typeInside['class-name'];
2212
+
2213
+ Prism.languages.typescript['class-name'].inside = typeInside;
2214
+
2215
+ Prism.languages.insertBefore('typescript', 'function', {
2216
+ 'decorator': {
2217
+ pattern: /@[$\w\xA0-\uFFFF]+/,
2218
+ inside: {
2219
+ 'at': {
2220
+ pattern: /^@/,
2221
+ alias: 'operator'
2222
+ },
2223
+ 'function': /^[\s\S]+/
2224
+ }
2225
+ },
2226
+ 'generic-function': {
2227
+ // e.g. foo<T extends "bar" | "baz">( ...
2228
+ pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
2229
+ greedy: true,
2230
+ inside: {
2231
+ 'function': /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
2232
+ 'generic': {
2233
+ pattern: /<[\s\S]+/, // everything after the first <
2234
+ alias: 'class-name',
2235
+ inside: typeInside
2236
+ }
2237
+ }
2238
+ }
2239
+ });
2240
+
2241
+ Prism.languages.ts = Prism.languages.typescript;
2242
+
2243
+ }(Prism));
2244
+
2245
+ (function (Prism) {
2246
+
2247
+ var multilineComment = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;
2248
+ for (var i = 0; i < 2; i++) {
2249
+ // support 4 levels of nested comments
2250
+ multilineComment = multilineComment.replace(/<self>/g, function () { return multilineComment; });
2251
+ }
2252
+ multilineComment = multilineComment.replace(/<self>/g, function () { return /[^\s\S]/.source; });
2253
+
2254
+
2255
+ Prism.languages.rust = {
2256
+ 'comment': [
2257
+ {
2258
+ pattern: RegExp(/(^|[^\\])/.source + multilineComment),
2259
+ lookbehind: true,
2260
+ greedy: true
2261
+ },
2262
+ {
2263
+ pattern: /(^|[^\\:])\/\/.*/,
2264
+ lookbehind: true,
2265
+ greedy: true
2266
+ }
2267
+ ],
2268
+ 'string': {
2269
+ pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,
2270
+ greedy: true
2271
+ },
2272
+ 'char': {
2273
+ pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,
2274
+ greedy: true
2275
+ },
2276
+ 'attribute': {
2277
+ pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,
2278
+ greedy: true,
2279
+ alias: 'attr-name',
2280
+ inside: {
2281
+ 'string': null // see below
2282
+ }
2283
+ },
2284
+
2285
+ // Closure params should not be confused with bitwise OR |
2286
+ 'closure-params': {
2287
+ pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,
2288
+ lookbehind: true,
2289
+ greedy: true,
2290
+ inside: {
2291
+ 'closure-punctuation': {
2292
+ pattern: /^\||\|$/,
2293
+ alias: 'punctuation'
2294
+ },
2295
+ rest: null // see below
2296
+ }
2297
+ },
2298
+
2299
+ 'lifetime-annotation': {
2300
+ pattern: /'\w+/,
2301
+ alias: 'symbol'
2302
+ },
2303
+
2304
+ 'fragment-specifier': {
2305
+ pattern: /(\$\w+:)[a-z]+/,
2306
+ lookbehind: true,
2307
+ alias: 'punctuation'
2308
+ },
2309
+ 'variable': /\$\w+/,
2310
+
2311
+ 'function-definition': {
2312
+ pattern: /(\bfn\s+)\w+/,
2313
+ lookbehind: true,
2314
+ alias: 'function'
2315
+ },
2316
+ 'type-definition': {
2317
+ pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/,
2318
+ lookbehind: true,
2319
+ alias: 'class-name'
2320
+ },
2321
+ 'module-declaration': [
2322
+ {
2323
+ pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,
2324
+ lookbehind: true,
2325
+ alias: 'namespace'
2326
+ },
2327
+ {
2328
+ pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,
2329
+ lookbehind: true,
2330
+ alias: 'namespace',
2331
+ inside: {
2332
+ 'punctuation': /::/
2333
+ }
2334
+ }
2335
+ ],
2336
+ 'keyword': [
2337
+ // https://github.com/rust-lang/reference/blob/master/src/keywords.md
2338
+ /\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,
2339
+ // primitives and str
2340
+ // https://doc.rust-lang.org/stable/rust-by-example/primitives.html
2341
+ /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/
2342
+ ],
2343
+
2344
+ // functions can technically start with an upper-case letter, but this will introduce a lot of false positives
2345
+ // and Rust's naming conventions recommend snake_case anyway.
2346
+ // https://doc.rust-lang.org/1.0.0/style/style/naming/README.html
2347
+ 'function': /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,
2348
+ 'macro': {
2349
+ pattern: /\b\w+!/,
2350
+ alias: 'property'
2351
+ },
2352
+ 'constant': /\b[A-Z_][A-Z_\d]+\b/,
2353
+ 'class-name': /\b[A-Z]\w*\b/,
2354
+
2355
+ 'namespace': {
2356
+ pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,
2357
+ inside: {
2358
+ 'punctuation': /::/
2359
+ }
2360
+ },
2361
+
2362
+ // Hex, oct, bin, dec numbers with visual separators and type suffix
2363
+ 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,
2364
+ 'boolean': /\b(?:false|true)\b/,
2365
+ 'punctuation': /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
2366
+ 'operator': /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
2367
+ };
2368
+
2369
+ Prism.languages.rust['closure-params'].inside.rest = Prism.languages.rust;
2370
+ Prism.languages.rust['attribute'].inside['string'] = Prism.languages.rust['string'];
2371
+
2372
+ }(Prism));
2373
+
2374
+ Prism.languages.python = {
2375
+ 'comment': {
2376
+ pattern: /(^|[^\\])#.*/,
2377
+ lookbehind: true,
2378
+ greedy: true
2379
+ },
2380
+ 'string-interpolation': {
2381
+ pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
2382
+ greedy: true,
2383
+ inside: {
2384
+ 'interpolation': {
2385
+ // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
2386
+ pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
2387
+ lookbehind: true,
2388
+ inside: {
2389
+ 'format-spec': {
2390
+ pattern: /(:)[^:(){}]+(?=\}$)/,
2391
+ lookbehind: true
2392
+ },
2393
+ 'conversion-option': {
2394
+ pattern: /![sra](?=[:}]$)/,
2395
+ alias: 'punctuation'
2396
+ },
2397
+ rest: null
2398
+ }
2399
+ },
2400
+ 'string': /[\s\S]+/
2401
+ }
2402
+ },
2403
+ 'triple-quoted-string': {
2404
+ pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
2405
+ greedy: true,
2406
+ alias: 'string'
2407
+ },
2408
+ 'string': {
2409
+ pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
2410
+ greedy: true
2411
+ },
2412
+ 'function': {
2413
+ pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
2414
+ lookbehind: true
2415
+ },
2416
+ 'class-name': {
2417
+ pattern: /(\bclass\s+)\w+/i,
2418
+ lookbehind: true
2419
+ },
2420
+ 'decorator': {
2421
+ pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
2422
+ lookbehind: true,
2423
+ alias: ['annotation', 'punctuation'],
2424
+ inside: {
2425
+ 'punctuation': /\./
2426
+ }
2427
+ },
2428
+ 'keyword': /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
2429
+ 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
2430
+ 'boolean': /\b(?:False|None|True)\b/,
2431
+ 'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
2432
+ 'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
2433
+ 'punctuation': /[{}[\];(),.:]/
2434
+ };
2435
+
2436
+ Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
2437
+
2438
+ Prism.languages.py = Prism.languages.python;
2439
+
2440
+ Prism.languages.go = Prism.languages.extend('clike', {
2441
+ 'string': {
2442
+ pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
2443
+ lookbehind: true,
2444
+ greedy: true
2445
+ },
2446
+ 'keyword': /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
2447
+ 'boolean': /\b(?:_|false|iota|nil|true)\b/,
2448
+ 'number': [
2449
+ // binary and octal integers
2450
+ /\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
2451
+ // hexadecimal integers and floats
2452
+ /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
2453
+ // decimal integers and floats
2454
+ /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
2455
+ ],
2456
+ 'operator': /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
2457
+ 'builtin': /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
2458
+ });
2459
+
2460
+ Prism.languages.insertBefore('go', 'string', {
2461
+ 'char': {
2462
+ pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
2463
+ greedy: true
2464
+ }
2465
+ });
2466
+
2467
+ delete Prism.languages.go['class-name'];
2468
+
2469
+ // https://www.json.org/json-en.html
2470
+ Prism.languages.json = {
2471
+ 'property': {
2472
+ pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
2473
+ lookbehind: true,
2474
+ greedy: true
2475
+ },
2476
+ 'string': {
2477
+ pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
2478
+ lookbehind: true,
2479
+ greedy: true
2480
+ },
2481
+ 'comment': {
2482
+ pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
2483
+ greedy: true
2484
+ },
2485
+ 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
2486
+ 'punctuation': /[{}[\],]/,
2487
+ 'operator': /:/,
2488
+ 'boolean': /\b(?:false|true)\b/,
2489
+ 'null': {
2490
+ pattern: /\bnull\b/,
2491
+ alias: 'keyword'
2492
+ }
2493
+ };
2494
+
2495
+ Prism.languages.webmanifest = Prism.languages.json;
@@ -3646,7 +3646,8 @@
3646
3646
  white-space: pre;
3647
3647
  }
3648
3648
 
3649
- .http-code-copy {
3649
+ .http-code-copy,
3650
+ .sample-code-copy {
3650
3651
  margin-left: auto;
3651
3652
  padding: 4px 10px;
3652
3653
  background: transparent;
@@ -3658,7 +3659,11 @@
3658
3659
  transition: all 0.15s;
3659
3660
  }
3660
3661
 
3661
- .http-code-copy:hover { color: var(--text-color); border-color: var(--text-muted); }
3662
+ .http-code-copy:hover,
3663
+ .sample-code-copy:hover {
3664
+ color: #fff;
3665
+ border-color: #90a4ae;
3666
+ }
3662
3667
 
3663
3668
  /* Right panel (third column): keep request/response samples dark & legible
3664
3669
  regardless of the active theme, matching ReDoc's sample column. */
@@ -3680,6 +3685,80 @@
3680
3685
  color: var(--code-panel-text);
3681
3686
  }
3682
3687
 
3688
+ .response-example-toolbar {
3689
+ display: flex;
3690
+ align-items: center;
3691
+ gap: 12px;
3692
+ min-height: 28px;
3693
+ margin: 4px 0 8px;
3694
+ }
3695
+
3696
+ .response-example-toolbar .response-example-name {
3697
+ margin: 0;
3698
+ }
3699
+
3700
+ .endpoint-right .sample-code {
3701
+ margin: 0;
3702
+ padding: 14px;
3703
+ overflow-x: auto;
3704
+ border: 1px solid rgba(255,255,255,0.1);
3705
+ border-radius: 6px;
3706
+ background: rgba(0,0,0,0.25);
3707
+ color: var(--code-panel-text);
3708
+ white-space: pre;
3709
+ word-break: normal;
3710
+ }
3711
+
3712
+ .endpoint-right .sample-code code {
3713
+ color: inherit;
3714
+ font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
3715
+ font-size: 12px;
3716
+ line-height: 1.55;
3717
+ white-space: inherit;
3718
+ }
3719
+
3720
+ .endpoint-right .token.comment,
3721
+ .endpoint-right .token.prolog,
3722
+ .endpoint-right .token.doctype,
3723
+ .endpoint-right .token.cdata {
3724
+ color: #90a4ae;
3725
+ }
3726
+
3727
+ .endpoint-right .token.punctuation { color: #cfd8dc; }
3728
+
3729
+ .endpoint-right .token.property,
3730
+ .endpoint-right .token.tag,
3731
+ .endpoint-right .token.boolean,
3732
+ .endpoint-right .token.number,
3733
+ .endpoint-right .token.constant,
3734
+ .endpoint-right .token.symbol {
3735
+ color: #f8b500;
3736
+ }
3737
+
3738
+ .endpoint-right .token.selector,
3739
+ .endpoint-right .token.attr-name,
3740
+ .endpoint-right .token.string,
3741
+ .endpoint-right .token.char,
3742
+ .endpoint-right .token.builtin {
3743
+ color: #a5d6a7;
3744
+ }
3745
+
3746
+ .endpoint-right .token.operator,
3747
+ .endpoint-right .token.entity,
3748
+ .endpoint-right .token.url,
3749
+ .endpoint-right .token.variable {
3750
+ color: #89ddff;
3751
+ }
3752
+
3753
+ .endpoint-right .token.atrule,
3754
+ .endpoint-right .token.attr-value,
3755
+ .endpoint-right .token.function,
3756
+ .endpoint-right .token.class-name {
3757
+ color: #82aaff;
3758
+ }
3759
+
3760
+ .endpoint-right .token.keyword { color: #c792ea; }
3761
+
3683
3762
  .endpoint-right .code-tab {
3684
3763
  color: #90a4ae;
3685
3764
  }