Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:15
    squidfunk commented #3864
  • 20:54
    twardoch commented #3864
  • 17:56
    squidfunk closed #4061
  • 17:56
    squidfunk commented #4061
  • 15:41
    2bndy5 edited #4061
  • 15:00
    2bndy5 edited #4061
  • 14:50
    2bndy5 opened #4061
  • 14:12
    Wolf2323 commented #3864
  • 11:41
    squidfunk commented #3353
  • 09:48

    github-actions[bot] on gh-pages

    Deployed 5eb617693 with MkDocs … (compare)

  • 09:47

    squidfunk on master

    Fixed schema (compare)

  • 09:46
    squidfunk labeled #4051
  • 09:45
    squidfunk commented #4051
  • 09:21

    github-actions[bot] on gh-pages

    Deployed c011c245f with MkDocs … (compare)

  • 09:20

    squidfunk on master

    Updated Giscus integration (compare)

  • 09:04
    hellt commented #4058
  • 08:57
    hellt commented #4058
  • 08:44

    github-actions[bot] on gh-pages

    Deployed 98e351a29 with MkDocs … (compare)

  • 08:43
    squidfunk labeled #4060
  • 08:43
    squidfunk closed #4060
Martin Donath
@squidfunk
However, I haven't built such a setup myself, so maybe someone else can share some experiences.
bradleyharden
@bradleyharden:matrix.org
[m]

I'm trying to use Material for MkDocs for my collection of notes on various topics. Some of them are mini blog posts that I share with others, and some function as a lab notebook. I've looked at and used a couple different static site generators for this purpose, and I'm trying out Material for MkDocs for the first time now.

In any event, I would like to label each Markdown document with a date. I was able to add a date field in the metadata section and get that date to display on the page using a modified version of the approach given in this blog post.

Is it possible to somehow use that date field to filter search results? Issue squidfunk/mkdocs-material#3174 hints at it, but it looks like there wasn't much response.

Martin Donath
@squidfunk
This is currently not supported. However, I already thought of allowing users to index arbitrary metadata in documents, which could be configured via an additional configuration option of the built-in search plugin. A previous discussion happened in #3174, which was discontinued because of a lack of interest.
bradleyharden
@bradleyharden:matrix.org
[m]
@squidfunk, did all of my messages not come through? I linked to #3174 above
I'm on Matrix, not Gitter, so maybe that's an issue?
Martin Donath
@squidfunk
No, all good. I was just referring to the issue you linked to give additional context on what's the current state on that matter: lack of interest, i.e. not many users need it. Thus, it makes currently no sense for me to invest the time to make that happen.
You could patch the search plugin yourself, add the data to the search index, and then patch the indexing pipeline + rendering of search results in the frontend. We already do it with the tags metadata to make tags searchable: https://github.com/squidfunk/mkdocs-material/blob/0c555b2c9f667cf453a1ebad58123204f4a9c85b/src/plugins/search/plugin.py#L48-L49
Dave Hirschfeld
@dhirschfeld

Some of them are mini blog posts

There's an issue for supporting blog posts (squidfunk/mkdocs-material#3353) which I'm keenly watching and has garnered some support (:+1:)

GL513
@gl513:matrix.org
[m]
Hello. Is there any way to configure the header and the link color to be different colors instead of using "--md-primary-fg-color" to manage both, without having to go and extend the theme?
Martin Donath
@squidfunk
Yes, you can just override the CSS classes that reference those colors with additional CSS (see customization guide), i.e. .md-header and .md-typeset a
5 replies
GL513
@gl513:matrix.org
[m]
In case I need it, or for future reference, is there a list of all of the things I can use in the extra.css, such as .md-header?
Martin Donath
@squidfunk
Of course, just look at the CSS 😊 The best idea is to use the browser inspector to find out which CSS classes apply styles to an element. Then use these classes to override specific properties.
2 replies
oprypin
@oprypin:matrix.org
[m]

@squidfunk: you could put specially marked comments intertwined with the CSS and then automatically extract those comments.

but anyway for me it would not be easier to browse a list of classes than just inspect in browser

Martin Donath
@squidfunk
Yeah, could possibly use mkdocstrings for that!
However, I'd doubt that many users need it. Most should be fine with the CSS variables. There are not many users asking for "how could I solely style the header?"
Inspecting the browser is almost always a better idea, as classes sometimes need to be very complex, so it might not be apparent which styles to apply to users not used to CSS.
GL513
@gl513:matrix.org
[m]
I think I may have found a bug.
I wanted to remove the generator notice, and put the notice elsewhere, so I appended generator: false under extra:, but it doesn't seem to be working. Should I make an issue on github?
GL513
@gl513:matrix.org
[m]
Nevermind. I solved it. It was a misconfig. I did see your twitter post, Martin. I'll try to be the best I can with getting back to you if I do have an issue :)
Martin Donath
@squidfunk
Thanks!
I recommend setting up configuration validation, which should catch most errors
GL513
@gl513:matrix.org
[m]
I cloned the repository and set it up as a local site hosted with mkdocs serve, but I noticed, it's in the older style. Does this mean the actual documentation is outdated too?
Martin Donath
@squidfunk
What do you mean by "older style"?
3 replies
GL513
@gl513:matrix.org
[m]
Okay, thanks :)
alkisg
@alkis:matrix.org
[m]
Is it possible to omit the TOC (at the right side) for a specific page?
1 reply
GL513
@gl513:matrix.org
[m]
wait no, you said right side.
what about removing the classes for it?
No, I was right the first time.
alkisg
@alkis:matrix.org
[m]
Indeed the link you provided covers it. Thank you very much
mondle
@mondle:matrix.org
[m]
When making a table with a right aligned field, the alignment goes to the sort button instead of the field text
It looks weird because that sort icon only appears on hovering
Sidenote, it would be nice to turn on and off sortable per table
4 replies
Oleg Polakow
@polakowo
Hello, I'm getting high CPU usage of any page published with Mkdocs Material (Insiders). For example, if you go to your page https://squidfunk.github.io/mkdocs-material/publishing-your-site/ and this tab remains active, the CPU usage jumps to 40-50% and stays the same even without scrolling or any activity on the page. I tried analyzing the performance on both Safari and Chrome and the issue is coming from constant "recalculating style". Any ideas how to mitigate the issue? It becomes worse the longer the page is.
Martin Donath
@squidfunk
Interesting. However, I'm not seeing this problem:
Bildschirmfoto 2022-05-24 um 13.04.50.png
The style recalculations might come from the animation of the code annotations
Bildschirmfoto 2022-05-24 um 13.05.37.png
If you can narrow it down, I'm happy to look into it. We need a reproducible example that shows the issue clearly.
One thing you could try: try setting prefers-reduced-motion: reduce via the Chrome dev tools and see whether the issue persists. If it goes away, it's very likely related to animations.
Oleg Polakow
@polakowo
Screen Shot 2022-05-24 at 13.06.06.png
Hmm seems to be indeed coming from annotations. Here's the timeline on Safari for the same page (see above)
Screen Shot 2022-05-24 at 13.08.56.png
License page (https://squidfunk.github.io/mkdocs-material/license/) doesn't have this problem, as there are no annotations apparently
mondle
@mondle:matrix.org
[m]
Did find a couple examples (not material design) where the sort button is visible all the time which makes it look less strange
But your thinking of putting it on the left is probably better
Oleg Polakow
@polakowo
As you suggested, prefers-reduced-motion helps. I'll probably remove the following lines since my documentation has just too many annotations.
-webkit-animation: pulse 2s infinite;
animation: pulse 2s infinite;
Martin Donath
@squidfunk
@polakowo please create a new issue, we can only enable animations when annotations are visible using IntersectionObserver.
This is actually a reasonable feature request