foliant-docs / foliant

Comprehensive markdown-based documentation toolkit
https://foliant-docs.github.io/docs/
MIT License
158 stars 9 forks source link

Extension Proposal: Multiproject: Build from multiple Foliant projects #34

Closed moigagoo closed 3 years ago

moigagoo commented 6 years ago

I'm proposing the addition of !from YAML tag to foliant.yml which lets you point to a repository with a Foliant project. As a related addition to the core, a special pre target is proposed. Building pre applies the preprocessors and doesn't apply any backend, producing a valid Foliant project with preprocessing required.

The !from tag is processed in the following way:

  1. The repository is cloned into a preconfigured temporary directory.
  2. chapters section from foliant.yml file from the cloned repository replaces the !from invocationinfoliant.yml#chapters`. All chapter paths are prepended with the temporary directory path.
  3. The Foliant project from the cloned repository is built using a special pre target.

A typical config that uses !from tag:

chapters:
  - !from https://github.com/foo/bar.git
  - index.md
moigagoo commented 6 years ago

The !from tag should be implemented as an extension.

The pre target can be implemented as part of the same extension. but it seems that it might be useful in other contexts as well, so I propose we add it to the core

Vanderhoof commented 3 years ago

Done: https://github.com/foliant-docs/foliantcontrib.multiproject