gpt-4o-2024-05-13· OpenAI
WildChat-4.8M (AI2)
Improve the clarity of the following request [code] 📁 ℹ️ <subdirectory name> [code]
- User
Improve the clarity of the following request
code - Assistant
Improve the clarity of the following request
Create a JavaScript CLI application in a single .cjs file with the following functionality:
The default command is a directory. The directory is traversed to extract all the filenames (including extensions)
and subdirectory names. These filenames and subdirectory names are then stored in a csv file, which resides in the same directory as this application. In the csv file, there are four columns named `Files & Directories`, `Extension`, `Path`, and `Title`. In the `Files & Directories` column, the filenames (without extensions) and subdirectory names are stored. In the `Extension` column, the extension of each filename is stored. In the `Path` column, the path to each filename and subdirectory names is stored. The content of the `Title column` is acquired in this way:
1. The user must provide the path to a dataset via the `--edit` flag. The path will be saved to `config.json` in the same directory as this application. The dataset path can be checked via the `--config` flag. The dataset is a collection of data units each formatted as:
Name: <value>
Title: <value>
Description: <value>
2. The filenames and subdirectory names in the `Files & Directories` column are matched to the Name keys in the dataset. Once matched, the corresponding title of each filename and subdirectory name is stored to the `Title` column in the CSV fie.
Once the columns in the CSV file are completed, an HTML file will be then created. The path to the html file is also provided via the `--edit' flag, which is also saved to the `config.json`, and can be also checked via the '--config' flag. The HTML file will visually represent the hierarchical structure of the filenames and subdirectory names. Basically, the HTML file will contain the filenames and subdirectory names from the `Files & Directories` column that are hierarchicaly structured the same way they are hierarchicaly structured in the directory they originally come from.
Once the filenames and subdirectory names are hierarchicaly structured in the HTML file, each filename and subdirectory name are renamed to their corresponding `Title` in the CSV file.
Additionaly, the HTML file should:
- Allow subdirectory names to be folded and expanded with simple animations.
- Display vibrantly color-coded filenames, subdirectory names, and file extensions.
- Contains tree edges to connect the subdirectory names and filenames
- Show the following structure:
- The ℹ️ emoji precedes each filename and subdirectory name. Example format:
```
📁 ℹ️ <subdirectory name>
```
- File extensions are enclosed in round brackets and precede the filenames. The file extensions of each filename can be determined by referring to the CSV file.
- Example format: ℹ (.ext) Filename
- Upon clicking (put a simple animation on the clicking action) the ℹ️ emoji, a small pop-up message will show up right above the ℹ️ emoji revealing the orginal path to a subdirectory name or filename. The path to each subdirectory and filename can be determined by referring to the CSV file.
- Print the path to the generated HTML file to the console.
Include a comprehensive help menu accessible via '-h' or '--help', detailing all available commands and their usage. Additionally, implement robust error handling with clear user feedback. Moreover, use CommonJs.
Sure, here is your revised request with improved clarity:
Create a JavaScript CLI application as a single .cjs file with the following functionality:
Directory Traversing & CSV Generation:
Files & Directories, Extension, Path, and Title.CSV Columns:
Files & Directories entries with dataset Name values provided by the user.--edit flag and saved to config.json.--config flag.Name: <value>
Title: <value>
Description: <value>
Title column in the CSV file is populated by matching entries from Files & Directories with Name values in the dataset.--edit flag, saved to config.json, and can be checked using the --config flag.Title from the CSV.📁 ℹ️ <subdirectory name>
ℹ️ (.ext) Filename
-h or --help, detailing all available commands and their usage.This version breaks down the requirements into clear sections, improving comprehension and readability.
Not yet included in a published release.