Skip to content

Commit

Permalink
fixup! Add Devdocs offliner, category and warehouse path
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Sep 26, 2024
1 parent e4c7407 commit 4547867
Showing 1 changed file with 15 additions and 38 deletions.
53 changes: 15 additions & 38 deletions dispatcher/backend/src/common/schemas/offliners/devdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,34 @@ class DevDocsFlagsSchema(SerializableSchema):
class Meta:
ordered = True

all_flag = fields.Boolean(
truthy=[True],
falsy=[False],
metadata={
"label": "All",
"description": "Fetch all Devdocs resources, and produce one ZIM "
"per resource.",
},
data_key="all",
)

slug = String( # should be ListOfString but not yet supported by Zimfarm
slug = String(
metadata={
"label": "Slug",
"description": "Fetch the provided Devdocs resource. "
"Slugs are the first path entry in the Devdocs URL. "
"For example, the slug for: `https://devdocs.io/gcc~12/` is `gcc~12`.",
"For example, the slug for: `https://devdocs.io/gcc~12/` is `gcc~12`. "
"Mutually exclusive with `All` setting, set only one option. Either this"
"setting or `All` must be configured.",
},
)

first = fields.Integer(
all_flag = fields.Boolean(
truthy=[True],
falsy=[False],
metadata={
"label": "Number of first items",
"description": "Fetch only the first N items per slug as shown "
"in the DevDocs UI. Do not set to fetch all items.",
"label": "All",
"description": "Fetch all Devdocs resources, and produce one ZIM "
"per resource. Mutually exclusive with `Slug` setting, set only "
"one option. Either this setting or `Slug` must be configured.",
},
data_key="all",
)

skip_slug_regex = String(
metadata={
"label": "Skip slugs regex",
"description": "Skips slugs matching the given regular expression."
"Do not set to fetch all slugs",
"Do not set to fetch all slugs. Only useful when `All` is set.",
},
data_key="skip-slug-regex",
)
Expand Down Expand Up @@ -95,8 +90,8 @@ class Meta:
metadata={
"label": "ZIM long description",
"description": "ZIM long description. You can use placeholders, see "
"https://github.com/openzim/devdocs/blob/main/README.md. Defaults "
"to `{full_name} docs by DevDocs`",
"https://github.com/openzim/devdocs/blob/main/README.md. Defaults to no "
"long description",
},
data_key="long-description-format",
validate=validate_zim_longdescription,
Expand Down Expand Up @@ -142,21 +137,3 @@ class Meta:
falsy=[False],
metadata={"label": "Debug", "description": "Enable verbose output"},
)

devdocs_frontend_url = String(
metadata={
"label": "DevDocs frontend URL",
"description": "Scheme and hostname for the devdocs frontend."
"Defaults to https://devdocs.io",
},
data_key="devdocs-frontend-url",
)

devdocs_documents_url = String(
metadata={
"label": "DevDocs documents URL",
"description": "Scheme and hostname for the devdocs documents server."
"Defaults to https://documents.devdocs.io",
},
data_key="devdocs-documents-url",
)

0 comments on commit 4547867

Please sign in to comment.