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

Write a script to import template names from https://github.com/chriskempson/base16-builder #19

Closed
bookercodes opened this issue Feb 4, 2016 · 16 comments

Comments

@bookercodes
Copy link
Collaborator

Write a throwaway script that

  1. Reads every template name from this folder

  2. Generates a task list for every template name:

Once the script has finished running, we can create a new issue to track progress of #16.

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

I can do this if you want.

@bookercodes
Copy link
Collaborator Author

@aloisdg Yes please.

Here is a sample output:

  • dmenu-dark.nunjucks
  • dmenu-light.nunjucks
  • emacs-dark-theme.el.nunjucks
  • emacs-light-theme.el.nunjucks
  • rxvt-unicode-dark.nunjucks
  • rxvt-unicode-light.nunjucks

Note: I want the db/templates folder to be flat. No more sub-directories.

Also note: Ideally templates will have consistent names. The convention I'm using at the moment is: <template name>-<light/dark>.nunjucks. Don't worry about that for this issue, though!

Thanks. If you have any questions, please don't hesitate to ask.

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

What about folder who have more than one? I am thinking about Atom for example.

$ ls atom
-dark-base.less.erb -dark-syntax-variables.less.erb -light-syntax-variables.less.erb -light-base.less.erb

I dont mind breaking the original model if we keep an entry on the wiki about it. A kind of "How this project differs from the original". I think it is very important to let people switch smoothly from one to another.

@bookercodes
Copy link
Collaborator Author

@aloisdg It shouldn't be that much different from the original. And yes, I agree, there should be a section in the documentation outlining the differences.

I am thinking about Atom for example.

I noticed that the Atom package uses two files, too. I wonder if it's possible to combine them somehow...?

Aside from that, I'm not sure what to do... yet 😛

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

For now, I have:

done with a small bash script:

#!/bin/bash

url="https://github.com/chriskempson/base16-builder/tree/master/templates/"
for item in *; do
  echo "- [ ] [$item]($url$item)"
done

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

Why you dont want to keep folder? Can you at least keep the same name for now (i3 vs i3wm)? I can eqsily write a script to autochecked boxes if we keep the old name.

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

Another output with file:

As you see, we are going to make some changes.

  • What about the vars folder? Ok for remove it?
  • What about folder or file who starts or contains dot or dash?
  • What about file without dark or white flag?
  • What about template with 256 support

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

I would love to add a link for each to the author and link to file in the project and one line to the old project.

@bookercodes
Copy link
Collaborator Author

Nice job. You're a bash wizard 😉


Why you dont want to keep folder?

Because the original tool mandates that you specify a path:

$ base16-builder -s schemes/gooey -t templates/rxvt-unicode/rxvt-unicode-dark.erb

I think it's much more intuitive to specify names:

$ base16-builder -s gooey -t rxvt-unicode-dark

Getting rid of folders enables this.


Can you at least keep the same name for now (i3 vs i3wm)? I can eqsily write a script to autochecked boxes if we keep the old name.

Sure. I can manually rename the templates after. Remember:

  • I want consistent names for all templates
  • After version 1.0.0, template names shouldn't change because that could potentially be confusing to the user.

What about the vars folder? Ok for remove it?

I say yes.

From what I can see, a lot of the templates in that folder can be turned into top-level templates if necessary.


What about file without dark or white flag?

Hm. Good question. For now let's just omit the flag e.g. i3wm instead of i3wm-dark.


What about folder or file who starts or contains dot or dash?

+ tempaltes
  - urxvt
    - -dark.erb
    - -light.erb 

Becomes....

+ templates
  - urxvt-dark.nunjucks
  - urxvt-light.nunjucks

What about template with 256 support?

+ templates
  - terminal-app
    - dark.256.terminal.erb
    - dark.terminal.erb
    - light.terminal.erb

Becomes....

+ templates
  - terminal-app-dark-256.nunjucks
  - terminal-app-dark.nunjucks
  - terminal-app-light.nunjucks

Sound good?

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

Nice job. You're a bash wizard 😉

I dont really like bash but its handy. ^^

Getting rid of folders enables this.

As an user, you shouldnt care about how the file is named. You want the template thats all. We could imagine something like this:

$ base16-builder -s gooey -t rxvt-unicode -l dark -p 256

with "-l, --luminosity" (mandatory field) and "-p,--palette" (optional field)

If luminosity is not set (as an optional field), we could imagine generate both dark and light. We could imagine run base16-builder -s * -t rxvt-unicode -l dark or better base16-builder -t rxvt-unicode -l dark to generate all dark theme for rxvt-unicode.

What do you think?

@bookercodes
Copy link
Collaborator Author

As an user, you shouldnt care about how the file is named. You want the template thats all. We could imagine something like this:

  $ base16-builder -s gooey -t rxvt-unicode -l dark -p 256

👍 👍 👍

I think that is really pleasant syntax. Give me some time to mull it over and gather some external input.

If luminosity is not set (as an optional field), we could imagine generate both dark and light. We could imagine run base16-builder -s * -t rxvt-unicode -l dark or better base16-builder -t rxvt-unicode -l dark to generate all dark theme for rxvt-unicode.

At the moment I am against writing files to the system. I would much rather write to stdout and allow the user to pipe it wherever.

That makes it impossible to generate two themes at once.

I will add an option to generate all themes in the future if there's a demand. For now, I want to keep it simple.

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

I will add an option to generate all themes in the future if there's a demand. For now, I want to keep it simple.

I agree. You can open a new issue for this with a flag "up-for-graps". Maybe someone will do it.

So we can create a spec.

The delimiter is '-' and the extension is '.nunjucks'

name type mandatory note
tool string true can contain any character
luminosity enum true value possible are dark and light
palette int false 256 only value known

A valid name is:

urxvt-light.nunjucks    // tool-luminosity.nunjucks

or

terminal-app-dark-256.nunjucks    // tool-luminosity-palette.nunjucks

One more thing to add to the wiki ;)

@bookercodes
Copy link
Collaborator Author

Yes, exactly!

As long as we stick to that specification, it should be feasible to implement this syntax:

$ base16-builder -s gooey -t rxvt-unicode -l dark -p 256

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

Still against the use of folder? Because with the spec we could just see the template as the folder to open and the file will be dark-256.nunjucks. Basically your path to read would be db/{templName}/{luminosity}.nunjucks. What do you think of this?

@aloisdg
Copy link
Member

aloisdg commented Feb 4, 2016

This spec is now valid.

The delimiter is '-' and the extension is '.nunjucks'

name type mandatory note
tool string true can contain any character. It is a folder
luminosity enum true value possible are dark and light
palette int false 256 only value known

A valid name is:

urxvt/light.nunjucks    // tool/luminosity.nunjucks

or

terminal-app/dark-256.nunjucks    // tool/luminosity-palette.nunjucks

@bookercodes
Copy link
Collaborator Author

Such a script has been written thanks to @aloisdg so I am going to close this issue now.

We can take any further discussion to #23.

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

No branches or pull requests

2 participants