add dictionary in dhall
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
parent
b028bb3acd
commit
48b5d25956
16
.drone.yml
16
.drone.yml
|
@ -52,3 +52,19 @@ steps:
|
||||||
pull: always
|
pull: always
|
||||||
commands:
|
commands:
|
||||||
- cd tools && cargo test
|
- cd tools && cargo test
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
kind: pipeline
|
||||||
|
name: dictionary verification
|
||||||
|
workspace:
|
||||||
|
base: /lewa
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build dictionary files
|
||||||
|
image: "monacoremo/nix:2020-04-05-05f09348-circleci"
|
||||||
|
pull: always
|
||||||
|
commands:
|
||||||
|
- nix-env -if ./nix/dhall.nix
|
||||||
|
- cd words
|
||||||
|
- dhall ./dictionary.dhall
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
pkgs.stdenv.mkDerivation rec {
|
||||||
|
name = "dhall-json-simple";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.32.0/dhall-json-1.6.4-x86_64-linux.tar.bz2";
|
||||||
|
sha256 = "1qd2nfmwgdmffwjmvcs2cjm1jkqkv7mi8hf3lcvsx3gjcc2mv3jw";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
DHALL_TO_JSON=$out/bin/dhall-to-json
|
||||||
|
DHALL_TO_YAML=$out/bin/dhall-to-yaml
|
||||||
|
JSON_TO_DHALL=$out/bin/json-to-dhall
|
||||||
|
install -D -m555 -T dhall-to-json $DHALL_TO_JSON
|
||||||
|
install -D -m555 -T dhall-to-yaml $DHALL_TO_YAML
|
||||||
|
install -D -m555 -T json-to-dhall $JSON_TO_DHALL
|
||||||
|
mkdir -p $out/etc/bash_completion.d/
|
||||||
|
$DHALL_TO_JSON --bash-completion-script $DHALL_TO_JSON > $out/etc/bash_completion.d/dhall-to-json-completion.bash
|
||||||
|
$DHALL_TO_YAML --bash-completion-script $DHALL_TO_YAML > $out/etc/bash_completion.d/dhall-to-yaml-completion.bash
|
||||||
|
$JSON_TO_DHALL --bash-completion-script $JSON_TO_DHALL > $out/etc/bash_completion.d/json-to-dhall-completion.bash
|
||||||
|
'';
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
pkgs.stdenv.mkDerivation rec {
|
||||||
|
name = "dhall-simple";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.32.0/dhall-1.32.0-x86_64-linux.tar.bz2";
|
||||||
|
sha256 = "0p7j7msik1sgg287yrkp2si2fvw8lrsxy3lhc2xaxxa8d9y9k5aq";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
DHALL=$out/bin/dhall
|
||||||
|
install -D -m555 -T dhall $DHALL
|
||||||
|
mkdir -p $out/etc/bash_completion.d/
|
||||||
|
$DHALL --bash-completion-script $DHALL > $out/etc/bash_completion.d/dhall-completion.bash
|
||||||
|
'';
|
||||||
|
}
|
11
shell.nix
11
shell.nix
|
@ -5,6 +5,8 @@ let
|
||||||
"https://github.com/nix-community/NUR/archive/master.tar.gz") {
|
"https://github.com/nix-community/NUR/archive/master.tar.gz") {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
};
|
};
|
||||||
|
dhall = pkgs.callPackage ./nix/dhall.nix { };
|
||||||
|
dhall-json = pkgs.callPackage ./nix/dhall-json.nix { };
|
||||||
dyson = pkgs.callPackage ./nix/dyson.nix { };
|
dyson = pkgs.callPackage ./nix/dyson.nix { };
|
||||||
tex = pkgs.callPackage ./nix/texlive.nix { };
|
tex = pkgs.callPackage ./nix/texlive.nix { };
|
||||||
in pkgs.mkShell {
|
in pkgs.mkShell {
|
||||||
|
@ -23,6 +25,15 @@ in pkgs.mkShell {
|
||||||
# preview
|
# preview
|
||||||
nur.repos.xe.zathura
|
nur.repos.xe.zathura
|
||||||
|
|
||||||
|
# dhall
|
||||||
|
dhall
|
||||||
|
dhall-json
|
||||||
|
|
||||||
|
# deno
|
||||||
|
nur.repos.xe.deno
|
||||||
|
nodePackages.typescript
|
||||||
|
nodePackages.typescript-language-server
|
||||||
|
|
||||||
# rust
|
# rust
|
||||||
cargo
|
cargo
|
||||||
cargo-watch
|
cargo-watch
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
let ContentWord = ./types/ContentWord.dhall
|
||||||
|
|
||||||
|
let ParticleWord = ./types/ParticleWord.dhall
|
||||||
|
|
||||||
|
in { rootWords =
|
||||||
|
[ ./roots/lewa.dhall
|
||||||
|
, ./roots/madsa.dhall
|
||||||
|
, ./roots/qate.dhall
|
||||||
|
, ./roots/spalo.dhall
|
||||||
|
, ./roots/zasko.dhall
|
||||||
|
]
|
||||||
|
, particles = [] : List ParticleWord.Type
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
let ContentWord = ../types/ContentWord.dhall
|
||||||
|
|
||||||
|
in ContentWord::{
|
||||||
|
, word = "l'ewa"
|
||||||
|
, gloss = "language"
|
||||||
|
, definition = "is a language"
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
let ContentWord = ../types/ContentWord.dhall
|
||||||
|
|
||||||
|
in ContentWord::{
|
||||||
|
, word = "madsa"
|
||||||
|
, gloss = "eat"
|
||||||
|
, definition = "eats/is eating/to eat"
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
let ContentWord = ../types/ContentWord.dhall
|
||||||
|
|
||||||
|
in ContentWord::{
|
||||||
|
, word = "qa'te"
|
||||||
|
, gloss = "fast"
|
||||||
|
, definition = "is fast/rapid in rate"
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
let ContentWord = ../types/ContentWord.dhall
|
||||||
|
|
||||||
|
in ContentWord::{ word = "spalo", gloss = "apple", definition = "is an apple" }
|
|
@ -0,0 +1,7 @@
|
||||||
|
let ContentWord = ../types/ContentWord.dhall
|
||||||
|
|
||||||
|
in ContentWord::{
|
||||||
|
, word = "zasko"
|
||||||
|
, gloss = "plant"
|
||||||
|
, definition = "is a plant/is vegetation"
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{ Type =
|
||||||
|
{ word : Text, gloss : Text, definition : Text, usageExamples : List Text }
|
||||||
|
, default =
|
||||||
|
{ word = "", gloss = "", definition = "", usageExamples = [] : List Text }
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
{ Type =
|
||||||
|
{ word : Text
|
||||||
|
, gloss : Text
|
||||||
|
, definition : Text
|
||||||
|
, family : Text
|
||||||
|
, usageExamples : List Text
|
||||||
|
}
|
||||||
|
, default =
|
||||||
|
{ word = ""
|
||||||
|
, gloss = ""
|
||||||
|
, definition = ""
|
||||||
|
, family = ""
|
||||||
|
, usageExamples = [] : List Text
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
let ContentWord = ../types/ContentWord.dhall
|
||||||
|
|
||||||
|
let render
|
||||||
|
: ContentWord.Type → Text
|
||||||
|
= λ(word : ContentWord.Type) →
|
||||||
|
''
|
||||||
|
### ${word.word}
|
||||||
|
|
||||||
|
*${word.gloss}*
|
||||||
|
|
||||||
|
${word.definition}
|
||||||
|
''
|
||||||
|
|
||||||
|
in render
|
Loading…
Reference in New Issue