Guide › Writing

Exporting a document or a book, and sharing it

Export writes your document out in another format, Markdown, plain text, HTML, Word, PDF, EPUB or FB2, or copies it to the clipboard. An export holds the text as it reads on the page, and from a chapter you may export the chapter alone or the whole book. Share opens a post with the page's text on X, Bluesky, Threads or LinkedIn.

Exporting a file

To export, click the document's name at the top left to open the file menu, then choose Export. The menu that opens in its place lists the formats: Markdown…, Plain text…, HTML…, Word…, PDF…, EPUB… and FB2….

The Export menu in a chapter of a book: This chapter and The book at its top, the formats, then Copy as Markdown and Copy as plain text

Pick one, and Mayhap asks where to write the file, suggesting the document's name with the format's extension. For example, The Harbour Year.pdf. Once the file is written, the top bar says so: Exported The Harbour Year.pdf.

If you type a name without its extension, Mayhap adds it. When a file with that name is already there, nothing is written, and the top bar says “The Harbour Year.md” is already there; save under another name. Likewise, an export never writes over the document it comes from.

The formats

Markdown
The text as you wrote it, with its Markdown marks.
Plain text
The text without Markdown's marks. A link keeps its text, list items start with a dash or their number, and quotes start with >.
HTML
One web page you may open in any browser, with a readable column, titled with the document's first heading.
Word
A .docx document with Word's own headings, lists, quotes and links.
PDF
A page set as a book. You can learn more about this in the next section.
EPUB
An EPUB 3 book for e-readers and reading apps, with a contents list built from its chapters' titles.
FB2
A FictionBook 2 book, with its title, author and language, each chapter a section of its own.

Footnotes go out in each format's own way: real footnotes in Word, notes at the foot of the page in a PDF, footnotes a reader may show over the page in EPUB, and a section of notes at the end of an HTML page or a plain-text file.

PDF

Mayhap sets a PDF as a book. The page is A4, or Letter where your system's region is the US or Canada. The text is set in Literata, which comes with Mayhap, with page numbers at the foot of each page.

If you would like the PDF in another font, choose one under Font for PDF in Settings › Writing. If that font lacks a letter your text uses, Mayhap takes it from Literata and says This font lacks letters the book uses. after the document's name.

The text in a PDF is real text: you may search it and copy from it, in any language Literata covers. A language Literata doesn't cover, such as Chinese or Arabic, needs a font that has it, chosen under Font for PDF.

What goes into an export

An export holds your text as it reads on the page. For each word, sentence or paragraph that has versions, it holds the version shown and nothing else. Maybes are left out, and so is Aside.

In other words, the file holds only the text you've kept. If you'd like a maybe in the export, choose Keep it on it first. You can learn more about this in Maybes.

Copying as Markdown or plain text

Sometimes you may wish to paste the text somewhere else instead of writing a file. To do so, choose Copy as Markdown or Copy as plain text at the foot of the Export menu. The text goes to the clipboard, by the same rules as the exports.

Exporting a book

In a chapter of a book, the Export menu starts with a switch: This chapter or The book. Click it, or press ← and →, to choose. The window remembers your choice, and it starts on This chapter.

The book writes every chapter in the book's order. A chapter open in a window goes out as it is there, unsaved changes included. Each format puts the chapters together in its own way:

  • Markdown and plain text: one chapter after another, with a rule between two.
  • HTML: one page, with a section for each chapter.
  • Word: each chapter on a new page.
  • PDF, EPUB and FB2: each chapter as a chapter of the book.

A chapter's title is its first heading, or its file's name when it has none. If a chapter can't be read, nothing is written, and the top bar names it, such as Couldn't read Storm, so the book wasn't exported. You can learn more about books in Writing a book in chapters.

The book's PDF, EPUB and FB2

A book's PDF opens with its cover on the first page, then a title page with the book's name and the author under it. Each chapter starts a new page, its title a little lower down. A chapter exported alone has no cover and no title page.

The EPUB and the FB2 carry the book's title, author, language and cover. An EPUB keeps the same identity from one export to the next, so a reading app takes a new copy for the book it already has.

The cover, the author and the book's name come from the book's card.

Sharing on X, Bluesky, Threads or LinkedIn

To share the page, open the file menu and choose Share, then X, Bluesky, Threads or LinkedIn. You may also run Share from the command palette. Your browser opens on the service's own page for a new post, with the page's text already in it.

The post holds the text as plain text, without Markdown's marks and without your maybes. If the text runs longer than the service takes, Mayhap cuts it at a word and ends it with an ellipsis. Nothing is posted until you post it yourself.

Mayhap needs no account for this and never talks to the service on its own. If the page is empty, it says Nothing to share yet: the page is empty.

Giving exports a key

The exports, the copies and Share have no keys by default. Each is a command of its own in the command palette, such as Export PDF… or Copy as plain text. If you export often, you may give any of them a key in Settings › Shortcuts. You can learn more about this in Keys.

Nothing in the guide matches. Write to us