Hi tkeo,
Quote:
Originally Posted by tkeo
Hi Kevin,
I have books in which idrefs have meaningful names, for example: p-cover, p-titlepage, p-caution, p-copyright.
Indeed they do not improve functionality, but is it not enough for reason to keep them?
Thanks,
|
I found a public wifi site and saw your post.
They need not be meaningful and most are not. That said, as a compromise, how about the following:
1. since their idrefs must be unique for them simply add a very short prefix to theirs such as "x_" or some other short prefix (this is guaranteed to keep theirs unique). This will also guarantee that their idrefs do not overlap with our itemXXXXX idrefs.
2. Remove all of the "set" code and unique id code and simply replace it all with something similar to the following pseudo code.
Code:
idref_to_use = "item%05s" % refnum
if their_old_idref[refnum]:
idref_to_use = "x_" + their_old_idref[refnum]
Or something similar to that in meaning.
This guarantees uniqueness, allows you to see the meaningful names but is so simple no block of uniqueness code is needed making the code as simple as possible.
How does that sound?
KevinH