On February 10, 1835, two women from West Yorkshire, England, tucked into a plum pudding to celebrate the first anniversary of their secret marriage. Around one year earlier, Anne Lister and Ann Walker had moved in together, exchanged rings, and taken communion together in a parish church. Their union was not legally recognized, but they considered themselves married. And on that day in 1835, Lister turned to her diary, as she so often did, to express her happiness.

“May we live to enjoy many more such anniversaries!” Lister wrote.

Now, some 200 years after she dazzled and befuddled her contemporaries, Lister is the subject of “Gentleman Jack,” a new series premiering April 22 on HBO and on the BBC later this spring. Created, written and co-directed by Sally Wainwright, who was also at the helm of the British television shows “Happy Valley” and “Last Tango in Halifax,” “Gentleman Jack” is a rollicking portrait of Lister and the world she inhabited at the height of the Industrial Revolution.

Since 1806, when she was 15 years old, Lister had been unburdening her most intimate thoughts into her journals. She filled thousands of pages with millions of words, around one-sixth of them penned in a secret code of symbols and letters that she developed to conceal her sexual relationships with women. Thanks to modern scholars who have been decoding these passages, Lister has emerged from her diaries as a remarkably confident and exuberant woman who refused to submit to norms that governed the behavior of wealthy young ladies. She bucked codes of “feminine” dress, travelled extensively, studied voraciously, managed her estate, and elbowed her way into the male-dominated coal industry. Through it all, she was unwaveringly adamant that she could “love and only love the fairer sex.”

“I was inspired to write this drama really because of [Lister]—her character, her personality,” Wainwright tells Smithsonian. “She was an extraordinary human being.”

Born in the town of Halifax, Lister displayed a daring, even unruly streak from an early age. “I was a great pickle,” she recalled in 1824. “When my mother thought I was safe, I was running out in an evening. Saw curious scenes, bad women, etc.” But Lister was also intelligent, and her parents allowed her to receive formal academic schooling, an unusual privilege for young women of that era.

It was while studying at a boarding school in the fashionable city of York that Lister started keeping a diary, in which she recorded an intimate relationship with another female student. During her time at the school, Lister was also introduced to a monied, cosmopolitan social circle, which sparked a sense of dissatisfaction with her own position as a member of the moderately wealthy rural gentry. She aspired to heightened status and wealth—qualities that she would eventually seek in a “wife.”

Lister’s family had owned Shibden Hall, a stately home near Halifax, for more than 200 years, a pedigree that mattered a great deal to her. But the house and its surrounding lands were decidedly unmodern; Lister’s bachelor uncle, James, who had inherited Shibden, showed little interest in developing it. Lister, on the other hand, was keenly interested. “She would run the estate, she would check over the workmen, she would manage the finances,” says Helena Whitbread, an editor of Lister’s diaries and the first researcher to publish the coded passages that reveal her sexual affairs with women. “Her uncle knew that the estate would be in very capable hands if she was left in charge of it.”

All four of Lister’s brothers died prematurely, so upon James’ death in 1826, Shibden was left to his entrepreneurial niece. The extent to which Lister’s close relatives were aware of her homosexuality is unclear. Her father, according to Whitbread, seems to have known and quietly accepted his daughter’s preference for women. And her uncle James may have in fact been relieved that his niece was disinclined to legally marry—and therefore was unlikely to fall prey to “unscrupulous fortune-hunters,” notes historian Jill Liddington in Female Fortune, an edited selection of Lister’s writings.

Indeed, rather than entertaining male suitors, Lister was enmeshed in passionate relationships with a string of different women. She was a charismatic and striking figure, who eschewed feminine frills for a get-up of black and was confident in her abilities to woo the ladies she fancied. These dalliances, however, often left her heartbroken. A particularly devastating blow came when Marianna Belcombe, whom Lister loved deeply, married a wealthy male landowner. “The time, the manner, of her marriage,” Lister wrote in 1823. “Oh, how it broke the magic of my faith forever.”

Lister was not immune to the confusion and difficulties that came with being a gay woman during the early 19th century, a time when the notion of sexual relationships between women was so fringe that it was not even included in legislation forbidding male homosexuality. She referred to her lesbianism as her “oddity,” and took careful steps to conceal her sexuality in her diaries. But her contemporaries knew she was different. Lister was the subject of gossip among her social circles, and a target of harassment in the streets. “One man followed her up the bank and tried to put his hands up her skirt to find out if she was a man or a woman,” Whitbread says. “She turned on him and raised her umbrella.”

In spite of these challenges, Lister knew that she would not—could not—marry a man, not even for the sake of convenience and respectability. Though a staunch Anglican and not by any means politically progressive (she referred to women’s rights advocates as “demagogues,” for instance), Lister found peace with her true nature. “She believed she’d been made in God’s image and that she was the way she was because it was innate inside her,” explains researcher Anne Choma, lead consultant for “Gentleman Jack” and author of Gentleman Jack: The Real Anne Lister, a tie-in book for the series. “She would frequently pray and thank God for being who she was.”

In 1832, after a period of travels and yet another heartbreak, Lister settled in back at Shibden. She was 41 and the independent owner of a modest estate, which she hoped to invigorate by developing lucrative coal deposits that sat on the property. She was also lonely. Lister yearned for a stable partnership that would be both financially and romantically advantageous—which is to say that she wanted “a marriage in every possible sense of the word,” writes Liddington.

It is at this point in Lister’s story that “Gentleman Jack,” which borrows its title from a local nickname that appears to have been bestowed upon Lister after her death, begins. “For me, this is when Anne Lister became the most interesting, because she was doing a lot of different things,” says Wainwright. “I wanted to show that there was a lot more to her besides being a gay woman. She was phenomenally intelligent. She was extraordinarily capable.”

A thrilling narrative thread follows Lister, played with gusto by Suranne Jones, as she moves to sink her own coal pits. These industrial ambitions bring Lister into conflict with a prominent but unscrupulous coal dealing family whom she suspects of trespassing on her land. “Gentleman Jack” also explores Lister’s courtship of Ann Walker (played by Sophie Rundle), a shy woman of fragile mental health and the wealthy heiress of a neighboring estate. Lister and Walker had markedly different dispositions, and Walker often balked at the prospect of committing herself to another woman. But Lister was optimistic—if also somewhat mercenary—about their future. “If she was fond of me and manageable,” Lister wrote in 1832, “I think I could be comfortable enough with her.”

During the series’ early phases, Choma would transcribe portions of Lister’s diaries and pass them along to Wainwright as fuel for the show’s script. Wainwright drew heavily on Lister’s writing, spinning her words into dialogue that would resonate with a contemporary audience. “I tried to find a voice that utilized a lot of the language in the journals, but still felt quite alive and fluid,” she says. To convey Lister’s unique energy and appearance, Wainwright and Jones also spent hours honing the character’s gait, voice and other physical mannerisms.

“[We] decided Anne was somebody who invades other people’s personal space without realizing she's doing it,” Wainwright says as an example. “When she’s talking to them she just gets a bit too close because she’s so excited about what she’s talking about.”

Shibden Hall still stands. It is managed by the Calderdale council, and the series was filmed there, presenting few challenges aside from some dangerously weak floorboards that the cast and crew had to studiously avoid. As much as possible, Wainwright, who grew up in Halifax, wanted to immerse a modern audience in Lister’s world—a mission that has expanded beyond “Gentleman Jack.” Using part of a grant that she was awarded by the Wellcome Trust to research and write the series, Wainwright helped fund an initiative to digitize Anne’s diaries, with the goal of making them more widely accessible.

Though these writings are now seen as remarkably important historic documents, the entries dealing with Lister’s sexuality were once a carefully guarded secret. Lister died in 1840 at just 49 years old, felled by an insect sting while traveling in Russia. In the late 19th century, one of Lister’s relatives found her diaries and decoded them, only to hide them away for fear of what might happen if Lister’s lesbianism came to light. Over the following decades, researchers who studied Anne’s writing similarly elected not to publicize the most intimate—and most stunning—passages of her diaries.

In the early 1980s, Whitbread, who is also a Halifax local, stumbled upon the journals while researching Lister’s life for an article she hoped to write about this historic occupant of the town. She spent the next five years transcribing and decoding the diaries, ultimately deciding to publish edited selections because they were “just far too valuable and too intriguing” to be kept hidden. Not all of Lister’s voluminous diary entries have been transcribed, however. Choma says that she and Wainwright are formulating a plan to complete the job.

But how would Lister, who took such care to keep her private thoughts hidden, feel about having her experiences broadcast to a modern audience? While it’s impossible to say with certainty, Choma thinks Lister likely would have approved of being celebrated as an inspirational historic figure—a woman who, though she could not be entirely open about her sexuality, did not run from it.

“[She] was a massive seeker of knowledge and history,” Choma explains. “So I can only say, sitting here now, that if she was looking down on us … she would have a right smile on her face.”