I have a node type called "competition". I can get a form for it like so:
$values = array('type' => 'competition');
$node = \Drupal::entityTypeManager()
->getStorage('node')
->create($values);
$form = \Drupal::entityTypeManager()
->getFormObject('node', 'default')
->setEntity($node);
$form = \Drupal::formBuilder()->getForm($form);
In a controller it's easy enough to return $form and it will be rendered. But I want to do other things with this form so I need it back as HTML. How can I turn $form into fully rendered html?