<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%D \module
%D   [       file=mtx-context-setups,
%D        version=2016.04.05,
%D          title=\CONTEXT\ Command Overvews,
%D       subtitle=Combine Files,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \&amp; \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% begin help
%
% usage: context --extra=setups [options] [categories]
%
% --interface              : user interface (en, nl, etc)
% --overview [--save]      : use collection of files
% --list                   : show know collections
%
% end help

\input mtx-context-common.tex

\starttext

\startluacode
    local report_setups = logs.reporter("setups")

    context.starttext()

    if document.arguments.list then
        local okay = resolvers.findfile("context.mkiv") or "" -- will become an i file
        if okay ~= "" then
            okay = file.collapsepath(okay,true)
            okay = string.gsub(okay,"/base/","/interface/")
            okay = string.gsub(okay,"/sources/","/interface/")
            local path    = file.pathpart(okay)
            local pattern = file.join(path,"i-*.xml")
            local files   = dir.glob(pattern)
            local valid   = { }
            table.sort(files)
            for i=1,#files do
                local name = file.nameonly(files[i])
                local base = string.match(name,"^i%-([a-z]+)$")
                if base then
                    valid[#valid+1] = base
                end
            end
            if #valid &gt; 0 then
                report_setups("% t",valid)
            end
            context.bold("available setup groups: ")
            context("%, t.",valid)
        end
    elseif document.arguments.overview then
        if document.arguments.save then
            context.enablemode { "setups:save" }
        end
        context.input("x-setups-overview.mkiv")
    elseif #document.files &gt; 0 then
        context.usemodule { "x-setups-basics" }
        for i=1,#document.files do
            local filename = "i-" .. document.files[i]
            report_setups("processing %a",filename)
            context.loadsetups { filename }
        end
        context.input("x-setups-proofing.mkiv")
    else
        context("no setups")
    end

    context.stoptext()
\stopluacode

\stoptext

</pre></body></html>