Skip to content

Minor refactoring: Extract YAML front-matter handling into its own module#642

Merged
mquinson merged 3 commits intomquinson:masterfrom
gemmaro:re/yaml-front-matter
Feb 27, 2026
Merged

Minor refactoring: Extract YAML front-matter handling into its own module#642
mquinson merged 3 commits intomquinson:masterfrom
gemmaro:re/yaml-front-matter

Conversation

@gemmaro
Copy link
Contributor

@gemmaro gemmaro commented Feb 23, 2026

This change extracts the YAML front-matter processing logic from the Text module (with markdown option) into a dedicated module.
This separation makes it easier to introduce a CommonMark format module (as proposed in #639).

TODOs

TODOs before removing draft mark:

  • Add minimal POD documentation for the new module
  • Improve option passing from $self->{options}{yfm_...} to keyword arguments

@mquinson
Copy link
Owner

Excellent. This is something I wanted to do but never found the time to. Thanks in advance for that!

* lib/Locale/Po4a/Text.pm (parse_markdown_yaml_front_matter):
Move YAML front matter subroutine to the dedicated module.
* lib/Locale/Po4a/YamlFrontMatter.pm: Add module with POD document.
[parse_yaml_front_matter]: Removed the unnecessary line argument.
Renamed to Markdown agnostic one.
@gemmaro gemmaro force-pushed the re/yaml-front-matter branch from b5c06e7 to 358ae56 Compare February 26, 2026 23:08
@gemmaro gemmaro marked this pull request as ready for review February 26, 2026 23:14
@mquinson mquinson merged commit e867d6f into mquinson:master Feb 27, 2026
1 check passed
@mquinson
Copy link
Owner

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants