Skip to content

Conversation

@ikoide
Copy link

@ikoide ikoide commented Jan 29, 2024

No description provided.

@ikoide ikoide mentioned this pull request Jan 29, 2024
@mbledkowski
Copy link

LGTM @saccarosium

@saccarosium
Copy link
Contributor

It should be generated with the gen.py script. First create a file called oxocarbon-dark.toml.j2 into the templates folder. Than you should modify the gen.py script to something like:

import yaml
import jinja2


def read_theme(name: str):
    theme = {}

    with open(f"palette/base16-oxocarbon-{name}.yaml", "r") as f:
        theme = yaml.safe_load(f)
        f.close()

    return theme


def main():
    env = jinja2.Environment(loader=jinja2.FileSystemLoader("./templates/"))
    tmp1 = env.get_template("oxocarbon-dark.toml.j2")
    tmp2 = env.get_template("oxocarbon-dark.yml.j2")
    thm = read_theme('dark')

    con1 = tmp1.render(thm)
    con2 = tmp2.render(thm)

    open('oxocarbon-dark.yml', 'w').close()

    with open('oxocarbon-dark.yml', 'w') as f:
        f.write(con1)
        f.close()

    open('oxocarbon-dark.toml', 'w').close()

    with open('oxocarbon-dark.toml', 'w') as f:
        f.write(con2)
        f.close()

main()

Please read and test this first I'm quite in a rush now.

@hardal7 hardal7 mentioned this pull request Jul 4, 2024
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