'Write all the HTML markup in oeb into a single in memory buffer
containing a single html document with links replaced by offsets into
the buffer.
:param oeb: OEBBook object that encapsulates the document to be
processed.
:param images: Mapping of image hrefs (urlnormalized) to image record
indices.
:param write_page_breaks_after_item: If True a MOBIpocket pagebreak tag
is written after every element of the spine in ``oeb``.'

def __init__(self, oeb, images, is_periodical, write_page_breaks_after_item=True):

    self.oeb = oeb
    self.images = images
    self.used_images = set()
    self.logger = oeb.logger
    self.is_periodical = is_periodical
    self.write_page_breaks_after_item = write_page_breaks_after_item
    self.start_offset = None
    self.id_offsets = {}
    self.href_offsets = defaultdict(list)
    self.breaks = []
    self.find_blocks()
