This article accompanies the fable
The basic story is this: Mary's parents (Joachim and Anna) are unable to have a child until angels intervene. After a remarkable childhood, she is married off to the much older widower, Joseph, when a dove springs out of his staff (sexual imagery!) at the temple, identifying him as the rightful spouse-to-be. Some years later when Joseph is away, the angel reappears and she discovers she is pregnant. It isn't hard to see what may have happened, and naturally Joseph is angry that she has been unfaithful, but all's well that ends well when it turns out that Mary is still a virgin!
It was the more racy ideas like this -- her perpetual virginity and her saving grace as the New and Improved Eve -- that made this apocryphal book so popular and influential in its time. Even Anna got her own cult in the East. Another cult, the all-women Collyridians, began actively worshipping the Virgin Mary as divine, consecrating the bread and wine as the "Body and Blood of Mary." They were stamped out as a heresy.
The scholar Origen also muddied things by attacking (and thus circulating) Celsus' accusation that Joseph had turned Mary out because she was convicted of adultery after becoming pregnant to a Roman soldier named Panther. Even more surreally, Origen also argued that Mary was married off to Joseph so that Jesus would remain hidden and Satan would not realize his divine nature...
In the 8th and 9th centuries, much of this material was reworked into Latin in The Gospel of the Birth of Mary and the Childhood of the Savior (aka these days as The Gospel of Pseudo-Matthew) and then The Golden Legend, de Voragine's bestseller of the 13th century. It was The Golden Legend that popularized Saint Margaret of Antioch, who figures prominantly in the Joan of Arc story. The illustration below of Saint Margaret is by Jean Fouquet, the most significant French painter of Joan's century.
For Fouquet's most amazing painting, go here.