Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xtemplate] Use of instance-type keys not clearly documented #656

Open
tail-reversion opened this issue Jan 6, 2020 · 8 comments
Open
Labels
documentation Issues in the documenation xtemplate

Comments

@tail-reversion
Copy link

Template parameters can include instances of other templates, however, the documentation does not say what type of variable the instances should be assigned to, nor does it say how to use an instance-type parameter in template code.

That is, given

\DeclareTemplateInterface { myobject } { mytemplate } { 0 }
  { foo : instance { otherobject } }

it is unclear how to proceed at the next step:

\DeclareTemplateCode { myobject } { mytemplate } { 0 }
  { foo = ??? }
  { how to use foo? }
@tail-reversion
Copy link
Author

Reading through the code of xgalley and its example file, I’ve found that the name of the instance is what should be passed to the parameter key, that the appropriate variable is a function name with the correct signature, and that the assigned instance is then used like any other function.

That is, the next step would be

\DeclareTemplateCode { myobject } { mytemplate } { 0 }
  { foo = \__my_foo: }
  { \__my_foo: }

and

\DeclareInstance { myobject } { myinstance } { mytemplate }
  { foo = myotherinstance }

@josephwright josephwright added documentation Issues in the documenation xtemplate labels Jan 6, 2020
@josephwright
Copy link
Member

It's pretty clear that xtemplate is a set of good ideas but won't go forward: I'm not sure what's best here.

@car222222
Copy link
Contributor

but won't go forward

Meaning?

@FrankMittelbach
Copy link
Member

but won't go forward

Meaning?

meaning that most of us (all? I?) think that xtemplate was a good prototype with good ideas but not necessarily the best or the most appropriate ones in the end and that by the end of the days the final interface will look different even though it will probably incoprporate several of the ideas in xtemplate in one way or the other. And that's what Joseph referred to.

@car222222
Copy link
Contributor

Ok, so just the interfaces will not 'go forward'. Much relief.

@tail-reversion
Copy link
Author

Considering this information and considering how heavily my experimental class relies on xtemplate, it sounds like it might be best to shelve the class, for the time being, and spend my time on other LaTeX-related development.

@josephwright
Copy link
Member

@tail-reversion xtemplate is not going to get removed or anything like that: there will at some stage be an improved approach. I wouldn't want to put you off: if no one tries stuff out, we don't know where to go next!

@tail-reversion
Copy link
Author

In that case, I’ll continue developing the class, using xtemplate. When a better solution is ready, then I’ll replace the old code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues in the documenation xtemplate
Projects
None yet
Development

No branches or pull requests

4 participants