diff options
Diffstat (limited to 'gleam')
| -rw-r--r-- | gleam/README.md | 30 | ||||
| -rw-r--r-- | gleam/flake.nix | 11 | ||||
| -rw-r--r-- | gleam/src/ocda/dump.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/ocda/images.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/ocda/inventory.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/ocda/load.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/ocda/load_db.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/ocda/load_pod.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/ocda/load_ssp.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/ocda/model.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/ocda/zip.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/ocda_ffi.erl | 49 | ||||
| -rw-r--r-- | gleam/src/ocda_lib.gleam | 49 | ||||
| -rw-r--r-- | gleam/src/read/main.gleam | 49 | ||||
| -rw-r--r-- | gleam/test/ocda_lib_test.gleam | 53 |
15 files changed, 657 insertions, 25 deletions
diff --git a/gleam/README.md b/gleam/README.md index ed4a30b..3e6dc53 100644 --- a/gleam/README.md +++ b/gleam/README.md @@ -3,16 +3,16 @@ The abstraction's model and both its loaders, as a Gleam library, with its reader and the two programs that put it to the question. -| | | -|---|---| -| `ocda/model` | the document, the object, the image. Depends on nothing but the standard library | -| `ocda/load_ssp` | text -> model | -| `ocda/load_db` | sqlite -> model | -| `ocda/load` | what a path is, and loading it | +| | | +|------------------|-----------------------------------------------------------------------------------------| +| `ocda/model` | the document, the object, the image. Depends on nothing but the standard library | +| `ocda/load_ssp` | text -> model | +| `ocda/load_db` | sqlite -> model | +| `ocda/load` | what a path is, and loading it | | `ocda/inventory` | what a file holds beyond the one document: its languages, and what a `.ocda.db` carries | -| `ocda/dump` | the model written out canonically, as an oracle | -| `read/main` | `ocda-read`, the reader | -| `ocda_ffi.erl` | a sha256, from OTP's crypto, which the standard library lacks | +| `ocda/dump` | the model written out canonically, as an oracle | +| `read/main` | `ocda-read`, the reader | +| `ocda_ffi.erl` | a sha256, from OTP's crypto, which the standard library lacks | ## Use @@ -60,12 +60,12 @@ the whole model out canonically, and is the stronger check of the two, because it is **byte for byte what the D library's `ocda-dump` writes**. So the four questions can all be asked with `diff`: -| | | -|---|---| -| D: `.ssp` == `.ocda.db` | 36 of 36 document-languages | -| Gleam: `.ssp` == `.ocda.db` | 36 of 36 | -| `.ssp`: D == Gleam | 36 of 36 | -| `.ocda.db`: D == Gleam | 36 of 36 | +| | | +|-----------------------------|-----------------------------| +| D: `.ssp` == `.ocda.db` | 36 of 36 document-languages | +| Gleam: `.ssp` == `.ocda.db` | 36 of 36 | +| `.ssp`: D == Gleam | 36 of 36 | +| `.ocda.db`: D == Gleam | 36 of 36 | ## Deliberately a mirror of the D library diff --git a/gleam/flake.nix b/gleam/flake.nix index eb77f86..5ffb74c 100644 --- a/gleam/flake.nix +++ b/gleam/flake.nix @@ -1,8 +1,6 @@ { description = "ocda-lib: the object-centric document abstraction as a Gleam library"; - - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - + inputs.nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst"; outputs = { self, nixpkgs }: let system = "x86_64-linux"; # adjust for aarch64-linux / darwin @@ -11,7 +9,6 @@ name = "ocda_lib"; /* rebar3 with the port compiler already in it. - esqlite builds a NIF, and its rebar3 configuration asks for the `pc` plugin, which rebar3 would otherwise fetch from Hex at build time: impossible in a sandbox, and the build fails with @@ -23,11 +20,11 @@ }; /* The Hex dependencies, as manifest.toml pins them. - + . There is no Gleam builder in nixpkgs and `gleam build` fetches from Hex, so a sandboxed build cannot reach them. A fixed output derivation may, because its result is pinned by hash. - + . When a dependency changes, manifest.toml changes and this hash must change with it: build, take the hash nix reports, put it here. */ @@ -52,7 +49,6 @@ in { packages.${system} = { default = self.packages.${system}.${name}; - /* Shipped as an Erlang shipment rather than as an escript, because sqlite on the BEAM is a NIF: esqlite compiles its own sqlite into a shared object, and a NIF cannot be loaded from inside an @@ -98,7 +94,6 @@ }; }; }; - devShells.${system}.default = pkgs.mkShell { packages = [ pkgs.gleam pkgs.erlang pkgs.rebar3 pkgs.sqlite ]; }; diff --git a/gleam/src/ocda/dump.gleam b/gleam/src/ocda/dump.gleam index e5563ca..19bd93d 100644 --- a/gleam/src/ocda/dump.gleam +++ b/gleam/src/ocda/dump.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// The model, written out canonically. //// //// Not an output format: an *oracle*. Two libraries in two languages diff --git a/gleam/src/ocda/images.gleam b/gleam/src/ocda/images.gleam index 2f3a56e..0639ff7 100644 --- a/gleam/src/ocda/images.gleam +++ b/gleam/src/ocda/images.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// An image's bytes, from whichever source the document came from. //// //// The model *names* images, with digest, byte size and pixel size; it does diff --git a/gleam/src/ocda/inventory.gleam b/gleam/src/ocda/inventory.gleam index 6047313..6bf1e99 100644 --- a/gleam/src/ocda/inventory.gleam +++ b/gleam/src/ocda/inventory.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// What a source holds, beyond the one document the model is loaded from. //// //// The model is one language of one document. Two questions a reader asks diff --git a/gleam/src/ocda/load.gleam b/gleam/src/ocda/load.gleam index 2a82ac9..579a4dd 100644 --- a/gleam/src/ocda/load.gleam +++ b/gleam/src/ocda/load.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// What a path is, and loading it. //// //// One place that decides, so that every reader and every writer accepts diff --git a/gleam/src/ocda/load_db.gleam b/gleam/src/ocda/load_db.gleam index 18a5335..5373be8 100644 --- a/gleam/src/ocda/load_db.gleam +++ b/gleam/src/ocda/load_db.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// Loading a `.ocda.db` into the model. //// //// The point of this module is that it returns *the same value* diff --git a/gleam/src/ocda/load_pod.gleam b/gleam/src/ocda/load_pod.gleam index 05f7add..4f8ee67 100644 --- a/gleam/src/ocda/load_pod.gleam +++ b/gleam/src/ocda/load_pod.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// The abstraction out of a pod archive. //// //// A pod built with `--pod2` carries the abstraction inside it, at diff --git a/gleam/src/ocda/load_ssp.gleam b/gleam/src/ocda/load_ssp.gleam index ec93ef5..1a546d4 100644 --- a/gleam/src/ocda/load_ssp.gleam +++ b/gleam/src/ocda/load_ssp.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// Loading a `.ssp` into the model. //// //// The format is line oriented and every line is one of eight shapes told diff --git a/gleam/src/ocda/model.gleam b/gleam/src/ocda/model.gleam index 48cc76e..7161308 100644 --- a/gleam/src/ocda/model.gleam +++ b/gleam/src/ocda/model.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// The object-centric document abstraction, as Gleam types. //// //// A deliberate mirror of the D library's `ocda.model`, field for field. diff --git a/gleam/src/ocda/zip.gleam b/gleam/src/ocda/zip.gleam index 5ce6e09..6917796 100644 --- a/gleam/src/ocda/zip.gleam +++ b/gleam/src/ocda/zip.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// Enough of the zip format to find one file in a pod and read it. //// //// Not a zip library. A pod archive holds a handful of entries, spine writes diff --git a/gleam/src/ocda_ffi.erl b/gleam/src/ocda_ffi.erl index 2e395cd..608b5b9 100644 --- a/gleam/src/ocda_ffi.erl +++ b/gleam/src/ocda_ffi.erl @@ -1,3 +1,52 @@ +%%/+ +%%- Name: SisuDoc Spine, Doc Reform [a part of] +%% - Description: documents, structuring, processing, publishing, search +%% - static content generator +%% +%% - Author: Ralph Amissah +%% [ralph.amissah@gmail.com] +%% +%% - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +%% +%% - License: AGPL 3 or later: +%% +%% Spine (SiSU), a framework for document structuring, publishing and +%% search +%% +%% Copyright (C) Ralph Amissah +%% +%% This program is free software: you can redistribute it and/or modify it +%% under the terms of the GNU AFERO General Public License as published by the +%% Free Software Foundation, either version 3 of the License, or (at your +%% option) any later version. +%% +%% This program is distributed in the hope that it will be useful, but WITHOUT +%% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +%% more details. +%% +%% You should have received a copy of the GNU General Public License along with +%% this program. If not, see [https://www.gnu.org/licenses/]. +%% +%% If you have Internet connection, the latest version of the AGPL should be +%% available at these locations: +%% [https://www.fsf.org/licensing/licenses/agpl.html] +%% [https://www.gnu.org/licenses/agpl.html] +%% +%% - Spine (by Doc Reform, related to SiSU) uses standard: +%% - docReform markup syntax +%% - standard SiSU markup syntax with modified headers and minor modifications +%% - docReform object numbering +%% - standard SiSU object citation numbering & system +%% +%% - Homepages: +%% [https://www.sisudoc.org] +%% [https://www.doc-reform.org] +%% +%% - Git +%% [https://git.sisudoc.org/] +%% +%%+/ %% The one thing ocda-lib asks of Erlang directly: a sha256, which OTP's %% crypto has and the Gleam standard library does not. Upper case hex, as %% the database stores it and the D library writes it. diff --git a/gleam/src/ocda_lib.gleam b/gleam/src/ocda_lib.gleam index 6eccaff..62d8d87 100644 --- a/gleam/src/ocda_lib.gleam +++ b/gleam/src/ocda_lib.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// ocda-lib, in Gleam: the abstraction as a library, put to the question. //// //// A library has no binary, so this is the programs over it: the reader, diff --git a/gleam/src/read/main.gleam b/gleam/src/read/main.gleam index 307b8d8..f474a26 100644 --- a/gleam/src/read/main.gleam +++ b/gleam/src/read/main.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ //// ocda-read, in Gleam: reads the abstraction, in any of the forms the //// library reads, and says what is in it. //// diff --git a/gleam/test/ocda_lib_test.gleam b/gleam/test/ocda_lib_test.gleam index 02fe463..ecd1a6a 100644 --- a/gleam/test/ocda_lib_test.gleam +++ b/gleam/test/ocda_lib_test.gleam @@ -1,3 +1,52 @@ +/////+ +////- Name: SisuDoc Spine, Doc Reform [a part of] +//// - Description: documents, structuring, processing, publishing, search +//// - static content generator +//// +//// - Author: Ralph Amissah +//// [ralph.amissah@gmail.com] +//// +//// - Copyright: (C) 2015 (continuously updated, current 2026) Ralph Amissah, All Rights Reserved. +//// +//// - License: AGPL 3 or later: +//// +//// Spine (SiSU), a framework for document structuring, publishing and +//// search +//// +//// Copyright (C) Ralph Amissah +//// +//// This program is free software: you can redistribute it and/or modify it +//// under the terms of the GNU AFERO General Public License as published by the +//// Free Software Foundation, either version 3 of the License, or (at your +//// option) any later version. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +//// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +//// more details. +//// +//// You should have received a copy of the GNU General Public License along with +//// this program. If not, see [https://www.gnu.org/licenses/]. +//// +//// If you have Internet connection, the latest version of the AGPL should be +//// available at these locations: +//// [https://www.fsf.org/licensing/licenses/agpl.html] +//// [https://www.gnu.org/licenses/agpl.html] +//// +//// - Spine (by Doc Reform, related to SiSU) uses standard: +//// - docReform markup syntax +//// - standard SiSU markup syntax with modified headers and minor modifications +//// - docReform object numbering +//// - standard SiSU object citation numbering & system +//// +//// - Homepages: +//// [https://www.sisudoc.org] +//// [https://www.doc-reform.org] +//// +//// - Git +//// [https://git.sisudoc.org/] +//// +////+/ import gleam/dict import gleam/list import simplifile @@ -36,7 +85,7 @@ const minimal = "% SiSU Document Abstraction v2.0 .part: body .parent: 1 | First line -| +| | Third line, after a blank one } @@ -139,7 +188,7 @@ pub fn pod_source_test() { /// only zstd on the BEAM is a NIF that fetches zstd in its own build. pub fn zstd_refusal_test() { let path = "test/fixture-zstd-frame.sisupod" - let assert Ok(_) = simplifile.write_bits(path, <<0x28, 0xB5, 0x2F, 0xFD, 0>>) + let assert Ok(_) = simplifile.write_bits(path, ) let assert Error(message) = load.load(path, "", False) message |> string.contains(contain: "zstd") |> should.be_true message |> string.contains(contain: "zstd -d") |> should.be_true |
