How to count words per Chapter and Show the number in outline?

I am used to write the novel in single one md file. But I need to count words for each chapter which is divided by title and show it in outline sidebar. I have installed some plugins but no one could work.
So what plugin could do it, or any .css code could do it?