-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from stackb/highlighter
Add syntax highlighting service
- Loading branch information
Showing
5 changed files
with
411 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
load("@build_stack_rules_proto//rules:proto_compiled_sources.bzl", "proto_compiled_sources") | ||
|
||
proto_library( | ||
name = "syntax_highlight_proto", | ||
srcs = ["syntax_highlight.proto"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
proto_compiled_sources( | ||
name = "syntax_highlight_go_compiled_sources", | ||
srcs = [ | ||
"syntax_highlight.pb.go", | ||
"syntax_highlight_grpc.pb.go", | ||
], | ||
output_mappings = [ | ||
"syntax_highlight.pb.go=github.com/stackb/bezel/proto/syntax_highlight/syntax_highlight.pb.go", | ||
"syntax_highlight_grpc.pb.go=github.com/stackb/bezel/proto/syntax_highlight/syntax_highlight_grpc.pb.go", | ||
], | ||
plugins = [ | ||
"@build_stack_rules_proto//plugin/golang/protobuf:protoc-gen-go", | ||
"@build_stack_rules_proto//plugin/grpc/grpc-go:protoc-gen-go-grpc", | ||
], | ||
proto = "syntax_highlight_proto", | ||
visibility = ["//visibility:public"], | ||
) |
255 changes: 255 additions & 0 deletions
255
build/stack/syntax_highlight/v1beta1/syntax_highlight.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
build/stack/syntax_highlight/v1beta1/syntax_highlight.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
syntax = "proto3"; | ||
|
||
package build.stack.syntax_highlight.v1beta1; | ||
|
||
option go_package = "github.com/stackb/bezel/proto/syntax_highlight;syntax_highlight"; | ||
|
||
message SyntaxHighlightRequest { | ||
// filename is the name of the file, which may be used by implementations to | ||
// guess a language. | ||
string filename = 1; | ||
// language is the requested language to format. The recognized list of | ||
// languages is is implementation specific. | ||
string language = 2; | ||
// style is the requested style to format. The recognized list of | ||
// styles is is implementation specific. | ||
string style = 3; | ||
// input is the unformatted syntax. | ||
bytes input = 4; | ||
} | ||
|
||
message SyntaxHighlightResponse { | ||
// output is the formatted syntax. | ||
bytes output = 1; | ||
} | ||
|
||
service SyntaxHighlighter { | ||
rpc SyntaxHighlight(SyntaxHighlightRequest) returns (SyntaxHighlightResponse); | ||
} |
Oops, something went wrong.