scossu 3 týždňov pred
rodič
commit
8e60dd62b3
2 zmenil súbory, kde vykonal 80 pridanie a 9 odobranie
  1. 26 9
      README.md
  2. 54 0
      pkar.lua

+ 26 - 9
README.md

@@ -144,20 +144,18 @@ foundational library, Volksdata, has been developed as a spare-time project for
 
 ### Road map
 
-Simple road map for a rough prototype:
+#### Prototype
 
--  Configuration + config parser
+-  Configuration + config parser
   - ✓ Application
-  -  Content model
+  -  Content model
     - ✓ Validation rules
-    - ⚒ Relationship inference rules
-  - ⎊ Local overrides
 - ⚒ Submission module
   - ✓ SIP building
   - ✓ Metadata from LL
   - ✓ Structure inference
-  - ⎊ Relatioships inference
--  HTML generator
+  - ⚒ Collections
+-  HTML generator
   - ✓ Index
   - ✓ Resource
   - ✓ Static assets
@@ -165,10 +163,29 @@ Simple road map for a rough prototype:
   - ✓ RDF (turtle)
   - ⎊ LL
   - ✓ Transformers
-  - ⚒ JS search engine index
-- ⎊ Front end
+  - ✓ JS search engine index
+- ⚒ CLI
+  - ✓ Init archive
+  - ✓ Deposit
+  - ✓ Generate site
+  - ⎊ Generate LL (multi)
+  - ⎊ Generate RDF (multi)
+- ⚒ Front end
   - ⚒ JS search engine
   - ⎊ Styling
       - ⎊ Default type icons
 - ⎊ QA
   - ⎊ >100 resource data set
+
+#### MVP
+
+- Multilingual support
+- Management UI & API
+  - Deposit
+    - S3 source pointer
+    - Single tar or zip file submission
+  - Dump & restore (whole archive & individual resources)
+- Content model
+  - Local overrides
+  - Relatioships inference
+- htmlgen option for local file or webserver URL generation

+ 54 - 0
pkar.lua

@@ -0,0 +1,54 @@
+#!/usr/bin/lua
+
+local cli = require "cli"
+local plpath = require "pl.path"
+
+local pkar = require "pocket_archive"
+local sub = require "pocket_archive.submission"
+local hgen = require "pocket_archive.html_generator"
+
+
+cli.locale "en_US"
+
+init = cli.command {
+    "Initialize a new Pocket Archive store.",
+
+    cli.flag "wipe" {
+        "Wipe all preexisting data.",
+        type = cli.boolean,
+    },
+
+    function(args)
+        if args.wipe then _ = pkar.reset_store
+        else _ = pkar.store end
+
+        _ = nil
+        collectgarbage()
+    end
+}
+
+submit = cli.command {
+    "Submit a package.",
+
+    cli.positional "path" {
+        [[Path of the package root. It must be a directory containing
+        all the files and folders to be submitted and a `pkar_submission.csv`
+        file at the top of the folder.]]
+    },
+
+    function(args)
+        sip = sub.generate_sip(plpath.join(args.path, "pkar_submission.csv"))
+        sub.deposit(sip)
+    end
+}
+
+generate = cli.command {
+    "Generate a static site from the archive.",
+
+    function(args) hgen.generate_site() end
+}
+
+
+cli.program {
+    "Pocket Archive command line interface.",
+}