Skip to content

add Example, Tutorial, and Test Folders from LIbraries #52

@bitbasher

Description

@bitbasher

Please expand the search for Examples to display in the list to include .scad and related files from LIbraries

The two places the list should be visible are the Welcome to OpenSCAD panel and the Files > Examples > menu item

Image

i suggest adding a line item for each installed library with a three item drop-down sub-menu :
BOSL2 (ref) ---Examples
|- Tests
|- Tutorials
where the (ref) is a folder icon with the hover message of "Open Containing Folder - /path/BOSL2 RO"

The need for the reference icon is that Libraries may be installed in a number of places by admin, by the installation and by the user. The RO suffix is to mean Read Only showing that the folder may be visited, but not modified

Obviously each Library would be searched for occurrences of the three named folders .. i know that at least BOSL2 has example sub-folders on Feature/Section folders it would be good to recurse down a level or two .. but the minimum is to collect the top level examples, tests, and tutorials

the "Open Containing Folder" should be extended to the exampes themselves, the (ref) marks to be be cute little tiny folder icons
BOSL2 (ref) ---Examples
|- Tests
|- Tutorials--- tutor 1 (ref)
|- tutor 2
|- tutor 3 (ref)
the example.scad gets the (ref) icon when any of these conditions are met:

  1. there are files in the same folder with the same name prefix but different extensions:
  2. There is a folder next to the example.scad

so if we have .../Examples/example.scad by itself then no icon

if we have
.../Examples/example.scad
.../Examples/example.png
.../Examples/example-main.dxf
.../Examples/example-part.dxf
we show the (ref) icon, and other files that start with the same name as the .scad do the same

and lastly
.../Examples/example.scad
.../Examples/images/*.png
we should show the (ref) icon

Note that only extensions of file types that may be imported by scad should be considered
And all hidden files and folders .* should be ignored

In the File Menu the (ref) icons should be left out so the drop-down menus show only folder/filename with no extension, as they do now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions