A restless crowd gathers outside the Central Library of the Los Angeles Public Library system in mid-November, puzzled to find the city’s most historic library closed on a Wednesday afternoon. These readers wander around the literary fortress nestled between skyscrapers, hoping to discover some secret entrance that everybody else has missed. They are the most hermetic souls in L.A.: writers looking for a literary escape, students seeking a quiet corner, and homeless people searching for an afternoon refuge.

Steven Rowley emerges from amid this band of loners, just as confused as everybody else. He tells me that he likes to write at the Central Library and the West Hollywood branch of the public library, hiding away among the shelves. He avoids the crowds in coffee shops, choosing the company of fellow authors instead. “There’s something symbolic about being surrounded by fiction when you’re writing fiction,” he says.

Rowley has a long history with libraries. “My mother would drop me and my sister off at the library,” he says, recalling long summer days growing up in Portland, Maine. “That’s where I discovered the joys of reading and getting absolutely lost in a story.”

Thanks to a staff training event, the Central Library is closed for the rest of the day. So we head a block away to the Library Bar, another downtown literary institution. Every writer has a fond memory of a book party or publisher launch held in this book-lined bar that serves cocktails whose names pun on titles of famous novels: Ready Player Rum, Gone with the Gin, Of Mice and Mezcal, etc. Even in the afternoon, the bar is filled with young and hip Angelinos.

Rowley wears his beard neatly trimmed, and his warm grin is immediately recognizable from his Instagram profile picture. He’s friendly and sincere but far more comfortable in the library than a busy cocktail lounge.

After college, Rowley struck out on his own, leaving the long winters of Maine for the endless summer in L.A., where he gradually built a career as a screenwriter. He carved out a solitary daily life writing at home and in library stacks, but through it all, he nurtured a long and meaningful relationship with his pet dachshund, Lily. When his beloved companion died at 14, he found himself unmoored by his grief.

Rowley channeled those feelings into a novel, Lily and the Octopus (2016), that broke every convention he’d learned while writing scripts. The slim, magical book told the story of a writer very much like Rowley, who fights to save his dachshund from an evil octopus that has attached itself to his pet’s head. The novel transforms the pathos of losing a beloved companion with fantastical flourishes: hilarious conversations with his dog, battles with animated pool toys, and a seafaring adventure straight out of Moby-Dick.

The book began as an intensely personal project that Rowley thought he might self-publish, but thanks to the help of his freelance editor Molly Lindley, the manuscript would up on the desk of Simon & Schuster editor Karyn Marcus. What happened next is, as the Publishers Weekly story about the deal explained, “the stuff of literary fairy tales,” as the debut novel landed a nearly seven-figure advance and made a surprise run on the bestseller charts. “Everyone’s like, ‘Oh, you’re an overnight success,’ ” Rowley says. “But they didn’t see the 15 years of writing and not getting off the ground that goes into it. No one ever talks about that!”

Lily and the Octopus depended on the support of two great editors, and Rowley’s second novel, The Editor, due out in April from Putnam, pays tribute to these literary parental figures who help writers survive the years of struggle leading up to “overnight success.” The Editor tells the story of a gay writer named James Smale, who experiences his own literary fairy tale while living in New York City during the 1990s: his debut novel gets acquired by former first lady Jacqueline Kennedy Onassis during her tenure as a Doubleday editor, which lasted from 1978 until her death in 1994.

Kennedy Onassis started as an editor at Viking in the 1970s, beginning her editorial career with Remember the Ladies—a book about the accomplishments of 18th-century women, written to accompany a traveling show for the U.S. bicentennial. She left Viking in 1975 to join Doubleday. Her list at the publisher included ballet dancer Gelsey Kirkland’s Dancing on My Grave and Louis Auchincloss’s False Dawn: Women in the Age of the Sun King, among others.

“In many respects, I think this is the most interesting time of her life, but I’ve never seen it represented in pop culture,” Rowley says, explaining why the concept stuck in his imagination. “The hard part about writing Jackie as a character is that everyone has a preconceived idea of who she was. But this is a time in her life that was not really seen, so there’s a little bit of wiggle room to create some magic.”

The novel—like Kennedy Onassis’s career—spans a period of consolidation and transition for the publishing industry. In 1986, Doubleday was sold to the German communications company Bertelsmann. At the moment young James publishes his novel with Kennedy Onassis, Doubleday is in the process of moving its editorial offices into 1540 Broadway, finally assimilating into the Bertelsmann mothership.

Rowley began his career in this tumultuous literary environment of the mid-1990s, working at an L.A. literary agency for his first job after college. “I stepped in at the moment when the business was in flux,” he says, recalling worries about the demise of book parties, the diminishing celebrity cache of authors, and the eventual rise of e-books. “This was the beginning of the idea that there might not be books anymore.”

Thanks to the ongoing forces of incorporation, the book has endured, and Rowley’s own novel is now part of the same conglomerate that once absorbed Doubleday: Putnam is now an imprint of the Penguin Random House.

Even though a book deal with Kennedy Onassis seems like a dream come true for a young writer, Rowley’s fictional hero soon finds himself struggling to meet his editor’s expectations and faces the wrath of his mother, a formidable woman who doesn’t appreciate the fact that James’s novel exposes family secrets. Rowley is reckoning with his own story through this fictional conflict. Lily and the Octopus blended autobiography and magical realism, and some people in his life were unhappy with the way they were portrayed.

In The Editor, Rowley finds moving ways to resolve these professional and family tensions. When James reaches the end of his publishing journey in the novel, Rowley pays tribute to the supportive parents and visionary publishing professionals in his life. “Editors are mothers of sorts,” he writes in The Editor, connecting his life-changing bond with literary guardians to family relationships in what he calls a “tip of the hat” to those who shepherded his talent.