|
I have a small amount of code set within <div> tags that I want to replace with different code. A simple find and replace across all files within a given folder. The block of code is about 15 lines. Does this tell you enough? A simple of doing this is to follow the four steps below. Step 1 and 2 are preparatory activies, and step 3 and 4 are the steps you should repeat you have changed your piece of code. Step 1.At first you have to prepare a small text file which contains the piece of code you want to have inserted into the other files. It is also in this small text file that you will edit the piece of code whenever it needs to change. For the sake of this tutorial, let us assume that you name the file "mycode.txt" and place in the same folder as the other files you want to have updated by includeHTML Step 2.Now you must prepare the other files by using a text editor and inserting an includehtml tag where the piece of code should be inserted. The tag should look like this: <!--ih:includehtml file="mycode.txt"--><!--/ih:includehtml--> If you want to test that the tag is correct and you are editing the file in HTML-Kit, you can invoke includeHTML on the open file. You do this with the menu item Actions | includeHTML | Do-It-All insert You should now see that the piece of code has been inserted into your file Step 3.I assume that you do not want to open each file and invoke includeHTML per file everytime you modify the piece of code, but fortunately, the stand-alone version of includeHTML enables you to process several files in a single run. There are more ways of doing this, but here I will show you a simple way by using the "Recurse folders" tool. Invoke includeHTML (per default it has a shortcut in Start | Programs | includeHTML) and select the menu item File | Select recursively... This launches a new window titled "includeHTML Recurse folders", where you enter the following information:
A small tip: If you press the "Store" button, the values you enter will be remembered by includeHTML so you will not have to enter them again the next time you want to use "Recurse folders" Press the "Search" button. When you do this, the "Recurse folder" window is closed, and a new window titled "includeHTML File list" opens and the file list in the left part of the window is populated with the files matching your search pattern. Step 4.In the File list window, press the "Run" button (shortcut key Alt+R) at the top of the right part of the window. Voila, includeHTML updates all of the files with check marks in the filelist. |
Copyright © Jesper Rosenlund Nielsen