Sanskrit literature

Sanskrit literature broadly comprises texts composed in the earliest attested descendant of the Proto-Indo-Aryan language known as Vedic Sanskrit and later on in the language formally defined by Pāṇini usually called Classical Sanskrit. 
Literature in the older language begins with the composition of the Ṛg·veda between about 1500 and 1000 BCE, followed by other works right up to the time of Pāṇini around 5th or 4th century BCE. 
Vedic Sanskrit is the language of the extensive liturgical works of the Vedic religion, while Classical Sanskrit is the language of many of the prominent texts associated with the major Indian religions, especially Hinduism, but also Buddhism, and Jainism. While the bulk of these were composed in ancient India, others were composed in central, East or Southeast Asia. 
Sanskrit literature also includes substantial works covering secular sciences and the arts. Early works of Sanskrit literature were transmitted through an oral tradition for centuries before they were written down in manuscript form.
Overview.
Literature in the Vedic and the Classical language fundamentally differ from each other in matter, spirit and form. The Vedic literature that survives is entirely religious, dealing essentially in liturgical matters with prayers and hymns to the gods in the sacrifices. 
Classical Sanskrit literature however exists in every field including epics, lyric, drama, romance, fairytale, fables, grammar, civil and religious law, the science of politics and practical life, the science of love and sex, philosophy, medicine, astronomy, astrology and mathematics, and is largely secular in subject-matter.
Some fundamental differences between Vedic and Classical Sanskrit literature, reflecting the underlying society:
These fundamental differences in psychology are attributed to the absence of the doctrines of Karma and reincarnation in the Vedic period, notions which are very prevalent in later times.
Vedic literature.
Chronology.
Five chronologically distinct strata can be identified within the literature of the Vedic language:
The first three are commonly grouped together, as the Saṃhitās comprising the four Vedas: ṛk, atharvan, yajus, sāman, which together constitute the oldest texts in Sanskrit and the canonical foundation both of the Vedic religion, and the later religion known as Hinduism.
Ṛg·veda.
The Ṛg·veda, the first and oldest of the four Vedas is the foundation for the others. The Ṛg·veda is made of 1028 hymns named "sūktas", composed of verses in strictly regulated meters. There are about 10,000 of these verses that make up the Ṛg·veda. 
The Ṛg·vedic hymns are subdivided into 10 "maṇḍala"s, most of which are attributed to members of certain families. Composition of the Ṛg·vedic hymns was entirely oral, and for much of its history, the Ṛg·veda has been transmitted only orally, written down likely no sooner than in the second half of the first millennium of the Common Era.
The later Vedas.
The Sāma·veda is not an original composition: it's almost entirely made of stanzas taken from the Ṛg·veda and rearranged with reference to their place in the Soma sacrifice. This book is meant to be sung to certain fixed melodies, and may thus be called the book of chants, "sāman". 
The Yajur·veda like the Sāman is also largely made of verses taken from the Ṛg·veda, but also contains several prose formulas. It is called the book of sacrificial prayers "yajus".
The last of the four, the Atharva·veda, both by the internal structure of the language used and by comparison with the Ṛg·veda, is a much later work. However, the Atharva·veda represents a much earlier stage of thought of the Vedic people, being composed mainly of spells and incantations appealing to demons, and is rife with notions of witchcraft, derived from a much earlier period.
Brāhmaṇas.
The Brāhmaṇas concern themselves with the correct application of ritual, the word being derived from "bráhman" meaning 'prayer'. They were composed at a period in time by which the Vedic hymns had achieved the status of being ancient and sacred revelations and the language had changed sufficiently so that the priests did not fully understand the Vedic texts. 
The Brāhmaṇas are composed in prose, unlike the previous works, forming some of the earliest examples of prose in any Indo-European language. The Brāhmaṇas intend to explain the relation between the sacred text and ritual ceremony.
The later part of the Brāhmaṇas contain material of a specially theosophic character, which are meant to be imparted or studied in the peace and calm of the forest, hence their name the "Āraṇyaka"s. The last part of these are books of philosophy that came to be called "Upaniṣad"s. The doctrines in the Upaniṣads were later developed into the "Vedānta" system.
Sūtras.
The Sūtras are treatises concerned either with Vedic ritual or customary law. There arrived a stage during the later period of the Brāhmaṇas that a vast mass of ritual and custom detail had been accumulated and widely scattered. To address this, the Sūtras are intended to provide a concise survey of the sum of these scattered detail. 
The Sūtras forego the need to interpret the ceremony or custom, but simply provide a plain, methodical account wih the utmost brevity. The word "sūtra", derived from the root "siv-", 'to sew', thus meaning 'sewn' or 'stitched together' eventually became a byword for any work of aphorisms of similar concision. The sutras in many cases are so terse they cannot be understood without the help of detailed commentaries.
Grammatical literature.
By the time of the Sūtra period, the language had evolved sufficiently to make increasing parts of the older literature hard to understand, and to recite correctly. This led to the emergence of several classes of works intended to resolve this matter. These works were styled like the religious Sūtras, however they were not a religious but rather a largely scientific approach to the study of language.
One of the most important classes of this is the "Prātiśākhya Sūtras" which deal with accentuation, pronunciation, prosody and related matters in order to study the phonetic changes that have taken place in Vedic words. 
This tradition reaches its high point in the Aṣṭādhyāyī of Pāṇini, a book of succinct Sūtras that meticulously define the language and lay the foundations of what is hereafter the correct, official way of speaking this language: "saṃskṛtá-": 'refined, polished, perfected'.
Epic literature.
The first traces of epic poetry are seen in the Vedic literature, besides some of the dialog hymns in the Ṛg·veda, the Ākhyānas, Itihāsas and Purāṇas of the Brāhmaṇas. Originally songs of praise, these over time developed into epic poems of increasing length, heroic songs centered around a single hero or a single great event. Of these developments, whilst there may have been many of them, only two have survived, the Mahābhārata and the Rāmāyaṇa.
Mahābhārata.
The Mahābhārata is in a sense not just an 'epic' or a 'poem', not just a single production, but can be seen as a "whole" body of literature in its own right. Already in the Ṛg·veda, the "Bharatas" find mention as a warlike tribe, and in the Brāhmaṇas is found Bharata, the son of Duṣyanta and Śakuntalā. 
The kernel of the Mahābhārata is a family feud in the royal house of the Kauravas, i.e, the descendants of Bharata, leading to a bloody battle. However, on top of this historical original, an enormous mass of poetry, myths and legends, secondary tales, moral stories and much more get appended over the centuries, such that the final form as we have it has 100,000 ślokas across 18+1 books.
Rāmāyaṇa.
In contrast to the Mahābhārata, the Rāmāyaṇa consists of only 24,000 ślokas divided into seven books, and in form is more purely regular, ornate epic poetry, a form of style which is the basis of the later Kāvya tradition.
There are two parts to the story of the Rāmāyaṇa, which are narrated in the five genuine books. The first revolves around the events at the court of King Daśaratha at Ayodhya with one of his wives vying for the succession of the throne to her own son Bharata in place of the one chosen by the king, Rāma. This is seen to have a historical basis, while the second part is full of myth and marvel, with the banished Rāma combating giants in the forest, slaying thousands of demons and so on. The second part also deals with the abduction of Rāmā's wife, Sītā by king Rāvaṇa of Lankā, leading Rāma to carry out to expedition to the island to defeat the king in battle and recover his wife.
Kāvya literature.
Kāvya is the literary style used by court poets in a movement that flourished between c. 200 BCE and 1100 CE. While the Rāmāyaṇa forms the chief source and basis of the Kāvyas, and while in the former, form is subordinated to matter, form takes on centrestage in Kāvya. Kāvya works are thus full of alliteration, similes, metaphors and other figures of speech.
The Buddhist poet and philosopher Aśvaghoṣa's Buddhacarita is among the oldest surviving examples of Kāvya literature, and the work calls itself a "mahākāvya" and is composed no later than 400 CE.
The most important of the Kāvyas are Kālidāsa's Raghuvaṃśa and Kumārasambhava. 
Kālidāsa.
Kālidāsa, called by many the Shakespeare of India, is said to have been the finest master of the Sanskrit poetic style, possessing qualities, as ascribed to his favorite style, the Vidarbha, by Danḍin, such as, in Arthur Macdonell's words, "firmness and evenness of sound, avoiding harsh transitions and preferring gentle harmonies; the use of words in their ordinary sense and clearness of meaning; the power to convey sentiment; beauty, elevation, and the employment of metaphorical expressions". 
Raghu·vaṃśa.
This Raghu·vaṃśa chronicles the life of Rāma alongside his forefathers and successors, with the story of Rāma agreeing quite closely that in the Rāmāyaṇa. 
The narrative moves at a rapid pace, is packed with apt and striking similes and has much genuine poetry, while the style is simpler than what is typical of a Kāvya. The Raghuvaṃśa is seen to meet all the criteria of a "mahākāvya", such as that the central figure should be noble and clever, and triumphant, that the work should abound in "rasa" and "bhāva", and so on. There are more than 20 commentaries of this work that are known.
Kumāra·sambhava.
The Kumāra·sambhava narrates the story of the courtship and wedding of the god Śiva and of Pārvatī, Himālaya's daughter, and the birth of their son, Kumāra. The poem finishes with the slaying of the demon Tāraka, the very purpose of the birth of the warrior-god. 
The Kumāra·sambhava showcases the poet's rich and original imaginative powers making for abundant poetic imagery and wealth of illustration. Again, more than 20 commentaries on the Kumāra·sambhava have survived.
Scientific literature.
The composition of the Vedas led to the rise of different schools dedicated to preserving and promoting the traditions of one or more Vedas. Over time, these branched out and proliferated to cater to the needs of treating other topics and matters. Thus arise the different "śāstra"s, or sciences in various disciplines: grammar, lexicography, geometry, astronomy, medicine, sex, philosophy, etc.
Learning in these schools took place by way of the master expounding the subject orally, using short aphorisms, the sūtras, which on account of their terseness would be meaningful only to those who knew how to interpret them, and to anyone else necessarily esoteric. The "bhāṣyas", the commentaries that followed the sūtras were structured in the style of student-teacher dialogue wherein a question is posed, a partial solut
ion, the "pūrva·pakṣa", proposed, which is then handled, corrected and the final opinion established, the "siddhānta". In time, the bhāṣyas evolved to become more like a lecture.
The sūtras were regarded as definite and inalterable, which was later circumvented, in the field of grammar, by the creation of "vārttikas", to correct or amend sūtras. Another form often employed was the "śloka", which was a relatively simple metre, easy to write and remember. Sometimes a mix of prose and verse was used. Some of the later work, such as in law and poetics, developed a much clearer, scientific style thus avoiding a propensity towards obscurity that verse was prone to.
Dharma literature.
The Vedic practice of sūtras pertaining to the correct performance of ritual was extended to other matters such as the performance of duties of all kinds, and in social, moral and legal spheres. These came to be known as "dharma·sūtra" in contradistinction to the older "gṛhya·sūtras" and "śrauta·sūtras" although no distinction was felt initially. Like other sūtras, this was terse prose peppered with a few ślokas or verses in "triṣtubh" metre to emphasize a doctrine here and there. More broadly, works in the field of civil and religious law come under the banner of "dharma·śāstra".
Examples of such works are:
Manusmṛti.
The most important of all dharma literature however is the "manu·smṛti", or the "mānava·dharma·śāstra". Composed in verse form, and intended to apply to all human beings of all castes, to secure acceptance of the work, divine provenance was claimed. Thus the reference to "Manu" the primordial man, the sage who escaped the deluge known to be the dispenser of justice.
The Manu·smṛti deals with a wide variety of topics including marriage, daily duties, funeral rites, occupation and general rules of life, lawful and forbidden food, impurity and purification, laws on women, duties of husband and wife, inheritance and partition, and much more. 
There are chapters devoted to the castes, the conduct of different castes, their occupations, the matter of caste admixture, enumerating in full detail the system of social stratification. The Manu·smṛti has been dated to the couple of centuries around the turn of the Common Era. According to recent genetic research, it has been determined that it was around the first century CE that population mixture among different groups in India, prevalent on a large scale from around 2200 BCE, ground to a halt with endogamy setting in.
Hindu texts.
Hindu Sanskrit texts are manuscripts and historical literature that can be subdivided into two classes.
Śruti.
The diverse traditions of "Śruti" are believed to be 'revealed', examples being the Vedas and the early Upaniṣads. Many scholars include the Bhagavad·Gītā and Āgamas as Hindu scriptures, while Dominic Goodall includes Bhagavata Purāṇa and Yājñavalkya Smṛti.
Smṛti.
The "Smṛti" Sanskrit texts are a specific body of Hindu texts attributed to an author, as a derivative work they are considered less authoritative than "Śruti" in Hinduism. The Smrti literature is a vast corpus of diverse texts, and includes but is not limited to Vedāngas, the Hindu epics, the Sūtras and Śāstras, the texts of Hindu philosophies, and the Purāṇas, while some traditions also include the Kāvya or poetical literature, the "Bhāṣyas", and numerous "Nibandhas" covering politics, ethics, culture, arts and society.
Oral tradition.
Most ancient and medieval Hindu texts were composed in Sanskrit. In modern times, most ancient texts have been translated into other Indian languages and some in Western languages. Prior to the start of the common era, the Hindu texts were composed orally, then memorized and transmitted orally, from one generation to next, for more than a millennium before they were written down into manuscripts. This verbal tradition of preserving and transmitting Hindu texts, from one generation to next, continued into the modern era.
Jaina texts.
Tattvartha Sutra is a Jain text written in the Sanskrit language. It is regarded as one of the earliest, most authoritative books on Jainism, and the only text authoritative in both the "Digambara" and "Śvētāmbara" sects.Shant Sudharas Bhavana is a famous book in Jainism written by Jain monk Vinay Vijay also called as Yashovijay.
Miscellaneous works.
Dramas, poems and stories were written in Sanskrit language in ancient India. Some of the popular ones are:
Pañcatantra, Hitopadeśa, Rajatarangini,
Daśakumāracarita, Mṛcchakaṭika, Mudrārākṣasa,
Ratnavali, Nagananda, Priyadarsika,
Mattavilasa Prahasana, Vetala Pañcaviṃśati, Siṃhāsana Dvātriṃśikā.
Bhasa's Svapnavāsavadattam, Pancarātra, and Pratijna Yaugandharayaanam, Pratimanātaka, Abhishekanātaka, Bālacharita, Dūtavākya, Karnabhāram, Dūtaghaṭotkaca, Chārudatta, Madhyamavyayoga and Urubhanga.
Kalidasa's Vikramōrvaśīyam, Mālavikāgnimitram, Abhijñānaśākuntalam, Ṛtusaṃhāra and Meghadūta.
Kādambari is a romantic novel in Sanskrit. It was substantially composed by Bāṇabhaṭṭa in the first half of the 7th century CE.
Mattavilāsa·prahasana is a short one-act Sanskrit play. It is one of the two great one act plays written by Pallava King Mahendravarman I (571– 630CE) in the beginning of the seventh century in Tamil Nadu.
Madhurā·vijayam is a 14th-century C.E Sanskrit poem written by the poet Gangadevi. It is also named "Vira Kamparaya Caritham" by the poet. It chronicles the life of Kumara Kampanna Udayar or Kumara Kampanna II, a prince of the Vijayanagara Empire and the second son of Bukka Raya I. The poem describes in detail, the invasion and conquest of the Madurai Sultanate by the Vijayanagara empire.
Modern Sanskrit literature.
Literature in Sanskrit continues to be produced. These works, however, have a very small readership. In the introduction to "Ṣoḍaśī: An Anthology of Contemporary Sanskrit Poets" (1992), Radhavallabh Tripathi writes:
Most current Sanskrit poets are employed as teachers, either pandits in "pāṭhaśāla"s or university professors. However, Tripathi also points out the abundance of contemporary Sanskrit literature:
Similarly, , in "Post-Independence Sanskrit Literature: A Critical Survey", estimates that more than 3000 Sanskrit works were composed in the period after Indian Independence (i.e., since 1947) alone. Further, much of this work is judged as being of high quality, both in comparison to classical Sanskrit literature, and to modern literature in other Indian languages.
Since 1967, the Sahitya Akademi, India's national academy of letters, has had an award for the best creative work written that year in Sanskrit. In 2009, Satyavrat Shastri became the first Sanskrit author to win the Jnanpith Award, India's highest literary award.
Vidyadhar Shastri wrote two epic poems ("Mahakavya"), seven shorter poems, three plays and three songs of praise ("stavana kavya"), he received the "Vidyavachaspati" award in 1962. Some other modern Sanskrit composers include Abhiraj Rajendra Mishra (known as "Triveṇī Kavi", composer of short stories and several other genres of Sanskrit literature), Jagadguru Rambhadracharya (known as "Kavikularatna", composer of two epics, several minor works and commentaries on "Prasthānatrayī").
Another great Sanskrit epic that remained largely unrecognised till lately is "Dhruv Charitra" written by Pandit Surya Dev Mishra in 1946. He won laurels of appreciation by renowned Hindi and Sanskrit critics like Hazari Prasad Dwiedi, Ayodhya Singh Upadhyay "Hariaudh", Suryakant tripathi "Nirala", Laldhar Tripathi "Pravasi".