MCPcopy Create free account
hub / github.com/PageBot/PageBot / build_html

Method build_html

Lib/pagebot/elements/image.py:364–384  ·  view source on GitHub ↗
(self, view, path, **kwargs)

Source from the content-addressed store, hash-verified

362 e.prepare_html(view)
363
364 def build_html(self, view, path, **kwargs):
365 # Gets current context.
366 context = view.context
367 b = context.b
368
369 # Use self.cssClass if defined, otherwise self class. #id is ignored if None
370 b.div(cssClass=self.cssClass or self.__class__.__name__.lower(), cssId=self.cssId)
371
372 b.img(src=self.path, alt=self.alt)
373
374 # Allow CSS to address the captions separately.
375 b.div(cssClass='caption')
376
377 # Draw captions if there are any.
378 for e in self.elements:
379 e.build_html(view, path, **kwargs)
380 # .caption
381 b._div()
382
383 # self.cssClass or self.__class__.__name__
384 b._div()
385
386 def build_(self, view, origin=ORIGIN):
387 print('pbimage.build_flat')

Callers

nothing calls this directly

Calls 3

divMethod · 0.80
imgMethod · 0.80
_divMethod · 0.80

Tested by

no test coverage detected