Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    oprypin
    @oprypin:matrix.org
    [m]
    changing the default behavior would also be nice, though controversial
    Craig Parker
    @craigbass76
    Is there some trick to div classes? :::bob blah ::: (but on different lines) was I thought the equivalent of <div class="bob"> blah </div> Even if I type the HTML by hand, for whatever reason the blah part is plain text. My bob classed div styles lists differently, and I'm just getting one big line of text. Source code shows no <ul> or <li> tags.
    oprypin
    @oprypin:matrix.org
    [m]
    @craigbass76: sorry uhh i don't know what this means, with everything smooshed into one line. could you start a Discussion on mkdocs repo, and include a complete way to reproduce the problem and describe why it's not what you expected
    Craig Parker
    @craigbass76
    Over in github?
    oprypin
    @oprypin:matrix.org
    [m]
    @craigbass76: yes
    oprypin
    @oprypin:matrix.org
    [m]
    @craigbass76: and i don't know what ":::" stands for, please also include some description of that
    Craig Parker
    @craigbass76
    I'm beginning to think it's the python-flavored markdown, but I'll post when I get my ducks in a row. Is there a way to change which markdown flavor I'm using, or just adding extensions to this one?
    oprypin
    @oprypin:matrix.org
    [m]
    @craigbass76: just extensions yea
    Craig Parker
    @craigbass76
    Fenced divs is what they're called I guess. And I think I'm out of luck...
    oprypin
    @oprypin:matrix.org
    [m]
    @craigbass76: it's relatively easy to make such an extension to python-markdown. and maybe it even exists. you could do a web search
    well.. my search didn't lead to anything, it just finds fenced code blocks
    Junuh Kiang
    @kjunuh
    Hi there, I'm trying to import a JS web component, the javascript file is at docs/js/script.js and have it working/showing up in the site, but it doesn't seem to update when I change the script.js file. When I put it in a new file (e.g. script2.js), everything works, but even when I delete/rebuild the site it seems to still use the old file when I use script.js as a file name. Am I doing something wrong here?
    # docs/mkdocs.yaml
    ...
    extra_javascript: 
      - js/script.js
    <script type="module" crossorigin src="/js/script.js"></script>
    <component></component>
    Timothée Mazzucotelli
    @pawamoy
    hi, is there a way to know if the strict option was enabled, from a plugin?
    oprypin
    @oprypin:matrix.org
    [m]
    i don't think so, at first glance sounds like a misuse
    Timothée Mazzucotelli
    @pawamoy
    here's what I'm trying to do: I created a spellcheck plugin, and since it's kinda slow to spellcheck, I want to add an option to tell: only run this plugin in strict mode
    oprypin
    @oprypin:matrix.org
    [m]
    oh hm
    I've been doing this as
    LINT=true
    enabled: !ENV ['LINT', false]
    Timothée Mazzucotelli
    @pawamoy
    oh well, there's a strict item in the config object of on_config ^^
    yeah I saw this env var technique, but I don't like it, at least for this spellcheck plugin
    facelessuser
    @facelessuser:matrix.org
    [m]
    Is there a reason it needs to be a plugin? This feels like a good thing to have as a post process. That's basically what I do with my pyspelling package. Just generate docs and spellcheck the HTML.
    Timothée Mazzucotelli
    @pawamoy
    no particular need, except that non-python projects usually run mkdocs in docker, and so providing spellcheck as a mkdocs plugin might ease its use
    oprypin
    @oprypin:matrix.org
    [m]
    is there a reason it needs to be a workaround rather than a plugin?
    why should it need to learn to parse html
    facelessuser
    @facelessuser:matrix.org
    [m]
    It can parse whatever you have a plugin for.
    Python source, HTML, whatever.
    oprypin
    @oprypin:matrix.org
    [m]
    @pawamoy: well anyway that's what i did. not as a fallback solution but as the desired one.
    https://github.com/search?q=repo%3Aoprypin%2Fmkdocs-code-validator%20enabled&type=code
    facelessuser
    @facelessuser:matrix.org
    [m]
    Anyways, everyone has different ways in which they like to do things, so no judgment.
    Timothée Mazzucotelli
    @pawamoy
    @oprypin:matrix.org yup, might implement that in mkdocstrings as well. I'll go with detecting strict for the spellcheck plugin :)
    @facelessuser:matrix.org definitely, and I'm mostly having fun here writing this plugin haha
    thank you both!
    facelessuser
    @facelessuser:matrix.org
    [m]
    The big thing you may run into is potentially how to exclude certain text from being spellchecked. With HTML, I just ignore everything in code blocks, but maybe you have an easy way around that.
    Timothée Mazzucotelli
    @pawamoy
    yeah I already have something working, I'm able to strip parts of the HTML (using Python standard lib's HTMLParser)
    oprypin
    @oprypin:matrix.org
    [m]
    no, we have even better access in a plugin, add a low priority block processor, or worst case just access the html tree before it gets converted to text and printed to the file
    @pawamoy: oh you're parsing html like mkdocstrings used to do? 😬😬😬😬
    Timothée Mazzucotelli
    @pawamoy
    @oprypin:matrix.org yes, in the on_page_contents hook ^^
    facelessuser
    @facelessuser:matrix.org
    [m]
    When I wrote my pyspelling package, I had to write my own CSS selector package for beautifulsoup so I could target and ignore any HTML I wanted to. It's now the official CSS selector solution for beautifulsoup as the one before was not great.
    oprypin
    @oprypin:matrix.org
    [m]
    maybe that's also why it's slow..
    @pawamoy:
    why not access the html tree directly in a treeprocessor
    Timothée Mazzucotelli
    @pawamoy
    @oprypin:matrix.org most probably haha
    yeah didn't think of using a treeprocessor. it would need to run (almost) last I guess?
    oprypin
    @oprypin:matrix.org
    [m]
    i guess yes
    Timothée Mazzucotelli
    @pawamoy
    @facelessuser:matrix.org ah, interesting, I wanted to add such support for selectors as well
    oprypin
    @oprypin:matrix.org
    [m]
    at least to behave like your current setup, definitely yes
    facelessuser
    @facelessuser:matrix.org
    [m]
    It was quite a bit work, but its been pretty stable now. It was surprisingly fun to do.
    Daniel Hayden
    @Sledro
    hey guys, is there a way to hide TOC from one page only?
    oprypin
    @oprypin:matrix.org
    [m]
    @Sledro: in mkdocs-material theme yes, look it up
    mkdocs material meta toc hide
    Daniel Hayden
    @Sledro
    just on one page though? im r
    im trying inline css