aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--compiler/.gitignore3
-rw-r--r--compiler/Setup.hs2
-rw-r--r--compiler/app/Main.hs91
-rw-r--r--compiler/data/.gitignore1
-rw-r--r--compiler/data/readme.md1
-rw-r--r--compiler/package.yaml76
-rw-r--r--compiler/readme.md20
-rw-r--r--compiler/src/Compiler.hs131
-rw-r--r--compiler/src/Config.hs60
-rw-r--r--compiler/src/Files.hs183
-rw-r--r--compiler/src/Input.hs126
-rw-r--r--compiler/src/Processors.hs201
-rw-r--r--compiler/src/Resource.hs198
-rw-r--r--compiler/stack.yaml66
-rw-r--r--compiler/stack.yaml.lock12
-rw-r--r--compiler/test/Spec.hs2
-rw-r--r--compiler/win_build.cmd4
-rw-r--r--compiler/win_compile_example.cmd10
-rw-r--r--design-notes.md232
-rw-r--r--example/.gitignore3
-rw-r--r--example/Glacier 3000/_DSC5475.jpgbin0 -> 363216 bytes
-rw-r--r--example/Glacier 3000/_DSC5475.jpg.yaml15
-rw-r--r--example/Glacier 3000/_DSC5542.jpgbin0 -> 457873 bytes
-rw-r--r--example/Glacier 3000/_DSC5542.jpg.yaml15
-rw-r--r--example/Glacier 3000/thumbnail.jpgbin0 -> 457873 bytes
-rw-r--r--example/_DSC8808-1.jpgbin0 -> 1010643 bytes
-rw-r--r--example/_DSC8808-1.jpg.yaml12
-rw-r--r--example/gallery.yaml21
-rw-r--r--example/readme.md22
-rw-r--r--ldgallery.1.md147
-rw-r--r--readme.md19
-rw-r--r--viewer/.browserslistrc2
-rw-r--r--viewer/.env4
-rw-r--r--viewer/.eslintrc.js34
-rw-r--r--viewer/.gitignore24
-rw-r--r--viewer/.prettierrc.js9
-rw-r--r--viewer/babel.config.js7
-rw-r--r--viewer/package-lock.json12458
-rw-r--r--viewer/package.json48
-rw-r--r--viewer/public/favicon.icobin0 -> 4286 bytes
-rw-r--r--viewer/public/index.html40
-rw-r--r--viewer/readme.md26
-rw-r--r--viewer/src/@types/gallery/index.d.ts45
-rw-r--r--viewer/src/@types/tag/Operation.ts24
-rw-r--r--viewer/src/@types/tag/index.d.ts33
-rw-r--r--viewer/src/assets/scss/_buefy_variables.scss171
-rw-r--r--viewer/src/assets/scss/buefy.scss48
-rw-r--r--viewer/src/assets/scss/global.scss44
-rw-r--r--viewer/src/assets/scss/theme.scss29
-rw-r--r--viewer/src/components/LdButtonFullscreen.vue44
-rw-r--r--viewer/src/components/LdModeRadio.vue41
-rw-r--r--viewer/src/components/LdProposition.vue93
-rw-r--r--viewer/src/components/LdTagInput.vue123
-rw-r--r--viewer/src/components/index.ts41
-rw-r--r--viewer/src/locales/en.json11
-rw-r--r--viewer/src/main.ts37
-rw-r--r--viewer/src/plugins/buefy.ts28
-rw-r--r--viewer/src/plugins/fontawesome.ts44
-rw-r--r--viewer/src/plugins/i18n.ts42
-rw-r--r--viewer/src/router/index.ts41
-rw-r--r--viewer/src/shims-tsx.d.ts13
-rw-r--r--viewer/src/shims-vue.d.ts4
-rw-r--r--viewer/src/store/galleryStore.ts110
-rw-r--r--viewer/src/store/index.ts46
-rw-r--r--viewer/src/store/uiStore.ts56
-rw-r--r--viewer/src/views/Gallery.vue104
-rw-r--r--viewer/src/views/GalleryDirectory.vue45
-rw-r--r--viewer/src/views/GalleryPicture.vue40
-rw-r--r--viewer/src/views/GallerySearch.vue44
-rw-r--r--viewer/src/views/GalleryThumbnail.vue48
-rw-r--r--viewer/src/views/MainLayout.vue121
-rw-r--r--viewer/src/views/PanelLeft.vue42
-rw-r--r--viewer/src/views/PanelTop.vue86
-rw-r--r--viewer/tsconfig.json41
-rw-r--r--viewer/visualstudio.code-workspace14
-rw-r--r--viewer/vue.config.js42
-rw-r--r--viewer/win_start_vueui.cmd32
78 files changed, 16149 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f7e585b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
*.1
diff --git a/compiler/.gitignore b/compiler/.gitignore
new file mode 100644
index 0000000..778e7ef
--- /dev/null
+++ b/compiler/.gitignore
@@ -0,0 +1,3 @@
1.stack-work/
2ldgallery-compiler.cabal
3*~ \ No newline at end of file
diff --git a/compiler/Setup.hs b/compiler/Setup.hs
new file mode 100644
index 0000000..9a994af
--- /dev/null
+++ b/compiler/Setup.hs
@@ -0,0 +1,2 @@
1import Distribution.Simple
2main = defaultMain
diff --git a/compiler/app/Main.hs b/compiler/app/Main.hs
new file mode 100644
index 0000000..1a42abf
--- /dev/null
+++ b/compiler/app/Main.hs
@@ -0,0 +1,91 @@
1-- ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery.
3--
4-- Copyright (C) 2019-2020 Pacien TRAN-GIRARD
5--
6-- This program is free software: you can redistribute it and/or modify
7-- it under the terms of the GNU Affero General Public License as
8-- published by the Free Software Foundation, either version 3 of the
9-- License, or (at your option) any later version.
10--
11-- This program is distributed in the hope that it will be useful,
12-- but WITHOUT ANY WARRANTY; without even the implied warranty of
13-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-- GNU Affero General Public License for more details.
15--
16-- You should have received a copy of the GNU Affero General Public License
17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19module Main where
20
21import Paths_ldgallery_compiler (version, getDataFileName)
22import Data.Version (showVersion)
23import System.FilePath ((</>))
24import System.Console.CmdArgs
25
26import Compiler
27import Files (readDirectory, copyTo)
28
29
30data Options = Options
31 { inputDir :: String
32 , outputDir :: String
33 , rebuilAll :: Bool
34 , withViewer :: Bool
35 } deriving (Show, Data, Typeable)
36
37options :: Options
38options = Options
39 { inputDir = "./"
40 &= typDir
41 &= name "i"
42 &= name "input-dir"
43 &= explicit
44 &= help "Gallery source directory (default=./)"
45 , outputDir = "./out"
46 &= typDir
47 &= name "o"
48 &= name "output-dir"
49 &= explicit
50 &= help "Generated gallery output path (default=./out)"
51 , rebuilAll = False
52 &= name "r"
53 &= name "rebuild-all"
54 &= explicit
55 &= help "Invalidate cache and recompile everything"
56 , withViewer = False
57 &= name "w"
58 &= name "with-viewer"
59 &= explicit
60 &= help "Include the static web viewer in the output"
61 }
62
63 &= summary ("ldgallery v" ++ (showVersion version) ++ " - a static web gallery generator with tags")
64 &= program "ldgallery"
65 &= help "Compile a gallery"
66 &= helpArg [explicit, name "h", name "help"]
67 &= versionArg [explicit, name "version"]
68
69
70main :: IO ()
71main =
72 do
73 opts <- cmdArgs options
74 compileGallery (inputDir opts) (galleryOutputDir "gallery" opts) (rebuilAll opts)
75 if (withViewer opts) then copyViewer (outputDir opts) else noop
76
77 where
78 galleryOutputDir :: FilePath -> Options -> FilePath
79 galleryOutputDir gallerySubdir opts =
80 if withViewer opts then outputBase </> gallerySubdir else outputBase
81 where outputBase = outputDir opts
82
83 copyViewer :: FilePath -> IO ()
84 copyViewer target =
85 putStrLn "Copying viewer webapp"
86 >> getDataFileName "viewer"
87 >>= readDirectory
88 >>= copyTo target
89
90 noop :: IO ()
91 noop = return ()
diff --git a/compiler/data/.gitignore b/compiler/data/.gitignore
new file mode 100644
index 0000000..dd4395c
--- /dev/null
+++ b/compiler/data/.gitignore
@@ -0,0 +1 @@
viewer
diff --git a/compiler/data/readme.md b/compiler/data/readme.md
new file mode 100644
index 0000000..9aded74
--- /dev/null
+++ b/compiler/data/readme.md
@@ -0,0 +1 @@
Link `../../viewer/dist` to `./viewer` for full distribution.
diff --git a/compiler/package.yaml b/compiler/package.yaml
new file mode 100644
index 0000000..043985d
--- /dev/null
+++ b/compiler/package.yaml
@@ -0,0 +1,76 @@
1name: ldgallery-compiler
2version: 0.1.0.0
3github: "pacien/ldgallery"
4license: AGPL-3
5author: "Pacien TRAN-GIRARD, Guillaume FOUET"
6maintainer: ""
7copyright: "2019 Pacien TRAN-GIRARD, Guillaume FOUET"
8
9extra-source-files:
10- readme.md
11