Open
Description
It would be nice, especially when using loaded documents, to be able to manipulate a document in some manner beyond appending elements to their parent element. Two possibilities that leap to mind:
- Add an
index
kwarg to the variousadd
methods so that they can be used in lieu ofinsert
. Possibly include adelete
method as well. - Subclass the
paragraphs
andruns
properties of theDocument
andParagraph
classes, respectively. Overwrite the various list methods to appropriately modify the underlying Etree elements. For instance,d.paragraphs[3] = "Hello world"
would replace the 4th paragraph with a new hello world paragraph. This could be powerful and flexible, but it also feels hackish. I'm not really sure.
Thoughts?