-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
sile-texmode could be merged, if you want it #947
Comments
Hmm, I'm torn. On the one hand, we now have package manager madness. On the other, this is very cool indeed. On the third hand, it encourages more use of the TeXlike mode (boo hiss). On the fourth hand, people are gonna use that anyway. Heck, let's put it in the distribution. If we have boustrophedon support in there, this can certainly go in. It will need autodoc first though. |
This is ... like the playwright that cooked up Romeo and Juliet collaborated with the art director for Mad Max and they wrote a poem together.
I'm not at all sure this is conceptually the best way to go about this, and I don't think we should upstream it until we get that hashed out. I've been working for a while on being able to embed other languages ... we already do this 100% for Lua code in TeXlike inputs. However I've also been setting up similar things for Fluent (#665) and Lilypond (#435). This case is a little bit different being a hybrid between regular TeXlike language inputs and raw string replacements, but it has some of the same issues. Another similar case is Mathjax (#220 or several other math related ideas and WIP). I don't really want 4 or 5 different ways to embed other languages, I think we need to have first class support for letting packages do this. Right now Another thought to throw out is that for many of the replacements, using string matching and replacements (ala input filter) is going to be more brittle that just defining full blown commands and letting SILE do the parsing. This doesn't handle all the things (i.e. not combining characters, but I suggest carrying on a little bit as an external package because that will add a lot of flexibility to iterate faster and cover your own needs, but as things progress I would definitely keep an eye on how to address the above issues so it can be upstreamed. |
In re: conceptual issues, see also my latest comment on #940. @simoncozens Thanks for your support! |
Cross-linking #652 which has some related discussions. |
Migrating comments from 940 since this that PR is closed and this issue is open and probably a better home for ongoing discussion: @ctrlcctrlv wroteE:
@alerque wrote:
|
@alerque An earlier version did, in fact, operate on But there's a few reasons this cannot work anymore/did not work well.
I ask that in |
I don't think inputfilter is the way to do this...that's not how I would handle
We can probably get that back, but I'm not convinced you need it. If you're not using registered SILE commands and doing your own substitutions, you don't need it. See the end...
SILE environments can take options too, as many as you please. Something like this should work:
I don't really have any interest replicating in LaTeX's way of handling multiple arguments. I can't think of a single thing it's good for other than TeX didn't have any better way of parsing them and it got stuck with them. If you want to make a
But I think you've missed the point of what I'm suggesting. There already is a mechanism for what you are calling "takesstring": It's called passthrough, and you have to tell the TeXlike parser ahead of time what commands will operate in that mode so they don't get parsed into the AST. I don't think inputfilter is broken, it just isn't meant to introduce a whole new grammar than happens to conflict with TeXlike syntax commands. Hence the passthrough commands & environments like we user for |
How would I tell the parser to ignore the texmode environment? |
Add your command name here: https://github.com/sile-typesetter/sile/blob/master/core/inputs-texlike.lua#L9-L11 Note there is no way for a 3rd party package to change this because by the time any package you load is loaded the parser has already parsed the document! I haven't figured out a way around that yet except to hard code this list of potential passthrough commands. |
Totally agree with @alerque. Making things easier for TeX users, fine. Trying to replicate TeX, less so... |
@alerque This is quite a problem as I don't want users to need to patch SILE. If I PR a change to that file you'll accept it? |
I'm leery of adding commands there out of the box until there is a clear use case, at least in large part because it blocks being able to register that as a command for use any other way. At the same timet I don't want to hamper 3rd party hacking! One of the reasons SILE is in Lua in the first place was to make it possible to tamper with the internals. Right now the passthroughCommands flag is an internal that is not accessable to tampering from a package or document. How about we make it more hackable by adding a way to add items to that array from the command line invocation before the parser initializes, then wait and see what the use case ends up looking like. |
Yes to command line :-) Let me know when it's merged and I'll update sile-texmode to use it. |
Actually come to think of you don't need anything from this end, this is already hackable. Example:
Run with:
The |
Ooh :-) shiny 🤩 |
I'm pretty sure at this point we don't plan on bundling texmode in SILE releases, but I do want to improve the interface so 3rd party packages aren't at the disadvantage they are now when it comes to being able to do their own parsing of content. I've opened #1092 to track that specifically. If there is anything else I've missed in here than needs tracking feel free to remind me ;-) |
Ostensibly, this is a tracking issue for the merger of my
sile-texmode
, aka LaTeXmode for SILE, intopackages/
.It's around 300-500 lines of code depending on how you count the
.sil
files.LaTeXmode for SILE
evil?.sil
evil?.pdf
But...
But I'm more opening it to spur discussion. I don't really expect this to be merged upstream. I worked very hard on it, yes, but my effort is not the barometer by which upstream-worthiness is measured :-)
In #324 (comment), @simoncozens, our BDFL, wrote...
@alerque made some good points there, but here's perhaps another one. You guys aren't going to like everything users will want. I'd say, my SILE TeXmode is an excellent example.
Users also are sometimes willing to put up with more bugginess to get a feature they need ASAP.
I would really like some way to get my work on sile-project.org without needing it to be fully upstreamed. Something like weechat.org's plugins database.
The text was updated successfully, but these errors were encountered: