Closed frans-fuerst closed 7 months ago
Few ideas, it's hard to say without checking your configuration:
!>[interface] Whatever
Some text
!@
2. Make sure markdown processing it enabled in your grav installation "Configuration / Content => Process: Markdown". I'm not using twig here. In my "Configuration / Content" I only have *URL taxonomy* and *Ignore hidden* set to yes. In "Configuration / Markdown" I only have *Markdown Extra* set to yes.
If none of the above work, please report, I'll tell where to add debug to check why it's not matching your markdown.
Adding a section name works for me, thanks! Should the unnamed section work, too?
And - admittedly unrelated - should a section be collapsible, too? I can only expand them - clicking the title again only scrolls down a bit (which I personally find a bit annoying) but the section doesn't collapse again..
Without having tried it in the live system, maybe the regex used in the php file is wrong. Moving ?
out of the braces makes the whole section name optional:
/^!>(\[(\w[\w-]*)\])?\s*(.*)$/
Should the unnamed section work, too ?
Yes, it should (and it does on my website .?.?). Click on Properties chaining to see the effect.
And - admittedly unrelated - should a section be collapsible, too? I can only expand them - clicking the title again only scrolls down a bit (which I personally find a bit annoying) but the section doesn't collapse again..
That's because of the limited choice of implementation. The markdown emits only HTML's and CSS and no javascript, so I'm limited to what could be done without JS. The unnamed section is using a checkbox (so it has both states: checked and unchecked) while the named section use a radiobox (which, when clicked, can't be unclicked, you can only click another item). So it works on system without JS, and doesn't disturb SEO algorithms.
The only JS script I've added is to scroll back the page to the section name when folding a section, so if you have JS enabled, at least, it doesn't jump to another part of the page when clicking. You can try to disable it if you find it disturbing, or if you find a better, less painful workaround, I'll be grateful for it.
On https://blog.cyril.by/en/documentation/emqtt5-doc/emqtt5 "Properties Chaining" and "Properties Viewing" indeed works. I only tried it with the bunch of sections starting at "MessageReceived" - those don't work for me (Firefox, btw.)
Moving ? out of the braces makes the whole section name optional:
There are 2 regex in the code, one for section names and one without (see 2 lines below in the else if
). I've split in 2 regex because the text doesn't end up in the same capture's index. I should try your suggestion to see if I can simplify the code.
I only tried it with the bunch of sections starting at "MessageReceived" - those don't work for me (Firefox, btw.)
That's because I'm stupid. MessageReceived
doesn't have the same section name as the Contructor
or the other connectTo
methods, so it opens but doesn't collapse when clicking the other items. Other method will collapse so only one is opened at a time. I'll fix it, sorry for the bad example.
Nice to see a living plugin with a caring maintainer, thanks :)
So, did you find out what wasn't working with the unnamed section mark code ?
Issue is stale. Feel free to reopen if not.
I'm on Grav v1.7.34 and have the current
markdown-collapsible
plugin installed and enabled - the following Markdown code (taken from the example) gets rendered as without the plugin:grav.log
shows nothing and the console only shows a file being loaded by the plugin:Any idea? Does that plugin depend on a certain theme? Are there conflicting plugins?