Class: LlmDocsBuilder::Transformers::LinkTransformer
- Inherits:
-
Object
- Object
- LlmDocsBuilder::Transformers::LinkTransformer
- Includes:
- BaseTransformer
- Defined in:
- lib/llm_docs_builder/transformers/link_transformer.rb
Overview
Transformer for link-related operations
Handles expansion of relative links to absolute URLs and conversion of HTML URLs to markdown format.
Instance Method Summary collapse
-
#transform(content, options = {}) ⇒ String
Transform links in content.
Methods included from BaseTransformer
Instance Method Details
#transform(content, options = {}) ⇒ String
Transform links in content
21 22 23 24 25 26 27 28 29 |
# File 'lib/llm_docs_builder/transformers/link_transformer.rb', line 21 def transform(content, = {}) result = content.dup result = (result, [:base_url]) if [:base_url] result = convert_html_urls(result) if [:convert_urls] result = simplify_links(result) if [:simplify_links] result end |