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

Snippets: auto_prepend #2143

Open
nbanyan opened this issue Aug 17, 2023 · 5 comments
Open

Snippets: auto_prepend #2143

nbanyan opened this issue Aug 17, 2023 · 5 comments
Labels
P: maybe Pending approval of low priority request. T: feature Feature.

Comments

@nbanyan
Copy link

nbanyan commented Aug 17, 2023

Description

With glossaries, the current auto_append option does not let pages override abbreviation declarations because it is added to the end of the page.

Benefits

An option to automatically add the glossary at the beginning of the document would be more convenient for this use case.

Solution Idea

Add an auto_prepend option to mirror the current auto_append option.

@nbanyan nbanyan added the T: feature Feature. label Aug 17, 2023
@gir-bot gir-bot added the S: triage Issue needs triage. label Aug 17, 2023
@facelessuser facelessuser added the S: more-info-needed More information is required. label Aug 17, 2023
@facelessuser
Copy link
Owner

When you say "glossaries" what glossary feature are you using that requires prepend. Can you provide a clear, real-world example of how you implement glossaries?

@nbanyan
Copy link
Author

nbanyan commented Aug 18, 2023

I have an abbreviations.md file to hold all the site wide abbreviations and be included as a snippet, but sometimes an abbreviation on a page will have a different definition because of the subject matter.

As an example CNO could be Chief of Naval Operations in the snippet, but a page could use it for Computer Network Operations. Having the abbreviations.md snippet added to the end of the page prevents the page from specifying its own definition for that acronym.

@facelessuser
Copy link
Owner

Prepend is problematic as well as we may inject before YAML frontmatter and such.

Maybe if you need to control auto append, maybe we can allow a placeholder to specify the insertion point for auto append.
Then for files where you need to provide an override, you can just add the insertion point at the end and then add overrides after.

Though, until something like this was added, the mitigation would be to not use append if you need to have such control.

@nbanyan
Copy link
Author

nbanyan commented Aug 18, 2023

For now I am adding the snippet line just after the frontmatter and will check for it when my coworkers create pages.

@facelessuser
Copy link
Owner

It may even make sense not to include abbreviations with multiple meanings in the "auto" abbreviation file. Those that have multiple meanings may make more sense only being specified directly on the desired page to ensure proper context.

@facelessuser facelessuser added P: maybe Pending approval of low priority request. and removed S: more-info-needed More information is required. S: triage Issue needs triage. labels Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P: maybe Pending approval of low priority request. T: feature Feature.
Projects
None yet
Development

No branches or pull requests

3 participants