aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2019-10-07 15:05:00 +0000
committers-ol <s-ol@users.noreply.github.com>2019-10-07 15:14:02 +0000
commit894bde0db758f2db03fd43d9fa2cd13a33d20643 (patch)
treebb4d23e106dd24d189df9e220e72ac7e5ccb6997
parentclean up a little (diff)
downloadmmm-894bde0db758f2db03fd43d9fa2cd13a33d20643.tar.gz
mmm-894bde0db758f2db03fd43d9fa2cd13a33d20643.zip
little meta-link updates
-rw-r--r--README.md14
-rw-r--r--build/import.moon (renamed from build/import_all.moon)6
-rw-r--r--build/layout.moon9
-rw-r--r--build/render_all.moon6
-rw-r--r--root/text$moonscript -> fn -> mmm$dom.moon2
5 files changed, 27 insertions, 10 deletions
diff --git a/README.md b/README.md
index 35cccd4..f687309 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,11 @@ You can build the static content with:
$ tup init
$ tup
-Then, run some kind of HTTP server from within `root`, e.g. with python 3 installed:
+Next you can render a sqlite3 mmmfs database using
+
+ $ moon build/render_all.moon db.sqlite3
+
+Then, run some kind of HTTP server from within `out`, e.g. with python 3 installed:
$ cd root
$ python -m http.server
@@ -37,6 +41,14 @@ You can do this with the following command:
$ tup monitor -f -a
+### Dependencies
+You will need:
+
+- [MoonScript][moonscript]: `luarocks install moonscript`
+- [lua-sqlite3](https://luarocks.org/modules/moteus/sqlite3): `luarocks install sqlite3`
+- [discount](https://luarocks.org/modules/craigb/discount): `luarocks install discount` (requires libmarkdown2)
+- [busted](https://olivinelabs.com/busted/): `luarocks install busted` (for testing only)
+
[moonscript]: https://moonscript.org/
[mmm]: https://mmm.s-ol.nu/
[tup]: https://gittup.org/tup
diff --git a/build/import_all.moon b/build/import.moon
index 3a2ac61..624b54a 100644
--- a/build/import_all.moon
+++ b/build/import.moon
@@ -13,8 +13,8 @@ import Fileder, Key from require 'mmm.mmmfs.fileder'
import SQLStore from require 'mmm.mmmfs.drivers.sql'
-- usage:
--- moon import_all.moon <root>
-{ root } = arg
+-- moon import.moon <root> [output.sqlite3]
+{ root, output } = arg
assert root, "please specify the root directory"
@@ -31,7 +31,7 @@ load_facet = (filename, filepath) ->
key, value
-with SQLStore verbose: true
+with SQLStore name: output, verbose: true
import_fileder = (fileder, dirpath) ->
for file in lfs.dir dirpath
continue if '.' == file\sub 1, 1
diff --git a/build/layout.moon b/build/layout.moon
index 6d6e072..61f93cb 100644
--- a/build/layout.moon
+++ b/build/layout.moon
@@ -6,11 +6,11 @@ pick = (...) ->
i = math.ceil math.random! * num
select i, ...
-
iconlink = (href, src, alt, style) -> a {
class: 'iconlink',
- :href,
target: '_blank',
+ rel: 'me',
+ :href,
img :src, :alt, :style
}
@@ -69,8 +69,9 @@ logo = svg {
}
div {
class: 'icons',
- iconlink 'https://github.com/s-ol/mmm', 'https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg',
- iconlink 'https://twitter.com/S0lll0s', 'https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/twitter.svg',
+ iconlink 'https://github.com/s-ol', 'https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg', 'github'
+ iconlink 'https://merveilles.town/@s_ol', 'https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/mastodon.svg', 'mastodon'
+ iconlink 'https://twitter.com/S0lll0s', 'https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/twitter.svg', 'twitter'
iconlink 'https://webring.xxiivv.com/#random', 'https://webring.xxiivv.com/icon.black.svg', 'webring',
{ height: '1.3em', 'margin-left': '.3em', 'margin-top': '-0.12em' }
}
diff --git a/build/render_all.moon b/build/render_all.moon
index e2f171e..dfbed27 100644
--- a/build/render_all.moon
+++ b/build/render_all.moon
@@ -12,6 +12,10 @@ import tohtml from require 'mmm.component'
import Browser from require 'mmm.mmmfs.browser'
import get_meta, header, footer from require 'build.layout'
+-- usage:
+-- moon render_all.moon [db.sqlite3]
+{ file } = arg
+
export BROWSER
render = (fileder, output) ->
@@ -106,7 +110,7 @@ load_tree = (store, root='') ->
root
-tree = load_tree SQLStore!
+tree = load_tree SQLStore :name
for fileder in coroutine.wrap tree\iterate
print "rendering '#{fileder.path}'..."
diff --git a/root/text$moonscript -> fn -> mmm$dom.moon b/root/text$moonscript -> fn -> mmm$dom.moon
index 84aed7f..8c06030 100644
--- a/root/text$moonscript -> fn -> mmm$dom.moon
+++ b/root/text$moonscript -> fn -> mmm$dom.moon
@@ -17,7 +17,7 @@ import link_to from (require 'mmm.mmmfs.util') require 'mmm.dom'
'.'
br!
'You can find the source code of everything '
- a { 'here', href: 'https://github.com/s-ol/mmm' }
+ a { 'here', href: 'https://git.s-ol.nu/mmm' }
'.'
br!
'Most of the inner-workings of this page are documented in '