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

Allow nested class / sub class #75

Open
hbock-42 opened this issue Jun 6, 2023 · 0 comments
Open

Allow nested class / sub class #75

hbock-42 opened this issue Jun 6, 2023 · 0 comments

Comments

@hbock-42
Copy link

hbock-42 commented Jun 6, 2023

Is your feature request related to a problem? Please describe.
This is not really a problem as I am able to use the package without trouble, this is more a quality-of-life feature request.
Let's say I have images under different folders (maybe because they will be used in different features inside the application, or because they are of different types):

- images 
      |---svgs
            |---sgv1
            |---svg2
            |---.....
      |---png
            |---png1
            |---.....

Right now with spider I can create 2 classes, Svgs and Pngs, or create 1 class containing every Svgs and Pngs. I can add a prefix to the Pngs and a prefix to the Svgs, but when using it I will have to do:
Images.pngName1 for a png named Name1 and Images.svgName2 for a svg named Name2.

Describe the solution you'd like
I would like to do:
Images.png.name1 and Images.svg.name2

I think we could add a parameter to the spider.yaml or spider.json file when creating a class called sub_classes (like the sub_groups param works). It would look something like that:

groups:
  - class_name: Images
    sub_classes:
      - path: assets/images/svgs
        class_name: svg
        types: [ .svg ]

      - path: assets/images/pngs
        class_name: png
        types: [ .png ]
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

No branches or pull requests

1 participant