docs: Add go runtime to platform dropdown for sdk api code samples

This commit is contained in:
choir27
2024-07-22 14:33:07 -04:00
parent eefdc3485d
commit b2f37c4f94
2 changed files with 8 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import type { LanguageFn } from 'highlight.js';
import hljs from 'highlight.js/lib/core';
import go from 'highlight.js/lib/languages/go';
import dart from 'highlight.js/lib/languages/dart';
import javascript from 'highlight.js/lib/languages/javascript';
import typescript from 'highlight.js/lib/languages/typescript';
@@ -56,6 +57,7 @@ const languages = {
text: plaintext,
graphql: graphql,
http: http,
go: go,
py: python,
rb: ruby,
cs: csharp,
@@ -86,6 +88,7 @@ const platformAliases: Record<string, keyof typeof languages> = {
[Platform.ServerKotlin]: 'kotlin',
[Platform.ServerGraphql]: 'graphql',
[Platform.ServerRest]: 'http',
[Platform.ServerGo]: 'go',
vue: 'html',
svelte: 'html'
};

View File

@@ -43,7 +43,8 @@ export enum Platform {
ServerJava = 'server-java',
ServerDotNet = 'server-dotnet',
ServerGraphql = 'server-graphql',
ServerRest = 'server-rest'
ServerRest = 'server-rest',
ServerGo = 'server-go'
}
export const platformMap: Record<Language | string, string> = {
@@ -67,6 +68,7 @@ export const platformMap: Record<Language | string, string> = {
[Platform.ServerJava]: 'Java',
[Platform.ServerGraphql]: 'GraphQL',
[Platform.ServerRest]: 'REST',
[Platform.ServerGo]: 'Go',
sh: 'Shell',
js: 'JavaScript',
ts: 'TypeScript',
@@ -101,7 +103,8 @@ export const platformMap: Record<Language | string, string> = {
text: 'Text',
vue: 'Vue',
svelte: 'Svelte',
groovy: 'Groovy'
groovy: 'Groovy',
go: 'Go',
};
export const serviceMap: Record<Service, string> = {