Conditional text, preprocessors and generating document variants

I am new to Obsidian and one of the use cases I have in mind is helping to manage and generate basic PDF legal documents, where maybe 80% of the document is common and 20% varies based on simple conditionals. For example, I have a base document Foo which has customized variants for the US, UK, and Canada. Maintaining separate documents in something like Word is a pain as the documents go through changes, since the same set of changes must be made in each variant (back in the day I would use Framemaker, but I’m dating myself).

Any suggestions are appreciated. Perhaps Obsidian is not the right tool for this use case, and that of course is fine. I would love to find a markdown-centric solution to this problem.

What I’m trying to do

I think you could have the common parts in some note, and embed it in the country-specific ones. Depending how you style the embeds, in your PDF it wouldn’t be noticeable that they come from different sources.

More info: Embed files - Obsidian Publish

Thanks for the idea, I’ll play around with it. I was thinking about it from the opposite side (having one document which can emit the different country specific views, but I’ll play with this idea.