Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
muffinresearch opened this issue Jul 21, 2020 · 1 comment
Labels
11ty-migration blocks-l10n These issues block localizing the site enhancement New feature or request

Comments

@muffinresearch
Copy link
Contributor

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.

@muffinresearch muffinresearch added 11ty-migration enhancement New feature or request blocks-l10n These issues block localizing the site labels Jul 21, 2020
@muffinresearch
Copy link
Contributor Author

A plugin prototype is here: https://github.com/mozilla/markdown-it-heading-wrapper/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11ty-migration blocks-l10n These issues block localizing the site enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant