[TxMt] Re: How to use "Find in Project" functionality in a command (help appreciated)

Jacob Rus jrus at hcs.harvard.edu
Tue Nov 7 15:47:10 UTC 2006


Bert Fitié wrote:
> Interesting idea, Jacob, I will look into it.
> 
> I see a disadvantage with this solution. It will load the relevant file, 
> but unless the article I'm linking to is the first (or only) one in the 
> file and is at the top, I have to find it further down. My method (still 
> manually, though) brings me direct to the "tagid=<tagid>" line which is 
> the start of the article. Attaching line info to the URL is no option 
> since it changes too often and is not maintainable.

I don't actually understand what you mean here... If you hop onto IRC, 
we can more easily discuss this.

Your method gives a "tagid" to each file.  I think we can do the same 
thing here, by making the reference name «refname» (as in [link 
text][«refname»]) essentially the tagID that you are using currently. 
The only difference is that a) this link will render correctly in the 
html, and 2) It's legal markdown syntax, as opposed to your system, 
which is a (rather arbitrary) extension.

So to summarize, you link all the documents using the reference names 
that you want to use as tag IDs, and then if you want, you can change 
where those references point to, and easily update those pointers at the 
bottom of every file, and voila, your problem is solved :).  The only 
tricky bit then is figuring out how to get all the links at the bottom 
of each page to be updated.  I think this will be easy enough to make in 
a simple little script.  So what you end up with is one document which 
includes all of your link definitions, which match reference IDs up with 
file locations, and you include that document in every other document.

-Jacob




More information about the textmate mailing list