llms_txt_renderer = $llms_txt_renderer; $this->intro_builder = $intro_builder; $this->title_builder = $title_builder; $this->description_builder = $description_builder; $this->link_lists_builder = $link_lists_builder; $this->markdown_escaper = $markdown_escaper; $this->optional_link_list_builder = $optional_link_list_builder; } /** * Renders the markdown. * * @return string The rendered markdown. */ public function render(): string { $this->llms_txt_renderer->add_section( $this->title_builder->build_title() ); $this->llms_txt_renderer->add_section( $this->description_builder->build_description() ); $this->llms_txt_renderer->add_section( $this->intro_builder->build_intro() ); foreach ( $this->link_lists_builder->build_link_lists() as $link_list ) { $this->llms_txt_renderer->add_section( $link_list ); } $this->llms_txt_renderer->add_section( $this->optional_link_list_builder->build_optional_link_list() ); foreach ( $this->llms_txt_renderer->get_sections() as $section ) { $section->escape_markdown( $this->markdown_escaper ); } return $this->llms_txt_renderer->render(); } }