View Single Post
Old Yesterday, 05:39 AM   #157
repilo
Zealot
repilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmos
 
Posts: 102
Karma: 21870
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
Hi Kevin and the Sigil team,

First of all, I would like to apologize for my English. Since I am not fluent, I have asked Gemini to help me draft this request to ensure I can explain myself clearly.

I am writing to suggest a feature for the Find & Replace engine. Currently, if we want to insert the name of the current file (e.g., chapter01.xhtml) into a replacement string, we must use the Python Function mode in Saved Searches. While this works, it is quite complex for users who are not familiar with programming.

The Proposal:
Introduce a special placeholder or variable (such as \f, ${FILENAME}, or similar) in the Replace field. This variable would dynamically resolve to the name of the file currently being processed during a "Replace All" across "All HTML Files".

The Main Use Case: Massive Footnotes
This feature would be incredibly useful when dealing with epubs that have a massive amount of footnotes. Often, we need to prefix IDs or links with the filename to ensure they are unique across the entire book or to fix broken cross-references in large-scale projects. Manually editing hundreds of files to include the filename in the anchor tags is prone to error and extremely time-consuming.

Other Use Cases:
  • Automatically generating unique IDs based on the filename.
  • Batch-tagging content with source file metadata for internal organization.
  • Streamlining workflows that currently require custom Python scripts for simple string injection.

I believe this addition would make Sigil even more powerful for power-users and beginners alike, especially those of us working with complex academic or heavily annotated books.

Thank you for your time and for all the work you do on Sigil!

Best regards,
repilo
repilo is online now   Reply With Quote