Skip to content

Commit

Permalink
Merge pull request #31 from zakhenry/feat/support-cmake-proto
Browse files Browse the repository at this point in the history
feat(Language Support): Support CMake, support protobuf
  • Loading branch information
zakhenry authored Jul 13, 2019
2 parents 47431ab + fe77526 commit 607e809
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Here's a list of file types supported by this utility, if you have a need for an
contribute, it is easy!

```ts
// src/embedme.lib.ts#L44-L73
// src/embedme.lib.ts#L44-L75

enum SupportedFileType {
PLAIN_TEXT = 'txt',
Expand Down Expand Up @@ -110,6 +110,8 @@ enum SupportedFileType {
CRYSTAL = 'cr',
PLANT_UML = 'puml',
MERMAID = 'mermaid',
CMAKE = 'cmake',
PROTOBUF = 'proto',
}
```

Expand Down
4 changes: 4 additions & 0 deletions src/embedme.lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ enum SupportedFileType {
CRYSTAL = 'cr',
PLANT_UML = 'puml',
MERMAID = 'mermaid',
CMAKE = 'cmake',
PROTOBUF = 'proto',
}

enum CommentFamily {
Expand Down Expand Up @@ -100,6 +102,7 @@ const languageMap: Record<CommentFamily, SupportedFileType[]> = {
SupportedFileType.KOTLIN,
SupportedFileType.SCALA,
SupportedFileType.JSON_5,
SupportedFileType.PROTOBUF,
],
[CommentFamily.XML]: [SupportedFileType.HTML, SupportedFileType.MARKDOWN, SupportedFileType.XML],
[CommentFamily.HASH]: [
Expand All @@ -109,6 +112,7 @@ const languageMap: Record<CommentFamily, SupportedFileType[]> = {
SupportedFileType.YAML,
SupportedFileType.RUBY,
SupportedFileType.CRYSTAL,
SupportedFileType.CMAKE,
],
[CommentFamily.SINGLE_QUOTE]: [SupportedFileType.PLANT_UML],
[CommentFamily.DOUBLE_PERCENT]: [SupportedFileType.MERMAID],
Expand Down
28 changes: 28 additions & 0 deletions test/fixture.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,34 @@ sequenceDiagram
```

Protobuf

```proto
// sample.proto
syntax = "proto3";
enum Places {
WORLD = 0;
}
message Hello {
Places place = 1;
}
```

CMake

```cmake
# sample.cmake
cmake_minimum_required(VERSION 2.8.9)
project (hello)
add_executable(hello sample.cpp)
```

## Extension-less selection

```sh
Expand Down
3 changes: 3 additions & 0 deletions test/sample.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 2.8.9)
project (hello)
add_executable(hello sample.cpp)
9 changes: 9 additions & 0 deletions test/sample.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";

enum Places {
WORLD = 0;
}

message Hello {
Places place = 1;
}

0 comments on commit 607e809

Please sign in to comment.