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

cli: Split out ascii template versions and migrate config to toml #3411

Closed
wants to merge 1 commit into from

Conversation

algmyr
Copy link
Contributor

@algmyr algmyr commented Mar 31, 2024

This should hopefully unblock #3381.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

@algmyr algmyr force-pushed the push-xlrrrpnurunn branch from f53c7d6 to ae2793c Compare March 31, 2024 18:47
@martinvonz
Copy link
Member

I would prefer to unblock #3381 by moving keeping the default templates in Rust as @yuja suggested. What do you think?

@algmyr
Copy link
Contributor Author

algmyr commented Mar 31, 2024

I would prefer to unblock #3381 by moving keeping the default templates in Rust as @yuja suggested. What do you think?

I read that as more a statement of fact by @yuja than a suggestion. But it's one way to do it, sure. Hard coding the defaults in the rust code felt hacky when it was introduced, but was needed because there was the different ascii path.

Would you rather keep the defaults hardcoded in the source and do the move out to toml if/when we get an ascii property to avoid having the duplicate templates?

FWIW it would also make some odd features more awkward to implement, like coloring the working change depending on things like being conflicted. Granted it's likely me being protective of my "oh cute, if we split symbol and coloring we can do this one thing". I can still add that feature for my own amusement in my personal config. :P

@martinvonz
Copy link
Member

Would you rather keep the defaults hardcoded in the source and do the move out to toml if/when we get an ascii property to avoid having the duplicate templates?

Yes, I would prefer that. It seems unfortunate to introduce a separate template only for a hopefully short time until we support for an ascii property.

By the way, another option is that introduce a new type in the templater language for the graph node. I don't know which is better. Maybe there should instead be a ui.ascii a general config to get ascii output. We have also talked about making configs accessible in the templating language. Then we would be able to check the ui.graph.style config in the template.

@algmyr algmyr closed this Mar 31, 2024
@yuja
Copy link
Contributor

yuja commented Apr 1, 2024

My current idea is to add some config accessor and == operator to templater.

BTW, the log node template could be extracted as an alias, and the hardcoded default could be a shim.

node_template_for_key("builtin_log_node_fancy", "builtin_log_node_ascii")

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

Successfully merging this pull request may close these issues.

3 participants