From 283911150a91efd8454e3eea516f333e11c6f36e Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 6 May 2020 07:22:27 -0400 Subject: [PATCH] first commit --- .drone.yml | 38 +++++++++ .envrc | 1 + book/.gitignore | 1 + book/book.toml | 6 ++ book/src/.gitignore | 4 + book/src/SUMMARY.md | 6 ++ book/src/build.sh | 18 +++++ book/src/intro/CHANGELOG.md | 13 +++ book/src/intro/diary_language.md | 17 ++++ book/src/intro/ebook.md | 7 ++ book/src/intro/index.md | 62 ++++++++++++++ book/src/sectionpagebreak.tex | 7 ++ book/src/title.md | 12 +++ nix/dyson.nix | 20 +++++ nix/sources.json | 26 ++++++ nix/sources.nix | 134 +++++++++++++++++++++++++++++++ shell.nix | 21 +++++ 17 files changed, 393 insertions(+) create mode 100644 .drone.yml create mode 100644 .envrc create mode 100644 book/.gitignore create mode 100644 book/book.toml create mode 100644 book/src/.gitignore create mode 100644 book/src/SUMMARY.md create mode 100755 book/src/build.sh create mode 100644 book/src/intro/CHANGELOG.md create mode 100644 book/src/intro/diary_language.md create mode 100644 book/src/intro/ebook.md create mode 100644 book/src/intro/index.md create mode 100644 book/src/sectionpagebreak.tex create mode 100644 book/src/title.md create mode 100644 nix/dyson.nix create mode 100644 nix/sources.json create mode 100644 nix/sources.nix create mode 100644 shell.nix diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..01313d8 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,38 @@ +kind: pipeline +name: default +workspace: + base: /lewa + +steps: + - name: build ebook files + image: xena/pandoc + pull: always + commands: + - cd book/src && ./build.sh + volumes: + - name: book + path: /lewa/book + - name: build mdbook + image: xena/mdbook + pull: always + commands: + - cd book && mdbook build + volumes: + - name: book + path: /lewa/book + - name: build image + image: docker:dind + volumes: + - name: book + path: /lewa/book + - name: dockersock + path: /var/run/docker.sock + commands: + - sh -c 'docker build -t xena/lewa:$DRONE_COMMIT .' + +volumes: + - name: book + temp: {} + - name: dockersock + host: + path: /var/run/docker.sock diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..be81fed --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +eval "$(lorri direnv)" \ No newline at end of file diff --git a/book/.gitignore b/book/.gitignore new file mode 100644 index 0000000..7585238 --- /dev/null +++ b/book/.gitignore @@ -0,0 +1 @@ +book diff --git a/book/book.toml b/book/book.toml new file mode 100644 index 0000000..953d9ab --- /dev/null +++ b/book/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["Christine Dodrill"] +language = "en" +multilingual = false +src = "src" +title = "L'ewa: A Personal Language" diff --git a/book/src/.gitignore b/book/src/.gitignore new file mode 100644 index 0000000..46f7978 --- /dev/null +++ b/book/src/.gitignore @@ -0,0 +1,4 @@ +*.epub +*.mobi +*.pdf +test.tex diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md new file mode 100644 index 0000000..9f8d612 --- /dev/null +++ b/book/src/SUMMARY.md @@ -0,0 +1,6 @@ +# Summary + +- [Introduction](./intro/index.md) + - [L'ewa as a Diary Language](./intro/diary_language.md) + - [eBook Version](./intro/ebook.md) + - [Changelog](./intro/CHANGELOG.md) diff --git a/book/src/build.sh b/book/src/build.sh new file mode 100755 index 0000000..8ca874b --- /dev/null +++ b/book/src/build.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +FILES=' +intro/index.md +intro/diary_language.md +intro/CHANGELOG.md +' + +set -x +pandoc -o lewa.epub --epub-chapter-level=2 --resource-path=. title.md $FILES +pandoc -o test.tex -s --include-in-header sectionpagebreak.tex --variable=subparagraph --toc --toc-depth=2 --resource-path=. title.md $FILES +pandoc -o lewa.pdf --include-in-header sectionpagebreak.tex --variable=subparagraph --toc --toc-depth=2 --pdf-engine xelatex --resource-path=. title.md $FILES || exit +kindlegen lewa.epub +mkdir -p ../book +cp -vrf lewa.mobi ../book/ +cp -vrf lewa.epub ../book/ +cp -vrf lewa.pdf ../book/ + diff --git a/book/src/intro/CHANGELOG.md b/book/src/intro/CHANGELOG.md new file mode 100644 index 0000000..f217b9c --- /dev/null +++ b/book/src/intro/CHANGELOG.md @@ -0,0 +1,13 @@ +## Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +### [Unreleased] + +#### Added + +- Initial setup and formatting +- First Section on introduction stuff diff --git a/book/src/intro/diary_language.md b/book/src/intro/diary_language.md new file mode 100644 index 0000000..b6b7749 --- /dev/null +++ b/book/src/intro/diary_language.md @@ -0,0 +1,17 @@ +## L'wea as A Diary Language + +When I was younger, I used to keep a diary/journal file on my computers off and +on. I was detailed about what I was feeling and what I was considering and going +through. This all ended abruptly after my parents were snooping through my +computer in middle school and discovered that I was questioning fundamental +aspects of myself like my gender. I have never really felt comfortable keeping a +diary file since then. I have made a few attempts at this (including by using a +dedicated diary machine, air-gapped TempleOS machines and the like), but they +all feel too vulnerable and open for anyone to read them. + +This is my logic for using a language that I create for myself. If people really +want to go through and take the time to learn the ins and outs of a tool I +created for myself to archive my personal thoughts, they probably deserve to be +able to read them. Otherwise, this would allow me to write my diary from pretty +much anywhere, even in plain sight out in public. People can't shoulder-surf and +read what they literally cannot understand. diff --git a/book/src/intro/ebook.md b/book/src/intro/ebook.md new file mode 100644 index 0000000..2c50e8e --- /dev/null +++ b/book/src/intro/ebook.md @@ -0,0 +1,7 @@ +## eBook Edition + +The following is the eBook edition of L'ewa: A Personal Language. + +- [ePub (iBooks)](./lewa.epub) +- [Kindle](./lewa.mobi) +- [PDF](./lewa.pdf) diff --git a/book/src/intro/index.md b/book/src/intro/index.md new file mode 100644 index 0000000..5b5d037 --- /dev/null +++ b/book/src/intro/index.md @@ -0,0 +1,62 @@ +# Introduction + +I've been curious about how language works for a very long time. This curiosity +has lead me down many fascinating rabbit holes, but for a long time I have +either been cribbing off of other people's work or studying natural languages +that don't have a cohesive plan or core to them. [Constructed +Languages][conlangs] (or conlangs as I will probably be calling them from here +on out) are a simpler model of this. You might be familiar with +[Klingon][tlhnganhol] from the Star Trek series, the [various forms of +Elvish][elvish] as described by J. R. R. Tolkien or [Dothraki][dothraki] from +Game of Thrones. This series will show an example of how one of those kinds of +languages are created. + +[conlangs]: https://en.wikipedia.org/wiki/Constructed_language +[tlhnganhol]: https://en.wikipedia.org/wiki/Klingon_language +[elvish]: https://en.wikipedia.org/wiki/Elvish_languages +[dothraki]: https://en.wikipedia.org/wiki/Dothraki_language + +Recently a challenge came up on [/r/conlangs][rconlangs] called +[ReConLangMo][reconlangmo] and I've decided to take a stab at this and flesh +this out into a [personal language][perslang]. + +[rconlangs]: https://www.reddit.com/r/conlangs/ +[reconlangmo]: https://www.reddit.com/r/conlangs/comments/gbgvu0/reconlangmo_2020/ +[perslang]: https://en.wikipedia.org/wiki/Artistic_language#Personal_languages + +## L'ewa Overview + +The language I am going to create will be called L'ewa (⁄l.ʔɛ.wa⁄, also +romanized `lewa` for filesystems). This word is identical in English and in L'ewa. +It means "is a language". The name came to me in a shower a while ago and I'm +not entirely sure where it came from. + +This language is being designed as a personal language to help me keep a diary +(more on that later) and to act as a testbed for writing a computational +knowledge engine, much like IBM's Watson. I do not expect anyone else to use +this language. I may pull this language into fiction (if that ever gets off the +ground) or into other projects as it makes sense. + +Some of the high level things I want to try in this language are ways to make me +think differently. I'm following the weak form of the [Sapir-Whorf +hypothesis][sapirwhorf] by this logic. I want to see what would happen if I give +myself a tool that I can use to help myself think in different ways. Other +features I plan to include are: + +[sapirwhorf]: https://en.wikipedia.org/wiki/Linguistic_relativity + +- A [seximal][seximal] number system +- A predicate-argument system similar to [Lojban][lojban] +- Nounlessness (only having verbs for content words) like [Salishan][salishan] + languages +- An [a-priori][apriori] (or made up) vocabulary +- Grammatical markers for the identity of the thinker of a sentence/phrase/word +- Make each grammatical feature and word logical, or working in one way only +- Typeable with standard QWERTY en-US keyboards +- A decorative script that I'll turn into a font + +[seximal]: https://www.seximal.net +[lojban]: https://lojban.pw/cll/uncll-1.2.6/xhtml_section_chunks/chapter-tour.html#section-bridi +[salishan]: https://en.wikipedia.org/wiki/Salishan_languages +[apriori]: https://en.wikipedia.org/wiki/Constructed_language#A_priori_and_a_posteriori_languages + diff --git a/book/src/sectionpagebreak.tex b/book/src/sectionpagebreak.tex new file mode 100644 index 0000000..650155a --- /dev/null +++ b/book/src/sectionpagebreak.tex @@ -0,0 +1,7 @@ +\usepackage{titlesec} + +\titleclass{\section}{top} +\newcommand\sectionbreak{\pagebreak} + +\usepackage[letterpaper]{geometry} +\geometry{top=1.0in, bottom=1.0in, left=1.0in, right=1.0in} diff --git a/book/src/title.md b/book/src/title.md new file mode 100644 index 0000000..7c4106c --- /dev/null +++ b/book/src/title.md @@ -0,0 +1,12 @@ +--- +title: "L'ewa: A Personal Language" +author: Christine Dodrill +rights: All Rights Reserved +language: en-US + +links-as-notes: true +toc-depth: 2 +fontfamily: noto-serif +abstract: | + A personal language for use in linguistics research and for a diary. +--- diff --git a/nix/dyson.nix b/nix/dyson.nix new file mode 100644 index 0000000..8ca3fa1 --- /dev/null +++ b/nix/dyson.nix @@ -0,0 +1,20 @@ +{ fetchurl, stdenv }: + +stdenv.mkDerivation rec { + name = "dyson"; + version = "0.1.1"; + + src = fetchurl { + url = + "https://xena.greedo.xeserv.us/files/${name}-linux-amd64-0.1.0.tgz"; + sha256 = "08c6md2cfi5g91h23ydg5z14lkq252cdqd41x269mwk19q89nmna"; + }; + + phases = "installPhase"; + + installPhase = '' + tar xf $src + mkdir -p $out/bin + cp ${name}-linux-amd64-${version}/${name} $out/bin + ''; +} diff --git a/nix/sources.json b/nix/sources.json new file mode 100644 index 0000000..5e0a418 --- /dev/null +++ b/nix/sources.json @@ -0,0 +1,26 @@ +{ + "niv": { + "branch": "master", + "description": "Easy dependency management for Nix projects", + "homepage": "https://github.com/nmattia/niv", + "owner": "nmattia", + "repo": "niv", + "rev": "f73bf8d584148677b01859677a63191c31911eae", + "sha256": "0jlmrx633jvqrqlyhlzpvdrnim128gc81q5psz2lpp2af8p8q9qs", + "type": "tarball", + "url": "https://github.com/nmattia/niv/archive/f73bf8d584148677b01859677a63191c31911eae.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs": { + "branch": "nixos-19.09", + "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", + "homepage": "https://github.com/NixOS/nixpkgs", + "owner": "NixOS", + "repo": "nixpkgs-channels", + "rev": "a7ceb2536ab11973c59750c4c48994e3064a75fa", + "sha256": "0hka65f31njqpq7i07l22z5rs7lkdfcl4pbqlmlsvnysb74ynyg1", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs-channels/archive/a7ceb2536ab11973c59750c4c48994e3064a75fa.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} diff --git a/nix/sources.nix b/nix/sources.nix new file mode 100644 index 0000000..8a725cb --- /dev/null +++ b/nix/sources.nix @@ -0,0 +1,134 @@ +# This file has been generated by Niv. + +let + + # + # The fetchers. fetch_ fetches specs of type . + # + + fetch_file = pkgs: spec: + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; } + else + pkgs.fetchurl { inherit (spec) url sha256; }; + + fetch_tarball = pkgs: spec: + if spec.builtin or true then + builtins_fetchTarball { inherit (spec) url sha256; } + else + pkgs.fetchzip { inherit (spec) url sha256; }; + + fetch_git = spec: + builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; }; + + fetch_builtin-tarball = spec: + builtins.trace + '' + WARNING: + The niv type "builtin-tarball" will soon be deprecated. You should + instead use `builtin = true`. + + $ niv modify -a type=tarball -a builtin=true + '' + builtins_fetchTarball { inherit (spec) url sha256; }; + + fetch_builtin-url = spec: + builtins.trace + '' + WARNING: + The niv type "builtin-url" will soon be deprecated. You should + instead use `builtin = true`. + + $ niv modify -a type=file -a builtin=true + '' + (builtins_fetchurl { inherit (spec) url sha256; }); + + # + # Various helpers + # + + # The set of packages used when specs are fetched using non-builtins. + mkPkgs = sources: + let + sourcesNixpkgs = + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {}; + hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; + hasThisAsNixpkgsPath = == ./.; + in + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import {} + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; + + # The actual fetching function. + fetch = pkgs: name: spec: + + if ! builtins.hasAttr "type" spec then + abort "ERROR: niv spec ${name} does not have a 'type' attribute" + else if spec.type == "file" then fetch_file pkgs spec + else if spec.type == "tarball" then fetch_tarball pkgs spec + else if spec.type == "git" then fetch_git spec + else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec + else if spec.type == "builtin-url" then fetch_builtin-url spec + else + abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + + # Ports of functions for older nix versions + + # a Nix version of mapAttrs if the built-in doesn't exist + mapAttrs = builtins.mapAttrs or ( + f: set: with builtins; + listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) + ); + + # fetchTarball version that is compatible between all the versions of Nix + builtins_fetchTarball = { url, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchTarball; + in + if lessThan nixVersion "1.12" then + fetchTarball { inherit url; } + else + fetchTarball attrs; + + # fetchurl version that is compatible between all the versions of Nix + builtins_fetchurl = { url, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchurl; + in + if lessThan nixVersion "1.12" then + fetchurl { inherit url; } + else + fetchurl attrs; + + # Create the final "sources" from the config + mkSources = config: + mapAttrs ( + name: spec: + if builtins.hasAttr "outPath" spec + then abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = fetch config.pkgs name spec; } + ) config.sources; + + # The "config" used by the fetchers + mkConfig = + { sourcesFile ? ./sources.json + , sources ? builtins.fromJSON (builtins.readFile sourcesFile) + , pkgs ? mkPkgs sources + }: rec { + # The sources, i.e. the attribute set of spec name to spec + inherit sources; + + # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers + inherit pkgs; + }; +in +mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..aa4383b --- /dev/null +++ b/shell.nix @@ -0,0 +1,21 @@ +let + pkgs = import { }; + nur = import (builtins.fetchTarball + "https://github.com/nix-community/NUR/archive/master.tar.gz") { + inherit pkgs; + }; + dyson = pkgs.callPackage ./nix/dyson.nix { }; + tex = with pkgs; + texlive.combine { inherit (texlive) scheme-medium noto titlesec; }; +in pkgs.mkShell { + buildInputs = with pkgs; [ + dyson + kindlegen + kubectl + kubectx + mdbook + nur.repos.mic92.pandoc-bin + tex + nur.repos.xe.zathura + ]; +}