question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Superfences style code triggering MD046

See original GitHub issue

I’ve got some documentation code I’m working on automated testing for which belongs to the CiviCRM project.

We use MkDocs to build the content on our documentation site. As part of our automated testing we’d love to properly lint our documentation according to a style guide.

The issue we’re facing is that the MkDocs Material theme we’re using provides for a helpful admonitions feature and the superfences feature. With these tools we can nest code examples inside handy “highlight” boxes.

Unfortunately it appears that markdownlint is detecting these as indented code blocks and is therefore expecting all other code blocks to be the indented type rather than “fenced”.

We’d love to resolve this without turning off the check for inconsistency as this is useful for us.

Example code:

!!! note "How much does performance improve with a specialized cache service?"
    The exact answer will depend on the use-case and environment. However, we can consider an example.

    This example relates to CiviCRM `5.6.alpha1` on a barebones, local Drupal 7 site and benchmarked the time it takes to render the "Event Info" page (`/civicrm/event/info?id=1`) with the [Apache "ab"](https://en.wikipedia.org/wiki/ApacheBench) command.  This sends a large number of HTTP requests and calculates the average response time.

    ``` bash
    $ ab -n 100 -c 3 'http://localhost/civicrm/event/info?id=1'
    ```

    With the default, pure-MySQL configuration, the mean response time was ~460ms.  With Redis, this decreased by ~60ms (~13%) to ~400ms.
    
    Note, though, the local copy of MySQL on this laptop is probably faster than a typical MySQL because it stores *everything* in ram-disk (rather than HDD or SSD). Compared to a typical, self-hosted MySQL, the Redis/Memcache advantage is probably wider.

Is there any chance at all that markdownlint would add support for the superfences style syntax?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
homotechsualcommented, Jul 29, 2019

I’ll do some more thorough testing tomorrow and give you some repro steps and a repo pointer.

0reactions
homotechsualcommented, Jul 29, 2019

I’ll post the above to the issue queue for DavidAnson/vscode-markdownlint.

Good to close this one I think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SuperFences - PyMdown Extensions Documentation
Experimental feature that preserves tabs within a code block instead of converting them to spaces which is Python Markdown's default behavior.
Read more >
Implement ```-style (fenced) Markdown code blocks
A code fence consists of three or more backticks ``` or tildes ~~~ ... The code block will be de-dented by as many...
Read more >
Code block style [Expected: indented; Actual: fenced]
As you don't state what behavior you desire, I will note that there are multiple options for Rule MD046. consistent (default): Whichever style ......
Read more >
alinex-book.pdf
This is a book explaining all the major parts and development background around the Alinex named coding projects. But it is only.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found