feat(codely-languages): 0.1.2
This commit is contained in:
8 files changed
+282
-53
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 254 KiB |
@@ -0,0 +1,71 @@
|
||||
#import "/lib.typ": *
|
||||
#import "@preview/codly:1.0.0": *
|
||||
#show: codly-init
|
||||
#codly(languages: codly-languages)
|
||||
|
||||
```python
|
||||
print("Hello, World!")
|
||||
```
|
||||
|
||||
```java
|
||||
public class HelloWorld {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello, World!");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
console.log("Hello, World!");
|
||||
```
|
||||
|
||||
```cpp
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello, World!" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
println!("Hello, World!");
|
||||
}
|
||||
```
|
||||
|
||||
```cs
|
||||
using System;
|
||||
|
||||
class Program {
|
||||
static void Main() {
|
||||
Console.WriteLine("Hello, World!");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, World!")
|
||||
}
|
||||
```
|
||||
|
||||
```swift
|
||||
print("Hello, World!")
|
||||
```
|
||||
|
||||
```php
|
||||
<?php
|
||||
echo "Hello, World!";
|
||||
?>
|
||||
```
|
||||
|
||||
```kotlin
|
||||
fun main() {
|
||||
println("Hello, World!")
|
||||
}
|
||||
```
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
@@ -0,0 +1,160 @@
|
||||
#import "/lib.typ": *
|
||||
|
||||
#let base-languages = (
|
||||
"aarch64",
|
||||
"angular",
|
||||
"ansible",
|
||||
"apache",
|
||||
"apl",
|
||||
"awk",
|
||||
"bash",
|
||||
"c",
|
||||
"cairo",
|
||||
"clojure",
|
||||
"clojurescript",
|
||||
"cmake",
|
||||
"coffeescript",
|
||||
"cplusplus",
|
||||
"crystal",
|
||||
"csharp",
|
||||
"css",
|
||||
"dart",
|
||||
"docker",
|
||||
"elixir",
|
||||
"elm",
|
||||
"emacs",
|
||||
"erlang",
|
||||
"fortran",
|
||||
"fsharp",
|
||||
"git",
|
||||
"go",
|
||||
"graphql",
|
||||
"groovy",
|
||||
"grpc",
|
||||
"handlebars",
|
||||
"haskell",
|
||||
"haxe",
|
||||
"html",
|
||||
"java",
|
||||
"javascript",
|
||||
"json",
|
||||
"julia",
|
||||
"kotlin",
|
||||
"latex",
|
||||
"less",
|
||||
"lua",
|
||||
"markdown",
|
||||
"matlab",
|
||||
"mysql",
|
||||
"neovim",
|
||||
"nginx",
|
||||
"nim",
|
||||
"nix",
|
||||
"objectivec",
|
||||
"ocaml",
|
||||
"perl",
|
||||
"php",
|
||||
"postgresql",
|
||||
"powershell",
|
||||
"processing",
|
||||
"prolog",
|
||||
"purescript",
|
||||
"python",
|
||||
"r",
|
||||
"rails",
|
||||
"ruby",
|
||||
"rust",
|
||||
"sass",
|
||||
"scala",
|
||||
"solidity",
|
||||
"sql",
|
||||
"sqlite",
|
||||
"ssh-config",
|
||||
"stylus",
|
||||
"svelte",
|
||||
"swift",
|
||||
"terraform",
|
||||
"tex",
|
||||
"text",
|
||||
"typescript",
|
||||
"typst",
|
||||
"uml",
|
||||
"vala",
|
||||
"vim",
|
||||
"visualbasic",
|
||||
"vyper",
|
||||
"wasm",
|
||||
"xml",
|
||||
"yaml",
|
||||
"zig",
|
||||
)
|
||||
|
||||
#for lang in base-languages {
|
||||
if lang not in codly-languages.keys() {
|
||||
panic("warning: language " + lang + " not found in codly-languages")
|
||||
}
|
||||
}
|
||||
|
||||
Found all base languages!
|
||||
|
||||
|
||||
#let aliases = (
|
||||
"arm",
|
||||
"bash",
|
||||
"clj",
|
||||
"cljs",
|
||||
"coffee",
|
||||
"cpp",
|
||||
"cs",
|
||||
"cxx",
|
||||
"dockerfile",
|
||||
"erl",
|
||||
"ex",
|
||||
"fs",
|
||||
"golang",
|
||||
"hs",
|
||||
"html5",
|
||||
"jl",
|
||||
"js",
|
||||
"kt",
|
||||
"ml",
|
||||
"nixos",
|
||||
"nvim",
|
||||
"obj-c",
|
||||
"objc",
|
||||
"pl",
|
||||
"ps1",
|
||||
"py",
|
||||
"rb",
|
||||
"rs",
|
||||
"sc",
|
||||
"scss",
|
||||
"sh",
|
||||
"shell",
|
||||
"sol",
|
||||
"ssh",
|
||||
"styl",
|
||||
"tf",
|
||||
"ts",
|
||||
"txt",
|
||||
"typ",
|
||||
"typc",
|
||||
"typm",
|
||||
"vb",
|
||||
"vimscript",
|
||||
"yml"
|
||||
)
|
||||
|
||||
#for lang in aliases {
|
||||
if lang not in codly-languages.keys() {
|
||||
panic("error: language " + lang + " not found in codly-languages")
|
||||
}
|
||||
}
|
||||
|
||||
Found all language aliases!
|
||||
|
||||
#if codly-languages.keys().len() != base-languages.len() + aliases.len() {
|
||||
panic("error: language count is incorrect")
|
||||
}
|
||||
|
||||
Language key count matches: #codly-languages.keys().len() keys.
|
||||
Reference in new issue
Block a user