Skip to content

Make section wrapping built-in and handled by the markdown renderer. #672

Open

Description

@muffinresearch

In the docs you need to write code like this:

<!-- Content with Table of Contents Module -->
{% capture content_with_toc %}
## title one

A bunch of markdown here...
{% endcapture %}

{% include modules/column-w-toc.liquid
	id: "getting-started"
	content: content_with_toc
%}

<!-- END: Content with Table of Contents -->

<!-- Single Column Body Module -->

{% capture content %}

## title two

A bunch of more markdown here...
{% endcapture %}

{% include modules/one-column.liquid
	id: "mozilla-developer-network"
	content: content
%}

<!-- END: Single Column Body Module -->

These templates are essentially just wrapping those heading levels in section elements (plus a bunch of other markup to control the grid)

It should be possible assuming this is a common convention to have a custom markdown plugin automatically handle this essentially wrapping everything under that current heading level with markup.

That would then mean the markup required for the doc would end-up being:

## title one

A bunch of markdown here...

## title two

A bunch of more markdown here...

The goal with this approach is to remove the need for the document author to worry about the implementation details and focus on just writing good markdown documentation.

Activity

  1. added
    enhancement
    blocks-l10n
    on Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    11ty-migrationblocks-l10nenhancement

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions