Skip to content
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
7 changes: 7 additions & 0 deletions _static/key-meta.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ p.key-meta-union {
font-size: 1em;
color: var(--text-color);
}

/* A condition on the presence of a key sits right under its type,
in the italic of the "(required)" mark it stands in for. */
p.key-condition {
margin-top: -0.4rem;
font-style: italic;
}
18 changes: 18 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import warnings

from docutils import nodes
from docutils.parsers.rst import roles
from sphinx.deprecation import RemovedInSphinx90Warning

warnings.filterwarnings("ignore", category=RemovedInSphinx90Warning)
Expand Down Expand Up @@ -46,6 +48,22 @@ def _flag_expandable_toc_entries(app, pagename, templatename, context, doctree):
entry["has_children"] = bool(sections)


# One type chip on a key's type line, for the keys accepting several
# types. A docutils generic role cannot hold a link, so a chip written
# as ``:meta-type:`URL <url-type>``` delegates to the std ref role and
# links to the definition of the type.
def _meta_type_role(name, rawtext, text, lineno, inliner, options=None, content=()):
chip = nodes.inline(rawtext, "", classes=["meta-type"])
if "<" not in text:
chip += nodes.Text(text)
return [chip], []
ref, messages = roles.role("ref", inliner.language, lineno, inliner.reporter)
children, ref_messages = ref("ref", rawtext, text, lineno, inliner, options or {}, content)
chip.extend(children)
return [chip], [*messages, *ref_messages]


def setup(app):
# priority > 500: after the theme handler that builds toctree_data
app.connect("html-page-context", _flag_expandable_toc_entries, priority=501)
app.add_role("meta-type", _meta_type_role)
20 changes: 10 additions & 10 deletions docs/standard/forks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ a technical fork from the original codebase.
Parsers
~~~~~~~

Parsers **SHOULD** identify a technical fork by noticing that the
Parsers SHOULD identify a technical fork by noticing that the
top-level :ref:`url <url>` key does not point to the repository in which the
``publiccode.yml`` is found.

Parsers **MAY** also identify a technical fork through metadata
Parsers MAY also identify a technical fork through metadata
exposed by the code hosting platform (e.g. GitHub marks forks
explicitly as forks).

Authors
~~~~~~~

Authors of technical forks **SHOULD NOT** modify ``publiccode.yml`` in
any way. Specifically, they **MUST NOT** modify the top-level :ref:`url <url>`
key that **MUST** continue pointing to the original repository.
Authors of technical forks SHOULD NOT modify ``publiccode.yml`` in
any way. Specifically, they MUST NOT modify the top-level :ref:`url <url>`
key that MUST continue pointing to the original repository.

No key marks a fork as technical, by design: authors of technical
forks do not need to know ``publiccode.yml`` or how to edit it, and
Expand Down Expand Up @@ -64,12 +64,12 @@ meanwhile, so that others can find it and use it.
Parsers
~~~~~~~

Parsers **SHOULD** identify a variant by noticing that the top-level
Parsers SHOULD identify a variant by noticing that the top-level
:ref:`url <url>` key matches the repository in which the ``publiccode.yml`` is
found, **AND** a top-level :ref:`isBasedOn <is-based-on>` exists and points to a
different repository.

Parsers should expect and analyze other differences in
Parsers SHOULD expect and analyze other differences in
``publiccode.yml`` between variants of the software. In particular,
``description/[lang]/features`` is designed to be compared across
variants to show their user-visible differences.
Expand All @@ -79,7 +79,7 @@ variants to show their user-visible differences.
Authors
~~~~~~~

Authors who publish a fork as a variant **MUST** at least:
Authors who publish a fork as a variant MUST at least:

- Add a key :ref:`isBasedOn <is-based-on>` pointing to one or more
upstream repositories from which this variant is derived.
Expand All @@ -90,9 +90,9 @@ Authors who publish a fork as a variant **MUST** at least:
- Revisit the :ref:`maintenance <maintenance>` section to refer to
the maintenance status of the variant.

Moreover, authors **SHOULD** evaluate the following changes:
Moreover, authors SHOULD evaluate the following changes:

- Add the features that differentiate the variant to the
``description/[lang]/features`` key. Existing features **SHOULD NOT** be
``description/[lang]/features`` key. Existing features SHOULD NOT be
edited or removed from this list unless they have been removed from
the variant, to allow parsers to easily compare feature lists.
Loading
Loading