Closed nikclayton closed 2 weeks ago
Actually that was a good idea. It makes the documentation more easy to read.
Now the text looks like e.g., standard:class-signature
.
I can't copy/paste that in to a .editorconfig
file, it needs to be ktlint_standard_class-signature = disabled
.
So the generated HTML should look something like this:
<p><code>.editorconfig</code>: <code>ktlint_standard_class-signature = disabled</code> <button onclick="navigator.clipboard.writeText('ktlint_standard_class-signature = disabled')">Copy</button></p>
Bonus points if there's a "Copy" button I can use to copy the content directly.
I have improved the solution to support copy to clipboard in #2705. Instead of a single click, you will need two clicks. As the rules documentation is stored in Markdown files, and via Mkdocs is converted to Html, it was not possible to go with your solution.
Sorry, not a bug, but there wasn't a template for "Documentation change".
At the moment each rule entry in the documentation has a section at the bottom that lists the rule name and rule set.
For example, https://pinterest.github.io/ktlint/latest/rules/standard/#class-signature ends with:
The only time I need this information is when I'm updating
.editorconfig
to enable or disable the rule. So it would be a helpful quality-of-life improvement if the system that generates the documentation could also insert a section with copy/pasteable strings that can be used directly. Bonus points if there's a "Copy" button I can use to copy the content directly.