Cape Cod may be known for its sunny beaches and array of ice creams, but it also has a long and deep history filled with episodes of violence and war.

“I think this was one of the stories where 90 years ago 10 out of 10 people knew about it, and maybe 50 years ago five out of 10 people knew about it and in the '90s and early '00s, no one really knew about it,” Jake Klim says. “The stories have been lost.”

Klim is talking about the submarine attack on Orleans, a raid that occurred in the midst of World War I, an event considered the only point of enemy attack on American soil during the war. Klim tells the story, the event for which only spanned about 90 minutes, in his new book “Attack on Orleans: The World War I Submarine Raid on Cape Cod,” (The History Press, 126 pages, $19.99).

Klim wrote the book for many reasons, one of which was the 100th anniversary of the start World War I, which began July 28, 1914. Klim believes people are interested in the events of the war, even the lesser known ones like the submarine attack, which occurred on July 21, 1918. While he has a particular interest in the attack on Orleans (he's from the area), he's more interested in giving readers the chance to remember those who participated in it.

“I really think this was a story lost in history. There were heroes that day,” Klim says.

Klim not only outlines what happened during the attack, but also the men involved in resisting the enemy. There are pages and pages describing the local men Klim calls heroes, and plenty of old photos, the result of his spending hours on research and digging through lost histories.

For Bonnie Stacy, who doubles as a curator at the Martha's Vineyard Museum, words gave way to showcasing the island's history through photographs and captions. For example, the first few pages of the book show portraits of families who worked in Edgartown along with places that they may have seen on a daily basis.

“We have a fabulous photo collection and this seemed like the perfect opportunity (to showcase it),” Stacy says.

In “Martha's Vineyard,” (Arcadia Publishing, 143 pages, $26.99), Stacy wanted to focus on the island as a whole instead of dividing it into sections.

“People think of the island as the six towns that are here,” Stacy says, “but I wanted to focus on what the six towns have in common.”

She says the book is a way to capture life almost exactly as it was through the past.

“People like to see the way things have stayed the same,” she says.

The same is true for the town of Hatchville which has, over the years, remained largely agricultural.

An avid horticulturist himself, author Les Garrick of Falmouth chose to focus on Hatchville because of its lengthy farming past.

He says that when he began writing “Historic Hatchville: Horse and Farm Country on Cape Cod” (The History Press, 205 pages, $19.99), people thought he would focus on the Hatch family, for whom the town was named. Instead, he told the story around Wilfrid Wheeler, who, in 1919, became the first Commissioner of Agriculture in Massachusetts.

With the mission of increasing the number of farms on the Cape, Wheeler, along with others, bought 2,500 acres of land in Hatchville.

“There was a group of farmers who persisted from 1940-1960 and even beyond. even in tough times they hung together and supported one another and did a marvelous job of just keeping the character of the village together,” Garrick says.

Wareham has also gotten its due this summer. In “A Brief History of Wareham: The Gateway to Cape Cod,” (The History Press, 172 pages, $19.99), Michael J. Vieira outlines the ups and downs the town has had since its incorporation 275 years ago, even delving into the history of the Wampanoags, who knew Wareham first. Vieira thinks that readers will be interested Wareham now because of its anniversary.

“If you look at the history of the country and the industrial revolution, it all happened in Wareham at some point,” Vieira says.

He explains that Wareham is a section of the Cape that is often overlooked, and it was a goal when writing his book to convey to the reader that, with its vast history, it shouldn't be. He says that, in the '30s, '40s and '50s, Wareham became the “gateway to the Cape,” because people had to drive through it to get to tourist destinations like Hyannis.

“You had to spend a whole bunch of time in Wareham because you were stuck in traffic,” Vieira says.

Wareham is also notable for its contribution to the War of 1812, specifically in the attack on the town by a fleet of British warships led by HMS Nimrod. In “The Attack of the HMS Nimrod: Wareham and the War of 1812,” (The History Press, 142 pages, $19.99), J. North Conway and Jesse Dubuc outline the hours-long affair that almost cost the U.S. the war.

“There's this notion that America was always the strongest country and able to get out of anything,” Dubuc says, “but if it wasn't for a few incredible turns of luck, we'd be part of Canada right now.”

The fleet had been hitting towns in New England (including ones close to Wareham like New Bedford) and chose to attack Wareham because of its lack of military power. The British left the town in ruins, even at one point taking the town physician hostage. The British, unlike the town of Wareham, escaped unscathed.

“Even though people are aware of the attack, the story of it had not been told,” Conway says.