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

Method headerCss

Lib/pagebot/contexts/htmlcontext/htmlbuilder.py:440–448  ·  view source on GitHub ↗

Add the CSS code to the header of the output page. >>> b = HtmlBuilder() >>> b.headerCss('NameOfCss') >>> 'Generated by PageBot' in ''.join(b._cssOut) True

(self, name)

Source from the content-addressed store, hash-verified

438 print('[HtmlBuilder.writeCss] Cannot write CSS file "%s"' % path)
439
440 def headerCss(self, name):
441 """Add the CSS code to the header of the output page.
442
443 >>> b = HtmlBuilder()
444 >>> b.headerCss('NameOfCss')
445 >>> 'Generated by PageBot' in ''.join(b._cssOut)
446 True
447 """
448 self.addCss(self.SECTION_CSS % ('CSS of "%s"\n\n\tGenerated by PageBot\n\tCreated %s' % (name, now())))
449
450 def resetCss(self):
451 """Export the CSS to reset specific default behavior of browsers."""

Callers 1

XXXbuild_scssMethod · 0.80

Calls 2

addCssMethod · 0.95
nowFunction · 0.90

Tested by

no test coverage detected