help-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ANN] htagsfix (was: Can htags create permanent addresses?)


From: Mooffie
Subject: [ANN] htagsfix (was: Can htags create permanent addresses?)
Date: Tue, 1 Dec 2015 13:18:58 +0200

On 11/10/15, Shigio YAMAGUCHI <address@hidden> wrote:
> Mooffie wrote:
>> Let's say I have some file, "somefile.c", in my project.
>>
>> htags, at some point, creates the following HTML file for it:
>>
>>   HTML/S/793.html
>>
>> But then I modify the project and the file name changes to:
>>
>>   HTML/S/849.html
>
> [...]
>
> How about using incremental updating?
>
> (after updating project)
> $ gtags -i      # incremental updating
> $ htags
>
> In this case, existing file names are not changed.

Thanks for the answer. That solution is fine for my local computer,
but it's not adequate for my intended use. I want to publish the HTML,
for a popular open-source project, on the web. Your solution ("-i")
has several problems:

(1) I won't always be the one responsible for generating the HTML. I
don't want to force everybody to maintain a dedicated set of GTAGS
files (which will also *have* to be separate from the GTAGS files
they'll be using on they own computers (because they'll be modifying
the code)).

(2) "Opaque" URLs aren't nice. The URLs will be tossed around on
mailing lists and seeing ".../S/526.html" or ".../Y/23.html" wastes
time because people have to click to see what's it all about. I prefer
".../S/tty.c.html" and ".../Y/va_start.html".

To cut a long story short:

I cobbled up a little script to "fix" htags' output:

    https://gist.github.com/mooffie/7aa12b593e84f729ff07

(The word "fix" comes from "fixate"; to "pin down" [the filenames]. I
didn't at all mean to say that htags is broken.)

At first I tried to add this feature directly to htags (the C code)
but I concluded that the user may want customizability in determining
the filenames, so I went for a dirty scripting solution.

You can see the result here:

http://www.typo.co.il/~mooffie/mc-lua/source/S/src--main.c.html#L240
http://www.typo.co.il/~mooffie/mc-lua/source/R/mc_propagate_error.html

Things to notice:

- Directory slashes are turned to "--" (I tried to keep them but this
involved more work; maybe in the future).

- htagsfix also adds CSS that makes the target line highlighted (I
suggested a similar CSS recipe before[1] but it was for an older
version of htags).

[1] https://lists.gnu.org/archive/html/bug-global/2013-10/msg00002.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]