function book_node_export

Generates printer-friendly HTML for a node.

Parameters

\Drupal\Core\Entity\EntityInterface $node: The node that will be output.

$children: (optional) All the rendered child nodes within the current node. Defaults to an empty string.

Return value

The HTML generated for the given node.

See also

book_export_traverse()

1 call to book_node_export()
book_export_traverse in drupal/core/modules/book/book.module
Traverses the book tree to build printable or exportable output.
1 string reference to 'book_node_export'
book_export_html in drupal/core/modules/book/book.pages.inc
Generates HTML for export when invoked by book_export().

File

drupal/core/modules/book/book.module, line 1188
Allows users to create and organize related content in an outline.

Code

function book_node_export(EntityInterface $node, $children = '') {
  $build = node_view($node, 'print');
  unset($build['#theme']);

  // @todo Rendering should happen in the template using render().
  $node->rendered = drupal_render($build);
  $book_node_export_html = array(
    '#theme' => 'book_node_export_html',
    '#node' => $node,
    '#children' => $children,
  );
  return drupal_render($book_node_export_html);
}