Skip to content

Add include attribute for code fences #2797

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

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

cestef
Copy link

@cestef cestef commented Feb 12, 2025

IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.

https://zola.discourse.group/t/include-and-copy-attributes-for-code-fences/

The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.

Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

This PR adds support for two fence settings:

```include=

  • Allows including a local file as the content of this codeblock, useful for large files

```copy

  • Adds a data-copy attribute to the code-block, useful if you want to add copy buttons only to some blocks.

@cestef cestef force-pushed the feature/include-code branch from e0f335e to 0c9cba8 Compare February 12, 2025 15:44
@Keats
Copy link
Collaborator

Keats commented Feb 15, 2025

Can you cherry pick the commits on the new next branch?

@cestef cestef force-pushed the feature/include-code branch from 9b47fc9 to cd8b417 Compare February 15, 2025 22:31
@cestef
Copy link
Author

cestef commented Feb 15, 2025

@Keats this should do it

@cestef cestef marked this pull request as ready for review February 15, 2025 22:41
Copy link
Collaborator

@Keats Keats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you split the include and copy feature in different PRs? The copy one is easy but the include is a bit more involved (error handling, maybe caching etc)

@cestef cestef force-pushed the feature/include-code branch from cd8b417 to 6fa00c8 Compare February 18, 2025 10:47
@cestef cestef mentioned this pull request Feb 18, 2025
3 tasks
@cestef cestef changed the title Add include and copy attributes for code fences Add include attribute for code fences Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants