WeasyPrint の API リファレンス
WeasyPrint (Kozea/WeasyPrint) の公開 API 201 件 —— クラス 60、関数 108、メソッド 33。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。
リポジトリ: Kozea/WeasyPrint
| 種別 | 件数 |
|---|---|
| クラス | 60 |
| 関数 | 108 |
| メソッド | 33 |
API 一覧
class
weasyprint.AttachmentFile attachment for a PDF document.
class
weasyprint.CSSCSS stylesheet parsed by tinycss2.
class
weasyprint.HTMLHTML document parsed by tinyhtml5.
class
weasyprint.css.AnonymousStyleComputed style used for anonymous boxes.
class
weasyprint.css.ComputedStyleComputed style used for non-anonymous boxes.
class
weasyprint.css.InitialStyleDummy computed style used to store initial values.
class
weasyprint.css.StyleAbstract class for all style dictionaries.
class
weasyprint.css.StyleForConvenience function to get the computed styles for an element.
func
weasyprint.css.computed_values.compute_float(style, name, value)Compute the ``float`` property.
func
weasyprint.css.computed_values.content(style, name, values)Compute the ``content`` property.
func
weasyprint.css.computed_values.display(style, name, value)Compute the ``display`` property.
func
weasyprint.css.computed_values.gap(style, name, value)Compute the ``*-gap`` properties.
func
weasyprint.css.computed_values.lang(style, name, values)Compute the ``lang`` property.
func
weasyprint.css.computed_values.length(style, name, value, font_size=None, pixels_only=False)Compute a length ``value``.
func
weasyprint.css.computed_values.link(style, name, values)Compute the ``link`` property.
func
weasyprint.css.computed_values.tab_size(style, name, value)Compute the ``tab-size`` property.
func
weasyprint.css.computed_values.transform(style, name, value)Compute the ``transform`` property.
class
weasyprint.css.counters.CounterStyleCounter styles dictionary.
func
weasyprint.css.counters.symbol(string_or_url)Create a string from a symbol.
class
weasyprint.css.functions.FunctionCSS function.
method
weasyprint.css.functions.Function.split_comma(single_tokens=True, trailing=False)Split arguments on commas.
method
weasyprint.css.functions.Function.split_space()Split arguments on spaces.
func
weasyprint.css.parse_page_selectors(rule)Parse a page selector rule.
func
weasyprint.css.resolve_math(token, computed=None, property_name=None, refer_to=None)Return token with resolved math functions.
class
weasyprint.css.targets.CounterLookupItemItem controlling page based counters.
class
weasyprint.css.tokens.InvalidValuesInvalid or unsupported values for a known CSS property.
class
weasyprint.css.tokens.PercentageInMathPercentage in math function without reference length.
func
weasyprint.css.tokens.get_angle(token)Parse an <angle> token in radians.
func
weasyprint.css.tokens.get_content_list(tokens, base_url)Parse <content-list> tokens.
func
weasyprint.css.tokens.get_image(token, base_url)Parse an <image> token.
func
weasyprint.css.tokens.get_keyword(token)If ``token`` is a keyword, return its lowercase name.
func
weasyprint.css.tokens.get_length(token, negative=True, percentage=False)Parse a <length> token.
func
weasyprint.css.tokens.get_number(token, negative=True, integer=False)Parse a <number> token.
func
weasyprint.css.tokens.get_percentage(token, negative=True)Parse a <percentage> token.
func
weasyprint.css.tokens.get_quote(token)Parse a <quote> token.
func
weasyprint.css.tokens.get_resolution(token)Parse a <resolution> token in dppx.
func
weasyprint.css.tokens.get_string(token)Parse a <string> token.
func
weasyprint.css.tokens.get_target(token, base_url)Parse a <target> token.
func
weasyprint.css.tokens.get_url(token, base_url)Parse an <url> token.
func
weasyprint.css.validation.descriptors.pad(tokens, base_url)``pad`` descriptor validation.
func
weasyprint.css.validation.descriptors.range(tokens)``range`` descriptor validation.
func
weasyprint.css.validation.descriptors.src(tokens, base_url)``src`` descriptor validation.
func
weasyprint.css.validation.descriptors.system(tokens)``system`` descriptor validation.
func
weasyprint.css.validation.expanders.expand_flex(tokens, name)Expand the ``flex`` property.
func
weasyprint.css.validation.expanders.expand_gap(tokens, name)Expand the ``gap`` property.
func
weasyprint.css.validation.expanders.expand_grid(tokens, name)Expand the ``grid`` property.
func
weasyprint.css.validation.expanders.generic_expander_wrapper(tokens, name, base_url)Wrap the expander.
func
weasyprint.css.validation.properties.anchor(token)Validation for ``anchor``.
func
weasyprint.css.validation.properties.bleed(token)``bleed`` property validation.
func
weasyprint.css.validation.properties.box_shadow(tokens)`box-shadow` property validation.
func
weasyprint.css.validation.properties.clear(keyword)``clear`` property validation.
func
weasyprint.css.validation.properties.clip(token)Validation for the ``clip`` property.
func
weasyprint.css.validation.properties.content(tokens, base_url)``content`` property validation.
func
weasyprint.css.validation.properties.continue_(keyword)``continue`` property validation.
func
weasyprint.css.validation.properties.direction(keyword)``direction`` property validation.
func
weasyprint.css.validation.properties.display(tokens)``display`` property validation.
func
weasyprint.css.validation.properties.flex_basis(token)``flex-basis`` property validation.
func
weasyprint.css.validation.properties.flex_wrap(keyword)``flex-wrap`` property validation.
func
weasyprint.css.validation.properties.float_(keyword)``float`` property validation.
func
weasyprint.css.validation.properties.font_size(token)``font-size`` property validation.
func
weasyprint.css.validation.properties.hyphens(token)Validation for ``hyphens``.
func
weasyprint.css.validation.properties.lang(token)Validation for ``lang``.
func
weasyprint.css.validation.properties.link(token, base_url)Validation for ``link``.
func
weasyprint.css.validation.properties.marks(tokens)``marks`` property validation.
func
weasyprint.css.validation.properties.page(token)``page`` property validation.
func
weasyprint.css.validation.properties.position(token)``position`` property validation.
func
weasyprint.css.validation.properties.quotes(tokens)``quotes`` property validation.
func
weasyprint.css.validation.properties.size(tokens)``size`` property validation.
func
weasyprint.css.validation.properties.string_set(tokens, base_url)Validation for ``string-set``.
func
weasyprint.css.validation.properties.tab_size(token)Validation for ``tab-size``.
func
weasyprint.css.validation.properties.transform(tokens)Validation for ``transform``.
class
weasyprint.document.DiskCacheDict-like storing images content on disk.
class
weasyprint.document.DocumentA rendered document ready to be painted in a pydyf stream.
method
weasyprint.document.Document.copy(pages='all')Take a subset of the pages.
class
weasyprint.document.PageRepresents a single rendered page.
method
weasyprint.document.Page.paint(stream, scale=1)Paint the page into the PDF file.
func
weasyprint.draw.color.darken(color)Return a darker color.
func
weasyprint.draw.color.lighten(color)Return a lighter color.
func
weasyprint.draw.draw_box_shadows(stream, boxes, style, inset)Draw box shadows.
func
weasyprint.draw.draw_page(page, stream)Draw the given PageBox.
func
weasyprint.draw.text.draw_emojis(stream, style, x, y, emojis)Draw list of emojis.
class
weasyprint.formatting_structure.boxes.AtomicInlineLevelBoxAn atomic box in an inline formatting context.
class
weasyprint.formatting_structure.boxes.BlockBoxA block-level box that is also a block container.
class
weasyprint.formatting_structure.boxes.BlockLevelBoxA box that participates in an block formatting context.
class
weasyprint.formatting_structure.boxes.BlockReplacedBoxA box that is both replaced and block-level.
class
weasyprint.formatting_structure.boxes.BoxAbstract base class for all boxes.
method
weasyprint.formatting_structure.boxes.Box.border_height()Height of the border box.
method
weasyprint.formatting_structure.boxes.Box.border_width()Width of the border box.
method
weasyprint.formatting_structure.boxes.Box.copy()Return shallow copy of the box.
method
weasyprint.formatting_structure.boxes.Box.is_floated()Return whether this box is floated.
method
weasyprint.formatting_structure.boxes.Box.margin_height()Height of the margin box (aka.
method
weasyprint.formatting_structure.boxes.Box.margin_width()Width of the margin box (aka.
method
weasyprint.formatting_structure.boxes.Box.padding_height()Height of the padding box.
method
weasyprint.formatting_structure.boxes.Box.padding_width()Width of the padding box.
method
weasyprint.formatting_structure.boxes.Box.page_values()Return start and end page values.
method
weasyprint.formatting_structure.boxes.Box.translate(dx=0, dy=0, ignore_floats=False)Change the box’s position.
class
weasyprint.formatting_structure.boxes.FlexBoxA box that is both block-level and a flex container.
class
weasyprint.formatting_structure.boxes.FlexContainerBoxA box that contains only flex-items.
class
weasyprint.formatting_structure.boxes.FootnoteAreaBoxBox displaying footnotes, as defined in GCPM.
class
weasyprint.formatting_structure.boxes.GridBoxA box that is both block-level and a grid container.
class
weasyprint.formatting_structure.boxes.GridContainerBoxA box that contains only grid-items.
class
weasyprint.formatting_structure.boxes.InlineBlockBoxA box that is both inline-level and a block container.
class
weasyprint.formatting_structure.boxes.InlineBoxAn inline box with inline children.
class
weasyprint.formatting_structure.boxes.InlineFlexBoxA box that is both inline-level and a flex container.
class
weasyprint.formatting_structure.boxes.InlineGridBoxA box that is both inline-level and a grid container.
class
weasyprint.formatting_structure.boxes.InlineLevelBoxA box that participates in an inline formatting context.
class
weasyprint.formatting_structure.boxes.InlineReplacedBoxA box that is both replaced and inline-level.
class
weasyprint.formatting_structure.boxes.InlineTableBoxBox for elements with ``display: inline-table``
class
weasyprint.formatting_structure.boxes.MarginBoxBox in page margins, as defined in CSS3 Paged Media
class
weasyprint.formatting_structure.boxes.PageBoxBox for a page.
class
weasyprint.formatting_structure.boxes.ParentBoxA box that has children.
class
weasyprint.formatting_structure.boxes.ReplacedBoxA box whose content is replaced.
class
weasyprint.formatting_structure.boxes.TableBoxBox for elements with ``display: table``
class
weasyprint.formatting_structure.boxes.TableCaptionBoxBox for elements with ``display: table-caption``
class
weasyprint.formatting_structure.boxes.TableCellBoxBox for elements with ``display: table-cell``
class
weasyprint.formatting_structure.boxes.TableColumnBoxBox for elements with ``display: table-column``
class
weasyprint.formatting_structure.boxes.TableRowBoxBox for elements with ``display: table-row``
class
weasyprint.formatting_structure.boxes.TableRowGroupBoxBox for elements with ``display: table-row-group``
class
weasyprint.formatting_structure.boxes.TextBoxA box that contains only text and has no box children.
func
weasyprint.html.handle_col(element, box, _get_image_from_uri, _base_url)Handle the ``span`` attribute.
func
weasyprint.html.handle_colgroup(element, box, _get_image_from_uri, _base_url)Handle the ``span`` attribute.
func
weasyprint.html.handle_img(element, box, get_image_from_uri, base_url)Handle ``<img>`` elements.
func
weasyprint.html.handle_svg(element, box, get_image_from_uri, base_url)Handle ``<svg>`` elements.
func
weasyprint.html.make_replaced_box(element, box, image)Wrap an image in a replaced box.
func
weasyprint.html.parse_string(string)Parse a URL from an HTML attribute value.
func
weasyprint.html.parse_url(string)Parse a URL from an HTML attribute value.
func
weasyprint.html.parse_w3c_date(meta_name, string)Parse datetimes as defined by the W3C.
class
weasyprint.images.ImageLoadingErrorAn error occured when loading an image.
class
weasyprint.layout.FakeListList in which you can’t append objects.
func
weasyprint.layout.block.block_level_width(box, containing_block, with_min_max=True)Set the ``box`` width.
class
weasyprint.layout.flex.FlexLineFlex container line.
func
weasyprint.layout.initialize_page_maker(context, root_box)Initialize ``context.page_maker``.
func
weasyprint.layout.layout_document(html, root_box, context, max_loops=8)Lay out the whole document.
func
weasyprint.layout.table.add_top_padding(box, extra_padding)Increase the top padding of a box.
func
weasyprint.pdf.anchors.add_annotations(links, matrix, document, pdf, page, annot_files, compress)Include annotations in PDF.
func
weasyprint.pdf.anchors.add_forms(forms, matrix, pdf, page, resources, stream, font_map)Include form inputs in PDF.
func
weasyprint.pdf.anchors.add_outlines(pdf, bookmarks, parent=None)Include bookmark outlines in PDF.
func
weasyprint.pdf.anchors.resolve_links(pages)Resolve internal hyperlinks.
func
weasyprint.pdf.debug.debug(pdf, metadata, document, page_streams, attachments, compress)Set debug PDF metadata.
method
weasyprint.pdf.fonts.Font.clean(to_unicode, hinting)Remove useless data from font.
class
weasyprint.pdf.metadata.DocumentMetadataMeta-information belonging to a whole :class:`Document`.
class
weasyprint.pdf.stream.StreamPDF stream object with extra features.
func
weasyprint.pdf.tags.add_tags(pdf, document, pdf_version, page_streams)Add tag tree to the document.
class
weasyprint.svg.NodeAn SVG document node.
method
weasyprint.svg.Node.display()Whether node should be displayed.
method
weasyprint.svg.Node.flatten()Flatten text in node and in its children.
method
weasyprint.svg.Node.get(key, default=None)Get attribute.
method
weasyprint.svg.Node.get_viewbox()Get node viewBox as a tuple of floats.
method
weasyprint.svg.Node.override_iter(iterator)Override node’s children iterator.
method
weasyprint.svg.Node.pop_rotation(original_rotate, rotate)Merge nested letter rotations.
method
weasyprint.svg.Node.tag()XML tag name with no namespace.
method
weasyprint.svg.Node.tail()Text after the XML node.
method
weasyprint.svg.Node.text()XML node text.
method
weasyprint.svg.Node.visible()Whether node is visible.
class
weasyprint.svg.PatternSVG node applied as a pattern.
class
weasyprint.svg.SVGAn SVG document.
method
weasyprint.svg.SVG.draw(stream, concrete_width, concrete_height, base_url, context)Draw image on a stream.
method
weasyprint.svg.SVG.draw_markers(node, font_size, fill_stroke)Draw markers defined in a node.
method
weasyprint.svg.SVG.draw_node(node, font_size, fill_stroke=True, context=None)Draw a node.
method
weasyprint.svg.SVG.fill_stroke(fill, stroke, even_odd=False, text=False)Paint fill and stroke for a node.
method
weasyprint.svg.SVG.get_intrinsic_size(font_size)Get intrinsic size of the image.
method
weasyprint.svg.SVG.length(length, font_size)Compute size of an arbirtary attribute.
method
weasyprint.svg.SVG.point(x, y, font_size)Compute size of an x/y or width/height couple.
func
weasyprint.svg.bounding_box.bounding_box(svg, node, font_size, stroke)Bounding box for any node.
func
weasyprint.svg.bounding_box.bounding_box_circle(svg, node, font_size)Bounding box for circle node.
func
weasyprint.svg.bounding_box.bounding_box_ellipse(svg, node, font_size)Bounding box for ellipse node.
func
weasyprint.svg.bounding_box.bounding_box_g(svg, node, font_size)Bounding box for g node.
func
weasyprint.svg.bounding_box.bounding_box_line(svg, node, font_size)Bounding box for line node.
func
weasyprint.svg.bounding_box.bounding_box_path(svg, node, font_size)Bounding box for path node.
func
weasyprint.svg.bounding_box.bounding_box_polyline(svg, node, font_size)Bounding box for polyline node.
func
weasyprint.svg.bounding_box.bounding_box_rect(svg, node, font_size)Bounding box for rect node.
func
weasyprint.svg.bounding_box.bounding_box_text(svg, node, font_size)Bounding box for text node.
func
weasyprint.svg.bounding_box.bounding_box_use(svg, node, font_size)Bounding box for use node.
func
weasyprint.svg.defs.draw_gradient(svg, node, gradient, font_size, opacity, stroke)Draw given gradient node.
func
weasyprint.svg.defs.draw_pattern(svg, node, pattern, font_size, opacity, stroke)Draw given gradient node.
func
weasyprint.svg.defs.paint_mask(svg, node, mask, font_size)Apply given mask node.
func
weasyprint.svg.defs.spread_linear_gradient(spread, positions, colors, x1, y1, x2, y2, bounding_box, matrix)Repeat linear gradient.
func
weasyprint.svg.defs.spread_radial_gradient(spread, positions, colors, fx, fy, fr, cx, cy, r, width, height, matrix)Repeat radial gradient.
func
weasyprint.svg.defs.use(svg, node, font_size)Draw use tags.
func
weasyprint.svg.images.image(svg, node, font_size)Draw image tags.
func
weasyprint.svg.images.svg(svg, node, font_size)Draw svg tags.
func
weasyprint.svg.path.path(svg, node, font_size)Draw path node.
func
weasyprint.svg.shapes.circle(svg, node, font_size)Draw circle tag.
func
weasyprint.svg.shapes.ellipse(svg, node, font_size)Draw ellipse tag.
func
weasyprint.svg.shapes.line(svg, node, font_size)Draw line tag.
func
weasyprint.svg.shapes.polygon(svg, node, font_size)Draw polygon tag.
func
weasyprint.svg.shapes.polyline(svg, node, font_size)Draw polyline tag.
func
weasyprint.svg.shapes.rect(svg, node, font_size)Draw rect tag.
class
weasyprint.svg.text.StyleDummy class to store dict.
class
weasyprint.svg.text.TextBoxDummy text box used to draw text.
func
weasyprint.svg.text.text(svg, node, font_size)Draw text node.
class
weasyprint.svg.utils.PointErrorException raised when parsing a point fails.
func
weasyprint.text.ffi.unicode_to_char_p(string)Return ``(pointer, bytestring)``.
class
weasyprint.text.fonts.FontConfigurationA Fontconfig font configuration.
class
weasyprint.text.line_break.LayoutObject holding PangoLayout-related cdata pointers.
class
weasyprint.urls.URLFetcherFetcher of external resources such as images or stylesheets.
method
weasyprint.urls.URLFetcher.fetch(url, headers=None)Fetch a given URL.
class
weasyprint.urls.URLFetcherResponseThe HTTP response of an URL fetcher.
class
weasyprint.urls.URLFetchingErrorSome error happened when fetching an URL.
func
weasyprint.urls.get_link(url, base_url)Get the URL value of an element attribute.
func
weasyprint.urls.path2url(path)Return file URL of `path`.
この情報について
掲載しているシグネチャは Kozea/WeasyPrint の公開ソースコードを
Python の ast モジュールで静的解析し、引数名・デフォルト値・
型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。
詳しくは仕組みの解説をご覧ください。