Former Secretary of Defense Jim Mattis said he "did as well as [he] could for as long as [he] could" during his tenure in the Trump administration, according to a new book excerpt published Wednesday by the Wall Street Journal.

Why it matters: The foreign-policy-focused piece — released just days after President Trump's weekend at the G7 summit — represents Mattis' first at-length comments since he left the White House in February after stating that his views were "not aligned" with those of the president.

Between the lines: Mattis' analysis of America's place in the world never mentions Trump by name, but it clearly echoes the views discussed in his resignation letter.

What he's saying:

"A wise leader must deal with reality and state what he intends, and what level of commitment he is willing to invest in achieving that end. He then has to trust that his subordinates know how to carry that out. Wise leadership requires collaboration; otherwise, it will lead to failure."

"Nations with allies thrive, and those without them wither. Alone, America cannot protect our people and our economy. ... A polemicist's role is not sufficient for a leader."

"A leader must display strategic acumen that incorporates respect for those nations that have stood with us when trouble loomed. Returning to a strategic stance that includes the interests of as many nations as we can make common cause with, we can better deal with this imperfect world we occupy together. Absent this, we will occupy an increasingly lonely position, one that puts us at increasing risk in the world."

Go deeper: Mattis resignation letter lists ways he was "not aligned" with Trump