all repos — min @ 609fe29b89e34e221053849397a439368be3244d

A small but practical concatenative programming language.

Started documenting mmm.
h3rald h3rald@h3rald.com
Thu, 30 Nov 2023 16:20:27 +0100
commit

609fe29b89e34e221053849397a439368be3244d

parent

dbf15ed6e0e6135003c5f4997a46ca111fb6ae7c

M site/contents/_defs_.mdsite/contents/_defs_.md

@@ -116,6 +116,7 @@ > * [Scopes](/learn-scopes)

> * [Control Flow](/learn-control-flow) > * [Shell](/learn-shell) > * [Extending min](/learn-extending) +> * [Module Management](/learn-mmm) }} {{guide-download =>
M site/contents/learn-extending.mdsite/contents/learn-extending.md

@@ -113,3 +113,4 @@ > Tip

> > For more information on how to create new modules with Nim, have a look in the [lib folder](https://github.com/h3rald/min/tree/master/minpkg/lib) of the min repository, which contains all the min modules included in the standard library. +{#link-learn||mmm||min Module Management#}
A site/contents/learn-mmm.md

@@ -0,0 +1,6 @@

+----- +content-type: "page" +title: "Learn: Module Management" +----- +{@ _defs_.md || 0 @} +
M site/rules.minsite/rules.min

@@ -3,6 +3,8 @@

'hastysite import 'min-highlight import +() :modules + ;Routing ( symbol set-destination

@@ -94,6 +96,8 @@ (dict :data ==>)

( timestamp :ts data input-fread from-json :contents + ; Save modules + contents /modules @modules ; Update timestamp contents ts %updated @contents data contents to-json %contents

@@ -156,3 +160,31 @@ ((meta /path "mmm.json" ==) (meta process-mmm-json))

((true) (meta output-cp)) ) case ) foreach + +"Generating mmm index..." notice! +; Process deps of each module -> name@version +modules ( + :module + module /deps dkeys ( + :name + module /deps name dget :version + "$#@$#" (name version) =% + ) map ", " join :dependencies + (dependencies "" ==) + ("n/a" @dependencies) + when + module dependencies %dependencies +) map @modules + +{} + "mmm/index" %id + "mmm.html" %path + ".html" %ext + "mmm" %title + "min language" %site + "page" %content-type + modules %modules +dup +"mmm" swap mustache %contents output-fwrite + +
M site/templates/_menu.mustachesite/templates/_menu.mustache

@@ -7,10 +7,11 @@ <a class="luxbar-brand" href="/"><img src="/images/logo.svg" alt="{{site}}" style="height:55px;" /></a>

<label class="luxbar-hamburger luxbar-hamburger-doublespin" for="luxbar-checkbox"> <span></span> </label> </li> - <li class="luxbar-item"><a href="/get-started/"><i class="ti-timer"></i> Get Started</a></li> - <li class="luxbar-item"><a href="/learn/"><i class="ti-help-alt"></i> Learn</a></li> - <li class="luxbar-item"><a href="/reference/"><i class="ti-book"></i> Reference</a></li> - <li class="luxbar-item"><a href="/about/"><i class="ti-info-alt"></i> About</a></li> + <li class="luxbar-item"><a href="/get-started/"><i class="ti-timer"></i> get started</a></li> + <li class="luxbar-item"><a href="/learn/"><i class="ti-help-alt"></i> learn</a></li> + <li class="luxbar-item"><a href="/mmm/"><i class="ti-package"></i> mmm</a></li> + <li class="luxbar-item"><a href="/reference/"><i class="ti-book"></i> reference</a></li> + <li class="luxbar-item"><a href="/about/"><i class="ti-info-alt"></i> about</a></li> </ul> </div> </header>
A site/templates/_module.mustache

@@ -0,0 +1,14 @@

+<h2 id="module-{{name}}">{{name}}</h2> + +<p>{{description}}</p> + +<dl> + <dt>Author</dt> + <dd>{{author}}</dd> + <dt>License</dt> + <dd>{{license}}</dd> + <dt>URL</dt> + <dd><a href="{{url}}">{{url}}</a></dd> + <dt>Dependencies</dt> + <dd>{{dependencies}}</dd> +</dl>
A site/templates/mmm.mustache

@@ -0,0 +1,23 @@

+<!doctype html> +<html lang="en"> + {{> _head}} + <body> + {{> _menu}} + <main class="pure-g"> + <article class="pure-u-5-5"> + <h1>mmm</h1> + <p>This page lists all existing public <em>managed min modules</em> that can be installed using the <a href="/learn-mmm/">min module management (mmm)</a> + commands that are built-in into the min executable.</p> + <ul> + {{#modules}} + <li><a href="#module-{{name}}">{{name}}</a></li> + {{/modules}} + </ul> + {{#modules}} + {{> _module}} + {{/modules}} + </article> + </main> + {{> _footer}} + </body> +</html>