ENH: Add index option to_markdown()
- [ ] closes #32667
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

@jreback apparently, the ```pytest.warns``` in my test is an unwanted pattern. Should i remove that part of code and ignore the testcase when ```index``` and ```showindex``` is both set? @quangngd can you merge master. @quangngd can you update as @TomAugspurger suggests (will need to change the test as well) How tests should handle warnings? > How tests should handle warnings?

Sure! There is a note on the contributing guide here: https://pandas.pydata.org/docs/dev/development/contributing.html#testing-warnings

Can you merge master + get a green CI? @alimcmaster1 i don't know what to do with the codecov/patch fail can you merge master and address comments thanks @quangngd 