This Ruby script assists users in:
- Parameterizing folder and file names within specified directories.
- Generating tree outputs for given directories.
- Cleaning up duplicates with the assistance of
rdfind
. - Creating a difference report between two directory trees.
- Converting the directory tree into an Obsidian-friendly format, transforming folders and files into Markdown links.
- Ensure Ruby is installed on your system.
- The
activesupport
gem should be installed. You can install it using:gem install activesupport
- The utilities
tree
andrdfind
should be present on your system.
- Clone this repository or download the script.
- Modify the paths in the script (
folder1
,folder2
,rdfind_report
,diff_output
,obsidian_output1
,obsidian_output2
) to suit your directory structure. - Run the script using:
ruby main.rb
-
Parameterization: The script starts by standardizing the names of files and folders. Names are converted into a URL-friendly format, ensuring a standardized naming convention.
-
Tree Generation: The tree structure of the specified folders is generated and saved into a file.
-
Duplicate Cleanup: Utilizing
rdfind
, the script identifies duplicates within and across the specified directories. A report is generated for reference. -
Diff Generation: A difference report between the trees of the two directories is created to identify disparities.
-
Obsidian Transformation: The tree structure is converted into an Obsidian-friendly format, enabling users to visualize folder structures as interlinked Markdown files.
- The current implementation assumes certain tree formatting and may need adjustments based on the specific
tree
version or OS. - Parameterization is based on
ActiveSupport
, which handles a wide range of characters, but specific edge cases might need additional handling.
Feedback and pull requests are welcome. If you encounter any issues or have suggestions for improvements, please open an issue.