Skip to content

Commit

Permalink
Merge pull request #17 from stackb/highlighter
Browse files Browse the repository at this point in the history
Add syntax highlighting service
  • Loading branch information
pcj committed Jul 20, 2023
2 parents c75e47d + b7d60d6 commit c2cda77
Show file tree
Hide file tree
Showing 5 changed files with 411 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ update:
$(BAZEL) run //build/stack/protobuf/compiler/v1alpha1:v1alpha1_go_compiled_sources.update
$(BAZEL) run //build/stack/protobuf/package/v1alpha1:v1alpha1_go_compiled_sources.update
$(BAZEL) run //build/stack/protobuf/package/v1alpha2:v1alpha2_go_compiled_sources.update
$(BAZEL) run //build/stack/syntax_highlight/v1beta1:syntax_highlight_go_compiled_sources.update
26 changes: 26 additions & 0 deletions build/stack/syntax_highlight/v1beta1/BUILD.bazel
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 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.

28 changes: 28 additions & 0 deletions build/stack/syntax_highlight/v1beta1/syntax_highlight.proto
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);
}
Loading

0 comments on commit c2cda77

Please sign in to comment.