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

Abbreviations and a glossary of terms #1919

Closed
3 tasks done
Stephen-Gates opened this issue Sep 13, 2020 · 6 comments
Closed
3 tasks done

Abbreviations and a glossary of terms #1919

Stephen-Gates opened this issue Sep 13, 2020 · 6 comments
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open

Comments

@Stephen-Gates
Copy link
Sponsor

I checked that...

  • ... the documentation does not mention anything about my idea
  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... there are no open or closed issues that are related to my idea

Description

As suggested on Gitter this request is to implement a site-wide Glossary similar to the functionality offered by ReadMe.com and better handling of abbreviations.

One file would be defined in the site for the collection of terms and descriptions. This file could optionally be displayed as a Glossary page.

Using functionality similar to the Abbr extension when the cursor is over a term on any page, a tooltip is displayed showing the description. Functionality could be added to support mobile user as suggested on Gitter.

As a first step the Abbr extension could be added to the documentation and better support for mobile displays added.

Use Cases

Documentation can contain abbreviations and terms that may be new to the reader. Readers can start reading documentation on any page and may have missed initial explanations of terms. By interacting with the term on the page, the reader can quickly discover the meaning of the term.

By capturing all terms in a single file, it make it easy for the author to maintain terms across multiple pages.

Screenshots / Mockups

abbr-tooltip

Current implementation of Abbr extension

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Sep 13, 2020
@squidfunk
Copy link
Owner

Thanks! That's indeed a great idea. It goes beyond the abbr functionality, as we'd have to add some JavaScript to inject the glossary, but I think it could be a great addition to Insiders! In essence:

  • Better support for abbr on mobile (Material for MkDocs)
  • Enhanced support to inject glossary terms into abbr

@squidfunk squidfunk added the needs investigation Issue must be investigated by the maintainers label Sep 13, 2020
@squidfunk
Copy link
Owner

7151d24 adds documentation on how to use abbreviations and – how to build a glossary with snippets! It turns out that we can use the Snippets extension to keep abbreviations in a central file and then just include them at the bottom of a page:
https://squidfunk.github.io/mkdocs-material/reference/abbreviations/#adding-a-glossary

This is a much better solution than anything that we could come up with JavaScript, as it will run during build-time. Does this work for you, @Stephen-Gates?

@squidfunk
Copy link
Owner

Tooltip for touch-devices added in 6725ec1:

Bildschirmfoto 2020-09-19 um 15 17 01

@squidfunk squidfunk added resolved Issue is resolved, yet unreleased if open and removed needs investigation Issue must be investigated by the maintainers labels Sep 19, 2020
@squidfunk
Copy link
Owner

Released as part of 5.5.13.

@Stephen-Gates
Copy link
Sponsor Author

@squidfunk thank you so much for solving this so quickly. I'm on holidays at the moment but will give it a try soon. 🥇

@kcgthb
Copy link
Contributor

kcgthb commented Oct 1, 2020

It turns out that we can use the Snippets extension to keep abbreviations in a central file and then just include them at the bottom of a page:

I've actually been doing that for some time, and it works great!

But now I'm wondering if the concept could be pushed even further, to avoid having to include that central file in each and every page on the site.

Would there be a way to override a block or a partial, to have the glossary automatically included in every page? I know the glossary is Markdown, the partials are HTML, things are not really happening at the same level, but I feel there may be a way to make this even more convenient. :)

Any recommendation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants