Boost logo

Boost :

Subject: Re: [boost] [review][autoindex] AutoIndex review extended
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-05-15 05:43:51


>> Not at present no.... I'm not really sure how one would even do that,
>> there would have to be some kind of docbook XML container that was used
>> to represent "don't index this block". Can you provide an example of a
>> spurious entry? It could be that tweaking the scanning regular
>> expressions used could fix this.
>
>
> I understand. After more thought, maybe it is not so bad that the samples
> are indexed. Because the indexed terms are really shown there in their
> context.
>
> There were some spurious index terms as "p", "r", "for", probably because
> of the samples, and they could be turned off as documented.
>
> Then there are spurious terms as "point_type" because in the example I
> often typedef a point a "point_type", but that term also exists as a
> regular, indexable, entry. They have either to be turned off manually, or
> turned on in specific sections, or I've to rename them to e.g. ptype in
> the examples (which might actually be better).

Hmmm, the trouble is, assuming it's searching for something along the lines
of

typedef something point_type;

Then that will occur both where you want it to be indexed (class
definitions) and where you don't (example code).

So that leaves you with two options - either a section constraint (see my
comments below), or exclude that term altogether and add a manual index
entry for it by escaping to XML and adding the necessary <indexterm>'s. I
accept that's a touch hardcore though!

> But turning them off for specific sections does not work for me, probably
> I do something wrong. I define:
>
> point_type "" "(?!geometry.reference.adapted.register.*).*"
>
> to omit it from all sections starting with reference.adapted.register, but
> the point_type still appears there. I copied and pasted it from the doc. I
> added !debug regular-expression , I don't see anything in the log. I'm
> not a regex-expert and don't see what is wrong here.

Nor do I, the debug info in the other mail suggests it should not be
indexed, so I can't see what's wrong.... can you let me have your
index-script file so I can try it here?

> Another question about this: is it possible to exclude a term twice? So
> e.g.
>
> point_type "" "(?!geometry.reference.adapted.register.*).*"
> point_type "" "(?!geometry.reference.exclude_also_from_this.*).*"

Ah, you can do that, but it takes the union (logical or) of the two regexes,
and that's not what you want here, which is more akin to a logical and.

> Or do I have to write a more complex regex for this?

Nod, something like:

"(?!geometry.reference.adapted.register.*|geometry.reference.exclude_also_from_this.*).*"

I guess I should make this clearer in the docs...

HTH, John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk