Skip to content

Creator doesn't set main_page properly #36

@rgaudin

Description

@rgaudin

While Creator requires the main_page argument, it is not set properly on the output ZIM, resulting in the main_page…

with libzim.writer.Creator(
    "test_x01.zim",
    main_page="A/index.html",
    index_language="eng",
    min_chunk_size=2048,
) as zfile:
    zfile.add_article(DumbArticle("index.html", "hello", ARTICLE_MIME, "bonjour"))
    zfile.add_article(DumbArticle("allo.html", "allo", ARTICLE_MIME, "allo how low"))

zfile = libzim.reader.File("test_x01.zim")
print(zfile.main_page_url)
> A/allo.html
print(zfile.get_article("A/index.html"))
> ReadArticle(url=A/index.html, title=)
print(zfile.get_article(zfile.main_page_url))
> ReadArticle(url=A/allo.html, title=)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions