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

Consider using markdown.extensions.nl2br #183

Open
robscott opened this issue Jan 10, 2025 · 1 comment
Open

Consider using markdown.extensions.nl2br #183

robscott opened this issue Jan 10, 2025 · 1 comment
Labels
kind/documentation Categorizes issue or PR as related to documentation.

Comments

@robscott
Copy link
Member

One of the common frustrations with mkdocs-material is how new lines are handled. Some examples:

Will not be rendered as a list:

Paragraph text
* List
* Item

Will be rendered as a list:

Paragraph text

* List
* Item

This is a particular pain point in #129 where we're adding generated API reference docs using https://github.com/elastic/crd-ref-docs that are running into this problem. This has also been a recurring pain point in Gateway API documentation, with far too many lists missing the correct line breaks and therefore not being rendered correctly.

If we were to enable the markdown.extensions.nl2br extension, the above problems would go away, but in their place we'd get a different one. It's common to add line breaks in markdown to break up paragraphs for simpler code review and editing, for example, wrapping at 80 chars. If we do this, it creates a strange effect:

Before extension:
Screenshot 2025-01-09 at 9 29 56 PM

After extension:
Screenshot 2025-01-09 at 9 29 46 PM

Markdown source:

Gateway API Inference Extension is an official Kubernetes project focused on
extending [Gateway API](https://gateway-api.sigs.k8s.io/) with inference
specific routing extensions.

The overall resource model focuses on 2 new inference-focused
[personas](/concepts/roles-and-personas) and corresponding resources that
they are expected to manage:
@robscott
Copy link
Member Author

/kind documentation

@k8s-ci-robot k8s-ci-robot added the kind/documentation Categorizes issue or PR as related to documentation. label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation.
Projects
None yet
Development

No branches or pull requests

2 participants