Search code examples
aglio

Input parameters when generating HTML file?


I'm currently working with aglio to generate API specs for a few different service groups. The issue I'm facing now is that I want to deploy the spec to multiple environments (for different consumer groups), so the displayed base URLs need to be different.

Is there any way to either send in a base URL for each HTML file generation?


Solution

  • You could make use of the include feature <!-- include(OtherFile.md) -->.

    In my case, I use a number of files:

    • one toplevel file (e.g. V1.md), containing the Metadata and an overall introduction to the API
    • one file per resource (e.g. AuthResource.md, UserResource.md), where I document only the functionality of that resource

    The top-level file has an include-statement for each resource-file. In Aglio, I select only the top-level file.

    In your case, you might be able to use customer-specific or environment-specific files before the top-level file. Move the Metadata to the customer-specific files and have them include the top-level file. Then you can render each customer-specific file into HTML.