How could you treat tendonitis when running?

It varies. There are many different forms of tendinitis around the leg that a runner might suffer from. The need for treatment depends on the severity and its impact on your ability to run. The initial treatment is to either limit the amount that you runor simply stop running for a short period of time to see if your symptoms improve. Ice, and some over the counter medications and stretching may help too.
See below. Use compression around the affected tendon to control motion and swelling. If painful it would be best to rest.