Skip to content

[Feature Request]: include directive #1202

Open
@swallez

Description

@swallez

Prerequisites

  • I have searched existing issues to ensure this feature hasn't already been requested
  • I have tested using the latest version of docs-builder

What problem are you trying to solve?

This is a follow-up to #16. The include (or includeliteral) directive should allow extracting segments of a file, so that code snippets can be extracted from actual code file that are compiled and tested.

At a bare minimum, the start-after and end-before attributes should be implemented, so that we can use the same tagging system as with Asciidoc (which is also much more robust than line numbers).

The included files should also be able to live outside in the project's test source tree which is generally outside of the docs directory. The previous docs system allowed to configure a list of directories to sparse-checkout for that purpose.

In the meantime, for the Java client, I implemented a workaround with an include-code pseudo-directive that is implemented using a file preprocessor that will append the target source snippet below the pseudo-directive.

Proposed Solution

See above.

Examples and Research

No response

Alternative Solutions

No response

Additional Context

No response

How important is this feature to you?

Critical (even if we have a workaround)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions