symfony-tools/docs-builder

Add support for placeholders in includes?

javiereguiluz opened this issue · 3 comments

In Symfony Docs we use includes with placeholders.

E.g. this file -> https://raw.githubusercontent.com/symfony/symfony-docs/5.x/reference/forms/types/choice.rst includes things like this:

compound
~~~~~~~~

**type**: ``boolean`` **default**: same value as ``expanded`` option

This option specifies if a form is compound. The value is by default
overridden by the value of the ``expanded`` option.

.. include:: /reference/forms/types/options/empty_data.rst.inc
    :end-before: DEFAULT_PLACEHOLDER

The included file is this one: https://github.com/symfony/symfony-docs/blob/5.x/reference/forms/types/options/empty_data.rst.inc which includes the DEFAULT_PLACEHOLDER string.

However, the new builder doesn't support it and it's displayed like this:

image

Should we support this feature in this builder?

stof commented

I would say that the missing thing is support for the :end-before: setting of the include directive. DEFAULT_PLACEHOLDER does not look like a sphinx feature. It is the value that our doc uses when using the :end-before: feature.

stof commented

Also, the include directive is implemented in the upstream rst-parser (and is not an actual directive)

This is not easy to implement at all ... and we used it just in a couple of doc pages, so let's close as "won't fix". Thanks.