David Goodger writes:
> That's because they (parse-time system messages) are already in place in
> the document.
Ah, that makes sense. I'm not sure I like it, but...
> > This feels a little weird.
>
> How so?
Mostly because there's little difference in the two for an end-user,
but they're treated differently in a way that's confusing on the
surface.
> > I'd like to propose that both parse- and transformation-time messages
> > are included in the "Docutils System Messages" section. If there are
> > no objections, I can make the change.
>
> I like having the system message immediately adjacent to the problem
> whenever possible. I could live with all system messages living at the
> end of the document, but I have the feeling we may be losing something.
Another possibility would be to include a marker when the parse error
is encountered, and the linking to/from a system message at the end.
I'm not sure how to make that change yet, so it would require a bit
more time for me.
> I'd like to hear what others think before proceeding.
Yes; I would as well.
> > I'll also note that there are (at least) a couple of ways to make the
> > change: Messages.apply() could handle both lists of system messages,
> > or the two lists could be collapsed to a single list in the
> > docutils.nodes.document class.
> >
> > The later option has the additional benefit of simplifying the
> > implementation. ;-)
>
> The advantage of the current way of doing things is that parse-time
> system messages don't require a transform; they're already in the
> document. This is valuable for testing (unit tests,
> tools/quicktest.py). So if we do decide to make a change, I think the
> insertion of parse-time system messages ought to remain as-is and the
> Messages transform ought to move all parse-time system messages (remove
> from their originally inserted positions, insert in System Messages
> section).
That's a very reasonable approach; hopefully it's not too difficult to
identify them at that stage. It may be that there's some re-ordering
to be done so the messages appear in the order of the relevant section
of the source text, but I don't know if there's enough information to
do that.
-Fred
--
Fred L. Drake, Jr. <fdrake at acm.org>
PythonLabs at Zope Corporation
|