facelessuser / pyspelling

Spell checker automation tool
https://facelessuser.github.io/pyspelling/
MIT License
82 stars 24 forks source link

question: how do I ignore specific types of codeblocks? #174

Closed clubanderson closed 1 year ago

clubanderson commented 1 year ago

In our project we are scanning all .md files. Those files contain blocks of code that are to be executed, and other blocks that are not intended to be executed - these blocks are just output from the commands. The output blocks contain UIDs typically. These fail a spellcheck of course. I want to spellcheck codeblocks that have commands to run which are inside:

command-to-run.sh

and ignore blocks that have output:

output 477fdjjh3-dskjd-jkjkjsd

what do you suggest I use for ignoring this type of input to pyspelling. Both blocks are wrapped in when converted to html, but I ignore the generated files.

example of what we are spellchecking is https://docs.kubestellar.io/main/Coding%20Milestones/PoC2023q1/example1/

Thank you

facelessuser commented 1 year ago

I am assuming you are using the HTML filter. If you are, you can use the ignores option: https://facelessuser.github.io/pyspelling/filters/html/#options.

The document mentions that the CSS selector lib that is used is Soup Sieve (which I also maintain). You may find the custom pseudo-class --soup-contains:() helpful.