Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions novelwriter/assets/i18n/project_en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"Entities": "Entities",
"Custom": "Custom",
"New Page": "New Page",
"Contents": "Contents",
"0": "Zero",
"1": "One",
"2": "Two",
Expand Down
2 changes: 2 additions & 0 deletions novelwriter/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ class nwLabels:
nwBuildFmt.ODT: QT_TRANSLATE_NOOP("Constant", "Open Document (.odt)"),
nwBuildFmt.FODT: QT_TRANSLATE_NOOP("Constant", "Flat Open Document (.fodt)"),
nwBuildFmt.DOCX: QT_TRANSLATE_NOOP("Constant", "Microsoft Word Document (.docx)"),
nwBuildFmt.EPUB: QT_TRANSLATE_NOOP("Constant", "Electronic Publication E-book (.epub)"),
nwBuildFmt.HTML: QT_TRANSLATE_NOOP("Constant", "HTML 5 (.html)"),
nwBuildFmt.NWD: QT_TRANSLATE_NOOP("Constant", "novelWriter Markup (.txt)"),
nwBuildFmt.STD_MD: QT_TRANSLATE_NOOP("Constant", "Standard Markdown (.md)"),
Expand All @@ -366,6 +367,7 @@ class nwLabels:
nwBuildFmt.ODT: ".odt",
nwBuildFmt.FODT: ".fodt",
nwBuildFmt.DOCX: ".docx",
nwBuildFmt.EPUB: ".epub",
nwBuildFmt.HTML: ".html",
nwBuildFmt.NWD: ".txt",
nwBuildFmt.STD_MD: ".md",
Expand Down
8 changes: 8 additions & 0 deletions novelwriter/core/docbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from novelwriter.core.project import NWProject
from novelwriter.enum import nwBuildFmt
from novelwriter.error import formatException, logException
from novelwriter.formats.epub import ToEPub
from novelwriter.formats.todocx import ToDocX
from novelwriter.formats.tohtml import ToHtml
from novelwriter.formats.tokenizer import Tokenizer
Expand Down Expand Up @@ -174,6 +175,13 @@ def iterBuildDocument(self, path: Path, bFormat: nwBuildFmt) -> Iterable[tuple[i
yield from self._iterBuild(makeObj, filtered)
makeObj.closeDocument()

elif bFormat == nwBuildFmt.EPUB:
makeObj = ToEPub(self._project)
filtered = self._setupBuild(makeObj)
makeObj.initDocument()
yield from self._iterBuild(makeObj, filtered)
makeObj.closeDocument()

elif bFormat == nwBuildFmt.PDF:
makeObj = ToQTextDocument(self._project)
makeObj.disableAnchors()
Expand Down
15 changes: 8 additions & 7 deletions novelwriter/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,14 @@ class nwBuildFmt(Enum):
ODT = 0
FODT = 1
DOCX = 2
PDF = 3
HTML = 4
STD_MD = 5
EXT_MD = 6
NWD = 7
J_HTML = 8
J_NWD = 9
EPUB = 3
PDF = 4
HTML = 5
STD_MD = 6
EXT_MD = 7
NWD = 8
J_HTML = 9
J_NWD = 10


class nwStatusShape(Enum):
Expand Down
Loading