Skip to content

Add Kolibri HTML5 Article constants. #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2025
Merged
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
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.2.9"
"version": "0.2.10"
}
5 changes: 5 additions & 0 deletions le_utils/constants/file_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
HTML5 = "zip"
HTML5_MIMETYPE = ".zip"

# constants for Kolibri article zip format
HTML5_ARTICLE = "kpub"
HTML5_ARTICLE_MIMETYPE = "application/kpub+zip"

# constants for H5P format
H5P = "h5p"
H5P_MIMETYPE = ".h5p"
Expand Down Expand Up @@ -101,6 +105,7 @@
(EPUB, "ePub Document"),
(BLOOMPUB, "Bloom Document"),
(BLOOMD, "Bloom Document"),
(HTML5_ARTICLE, "Kolibri HTML5 Article"),
)


Expand Down
1 change: 1 addition & 0 deletions le_utils/constants/file_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

""" File Type Constants """
# constants for different File types
# TODO: Remove these and put them into ricecooker directly where needed.
VIDEO = "video"
AUDIO = "audio"
DOCUMENT = "document"
Expand Down
4 changes: 4 additions & 0 deletions le_utils/constants/format_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
H5P_THUMBNAIL = "h5p_thumbnail"
H5P_THUMBNAIL_READABLE = "H5P Thumbnail"

KPUB_ZIP = "kpub"
KPUB_ZIP_READABLE = "Kolibri HTML5 Article"

ZIM = "zim"
ZIM_READABLE = "Zim"
ZIM_THUMBNAIL = "zim_thumbnail"
Expand Down Expand Up @@ -121,6 +124,7 @@
(SLIDESHOW_MANIFEST, SLIDESHOW_MANIFEST_READABLE),
(IMSCP_ZIP, IMSCP_ZIP_READABLE),
(BLOOMPUB, BLOOMPUB_READABLE),
(KPUB_ZIP, KPUB_ZIP_READABLE),
)


Expand Down
3 changes: 3 additions & 0 deletions le_utils/resources/formatlookup.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,8 @@
},
"bloomd": {
"mimetype": "application/bloompub+zip"
},
"kpub": {
"mimetype": "application/kpub+zip"
}
}
12 changes: 12 additions & 0 deletions le_utils/resources/presetlookup.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,5 +370,17 @@
"kind": "document",
"allowed_formats": ["bloompub", "bloomd"],
"convertible_formats": []
},
"kpub": {
"readable_name": "Kolibri HTML5 Article",
"multi_language": false,
"supplementary": false,
"thumbnail": false,
"subtitle": false,
"display": true,
"order": 1,
"kind": "document",
"allowed_formats": ["kpub"],
"convertible_formats": []
}
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
setup(
name="le-utils",
packages=find_packages(),
version="0.2.9",
version="0.2.10",
description="LE-Utils contains shared constants used in Kolibri, Ricecooker, and Kolibri Studio.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
Loading