slatex / sTeX

A semantic Extension of TeX/LaTeX
49 stars 9 forks source link

make \lib* (\libinput and friends) multi-level #303

Open kohlhase opened 2 years ago

kohlhase commented 2 years ago

Currently \libinput and friends input stuff (in this order) from

  1. the meta-inf/lib director in the group and then
  2. the libdirecotry of the curren math archive.

Originally, we had a top-level meta/inf (it is still there, but does not have much useful stuff) that could host some ultra-general stuff as well. But \libinput and friends ignore it.

But GitLab now offers (and we start to use it as well) subgroups. So we should allow meta-inf/lib at all levels and have \libinputand friends check/load from all of them.

This would make the operation much more transparent and would reduce duplication,. Currently I host local packages (like ded.sty or mikoconvenience.sty in multiple groups; they could/should move to the top-level meta-inf/lib.

Jazzpirate commented 2 years ago

\libinput already takes all the group-levels into account - I just didn't know about the top-level meta-inf, and afaik it is not specified as a dependency of any archive...? I.e., yes, I agree that it should, and it's easy to fix, but in that case we should probably emphasize the existence of the mathhub-"global" meta-inf repository somehow, before we start having content depend on it ;)

Edit: oh no, I just noticed it's called meta/inf, rather than meta-inf....is it that one? That annoyingly breaks the pattern :/

Which brings up another issue: There can only be one global meta-inf repository ever, if archives really depend on it, so one should be very careful with what goes in there - any prelude.tex in there for example would almost be functionally equivalent of just having the code in there in the stex.sty itself... ;)

kohlhase commented 2 years ago

\libinput already takes all the group-levels into account - I just didn't know about the top-level meta-inf,

I had also forgotten about it.

and afaik it is not specified as a dependency of any archive...?

that is easy to do. But currently there is nothing relevant in there. But I would like to put all the styles and themes for \libusepackage and \libusetheme there, otherwise they need to be duplicated (with the ensuing problems).

kohlhase commented 2 years ago

but in that case we should probably emphasize the existence of the mathhub-"global" meta-inf repository somehow, before we start having content depend on it ;)

I am not sure what you mean by this, emphasize how?

kohlhase commented 2 years ago

Edit: oh no, I just noticed it's called meta/inf, rather than meta-inf....is it that one? That annoyingly breaks the pattern :/

Yes, it is annoying, but apparently (just tested) it is impossible to make a repository without a group in gitlab. Thus the name.

kohlhase commented 2 years ago

Which brings up another issue: There can only be one global meta-inf repository ever, if archives really depend on it, so one should be very careful with what goes in there - any prelude.tex in there for example would almost be functionally equivalent of just having the code in there in the stex.sty itself... ;)

I was not planning to have a significant preamble there (and you are right about the equivalence). The only preamblic stuff that comes to mind could be something like namespace configuration, i.e. specialising the namespace to https://gl.mathhub.info/ and every group meta-inf preamble could add their bit to that (if we should ever need such a thing).

BUT the styles and themes could profitably go there. Currently there are (obsolete) OMDoc schemata there, but new ones might go there eventually.

Jazzpirate commented 2 years ago

Which brings up another issue: There can only be one global meta-inf repository ever, if archives really depend on it, so one should be very careful with what goes in there - any prelude.tex in there for example would almost be functionally equivalent of just having the code in there in the stex.sty itself... ;)

I was not planning to have a significant preamble there (and you are right about the equivalence). The only preamblic stuff that comes to mind could be something like namespace configuration, i.e. specialising the namespace to https://gl.mathhub.info/

Which would mean that every math archive anyone would want to have in their local mathhub would inherit that namespace... that's what I meant with respect to "might as well go into sTeX" - even if we use the top-level-meta-inf on gl.mathhub.info for gl.mathhub.info-specific things, there can only be one top-level meta-inf on any user's local mathhub.

BUT the styles and themes could profitably go there. Currently there are (obsolete) OMDoc schemata there, but new ones might go there eventually.

That makes some sense, but if we put them in the (gloablly unique) meta-inf-repo and all our repos depend on it - again, we might as well put it into sTeX itself, because there'll hardly be a way for any stex user to avoid it then.

I am not sure what you mean by this, emphasize how?

By adding it to the dependency-list of a repository, most importantly :)

kohlhase commented 2 years ago

That makes some sense, but if we put them in the (gloablly unique) meta-inf-repo and all our repos depend on it - again, we might as well put it into sTeX itself, because there'll hardly be a way for any stex user to avoid it then.

Currently you are right. But let's assume that other people establish mathhub-like hubs, e.g. https://glmh.acm.org then as a local user I can extend my .../localmh to .../localmh/gl.mathhub.info (including the meta/inf we are talking about in this issue) and .../locacalmh/glmh.acm.org with its own meta/inf and (possibly even ) a local .../localmh/meta/inf. And all would be dandy.

kohlhase commented 2 years ago

Edit: oh no, I just noticed it's called meta/inf, rather than meta-inf....is it that one? That annoyingly breaks the pattern :/

Yes, it is annoying, but apparently (just tested) it is impossible to make a repository without a group in gitlab. Thus the name.

Well there is always the dual thing we could do. Instead of standardizing meta-inf/...., we could (using subgroups in GitLab) everywhere have meta/inf. Seems like possible overkill, but we should think about this.

kohlhase commented 2 years ago

Seems like possible overkill, but we should think about this.

after all this is a math archives feature for this afternoon.

Jazzpirate commented 2 years ago

No they can't ;) sTeX necessarily encorces a correspondence between archives and directories in the mathhub-folder. smglom/algebra needs to be in /path/to/mathhub/smglom/algebra - no additional folder allowed ;) ...or we have to start doing this now and replace all \usemodule[ar/chive] by \usemodule[gl.mathhub.info/ar/chive], which I would advise against :D ...or people can only ever use one "gitlab"-subfolder at a time and set their MATHHUB-variable accordingly

kohlhase commented 2 years ago

hmmm, you are right. I had not thought about this.

Jazzpirate commented 2 years ago

I think the better solution would be that archives tht "share" lib-content (in this case: MiKoMH, MiKoCourses, MiKoProbles) should be in a corresponding gitlab-group... we didn't have a reason to do so so far, because gl.mathhub.info "virtually" serves as one such group in practice, but once others start with separate gitlabs, we should maybe reorganize things accordingly