Article snapshot taken from Wikipedia with creative commons attribution-sharealike license.
Give it a read and then ask your questions in the chat.
We can research this topic together.
Gangyō-ji (元慶寺, Gangyō-ji) is a Buddhist temple in Kyoto, founded by the priest Henjō. The Emperor Kōkō endowed the temple and the emperor Kazan abdicated in this temple.
877 (Gangyō 1): The temple is founded, and it takes its name from the era (nengō) in which it was first established.
986 (Kanna 2): The emperor Kazan abdicated in this temple. He renounced his throne and the world. Two courtiers, the chūnagon Yoshikane and the sachūben (左中辨 middle-level controller of the left) Korenari, decided to follow the former emperor's example and became Buddhist priests themselves. After this, the temple was also known more popularly as Kazan-ji (花山寺, Temple of (Emperor) Kazan).