Arkhivist Creator
Arkhivist is a Tkinter-based application designed to manage and edit HTML files. It provides a user-friendly interface to create, open, edit, and save HTML files, along with managing the folder structure. Below is a detailed explanation of the application's behavior, functionality, and the purpose of each field and button.
Application Behavior and Functionality
File Name Field:
Purpose: Displays the name of the currently selected file.
Editable: Yes.
Save Options: Changes can be saved independently or as part of the "Save All" operation.
Behavior: When edited, the new file name is saved, and the file is renamed accordingly.
Title Field:
Purpose: Displays the HTML title tag content.
Editable: Yes.
Save Options: Changes can be saved independently or as part of the "Save All" operation.
Behavior: When edited, the new title is saved in the HTML file's
<title>tag and reflected in the<h1>tag in the body.
Location Field:
Purpose: Shows the current location within the file's folder structure.
Editable: Yes.
Save Options: Changes can be saved independently or as part of the "Save All" operation.
Behavior: Displays the folder structure in a clickable format, allowing navigation through folders. The location is also displayed on the HTML page when loaded.
Folder Contents:
Purpose: Displays the contents of the currently selected folder.
Behavior: Selecting a file or folder from this list opens it in Arkhivist. Users can add, rename, or delete folders and files, and these changes are reflected in the actual file system.
Content Section:
Purpose: Allows editing of the HTML file's main content.
Editable: Yes.
Save Options: Changes can be saved independently or as part of the "Save All" operation.
Behavior: The content is displayed in the HTML file's body within a
<div>tag with the idcontent.
UI Elements and Their Functions
File Name Field:
file_name_field = tk.Entry(root, width=50)
Displays: The name of the current file.
Editable: Yes.
Save Button: Saves the file name independently.
Save As Button: Saves the file name as part of the "Save All" operation.
Title Field:
title_field = tk.Entry(title_frame, width=50)
Displays: The HTML title.
Editable: Yes.
Save Button: Saves the title independently.
Save As Button: Saves the title as part of the "Save All" operation.
Location Field:
location_field = tk.Entry(location_frame, width=50)
Displays: The folder structure.
Editable: Yes.
Save Button: Saves the location independently.
Save As Button: Saves the location as part of the "Save All" operation.
Open Button: Opens the selected file or folder.
Folder Contents:
folder_contents = tk.Listbox(root, width=50, height=10)
Displays: The contents of the current folder.
Behavior: Selecting an item opens it in Arkhivist.
Content Section:
content_field = tk.Text(content_frame, width=50, height=10)
Displays: The main content of the HTML file.
Editable: Yes.
Save Button: Saves the content independently.
Save As Button: Saves the content as part of the "Save All" operation.
Folder Management Buttons:
create_folder_button = tk.Button(folder_management_frame, text="New Folder", command=create_folder)
rename_folder_button = tk.Button(folder_management_frame, text="Rename Folder", command=rename_folder)
delete_folder_button = tk.Button(folder_management_frame, text="Delete Folder", command=delete_folder)
New Folder: Creates a new folder in the current directory.
Rename Folder: Renames the selected folder.
Delete Folder: Deletes the selected folder.
New HTML File Button:
new_button = tk.Button(root, text="New HTML File", command=new_file)
Creates: A new HTML file with the specified fields.
Save All Button:
save_all_button = tk.Button(root, text="Save All", command=save_all)
Saves: All fields (File Name, Title, Location, Content) together.
Save Status Label:
save_status_label = tk.Label(root, text="")
Displays: The status of the save operation.
Code Excerpt Explanation
folder_contents.pack(pady=5)
folder_contents.bind('<<ListboxSelect>>', open_selected_file)
# Folder management buttons
folder_management_frame = tk.Frame(root)
folder_management_frame.pack(pady=5)
create_folder_button = tk.Button(folder_management_frame, text="New Folder", command=create_folder)
create_folder_button.pack(side=tk.LEFT, padx=5)
rename_folder_button = tk.Button(folder_management_frame, text="Rename Folder", command=rename_folder)
rename_folder_button.pack(side=tk.LEFT, padx=5)
delete_folder_button = tk.Button(folder_management_frame, text="Delete Folder", command=delete_folder)
delete_folder_button.pack(side=tk.LEFT, padx=5)
# Buttons to create new file and save all
new_button = tk.Button(root, text="New HTML File", command=new_file)
new_button.pack(side=tk.LEFT, padx=10, pady=10)
save_all_button = tk.Button(root, text="Save All", command=save_all)
save_all_button.pack(side=tk.LEFT, padx=10, pady=10)
# Label to display save status
save_status_label = tk.Label(root, text="")
save_status_label.pack(pady=5)
# Start the Tkinter app
root.mainloop()
Folder Contents: Displays the contents of the current folder and binds the selection event to open the selected file.
Folder Management Buttons: Provides buttons to create, rename, and delete folders.
New HTML File Button: Creates a new HTML file.
Save All Button: Saves all fields together.
Save Status Label: Displays the status of the save operation.
Main Loop: Starts the Tkinter application.
Future Enhancements
Batch Processing: Add functionality to process multiple files and folders in bulk.
Custom Scripting: Allow custom scripts to automate the creation and management of HTML files and folder structures.
Synchronization: Enable synchronization between local and online versions of the folder structure and HTML files.
Menu System: Automatically generate a menu system based on the folder structure, allowing easy navigation between pages.
Integration with Arkhiver Online: Use content and instructions from Arkhiver Online to automatically create and manage HTML files and folder structures.
This comprehensive explanation covers the entire functionality of the Arkhivist application, detailing how each field and button operates and interacts with the HTML files and folder structure. The future enhancements outline the direction for further development, making Arkhivist a powerful tool for managing HTML content both online and offline.