Fanli 凡例, also called liyan 例言, fafan 發凡, tili 體例 or shili 釋例, is an introductory summary explaining the theme of a book, the manner and principles of its compilation, the treatment of complex issues, etc. It is normally written by the author(s) or compiler(s) and mostly used in dictionaries, handbooks, year books or collections.
The term originates in in Du Yu's 杜預 (222-284) preface (xu 序) to a collection of exegeses to the "Spring and Autumn Annals", Chunqiu jingzhuan jijie 春秋經傳集解 (Chunqiu Zuoshi jingzhuan jijie 春秋左氏經傳集解), where is talk of the principles (li 例) which Confucius used to revise the ancient books.
According to common use at that time there were three methods (san ti 三體) of compilation. The first and orthodox one was called fafan zhengli 發凡正例, in which all matters were equally and consequently treated. Alternatively, an author or compiler could change traditional principles to give them a new meaning (xinyi bianli 新意變例), or not adhere to principles of compilation at all and directly spell out what he wanted to say (guiqu feili 歸趣非例).
The five principles (wuli 五例) of the Chunqiu chronicle were to express matters indirectly by subtle hints (wei er xian 微而顯), compilation of elegant paragraphs (wan er cheng zhang 婉而成章), showing the punishment of evil in order to encourage virtue (cheng e er quan shan 懲惡而勸善), expressions using the essence of a topic to point out meaning and consequence unambiguously (jin er bu yu 盡而不汙), and to clarify the general meaning so that the principles behind it become instantly clear (zhi er zhao, yue yan shi zhi, tui yi zhi li 志而昭,約言示制,推以知例).
The use of compiling a fanli at the beginning of a book was introduced in three history books written during around the same time, namely Gan Bao's 干寶 (286-336?) Jinji 晉紀, Deng Can's 鄧粲 Yuan-Ming ji 元明紀, and Sun Sheng's 孫盛 Jinyang qiu 晉陽秋. This is proved in Liu Zhiji's 劉知己 historical critique Shitong 史通, which has an own chapter on prefaces and fanli introductions (10 Xuli 序例).