Currrently, builds for patches are broken because the version numbers
generated for them are not valid according to PEP 440 [1].
This has to be solved in several steps, in coordination with the
packaging code. Procedure will be the same as for core.sr.ht:
https://git.sr.ht/~sircmpwn/core.sr.ht/commit/57ee3427
The only difference is that the extra build step (running `make`) will
remain in `setup.py` (as there is no generic mechanism for this in
`pyproject.toml`). This just means the build process will still always
have to be performed with setuptools as backend.
[1] https://peps.python.org/pep-0440
Currently, no one except the owner can access private wikis. This commit
provides access to private wikis to non-owners based on their access to
the backing git repository.
This allows collaborating with other people on private wikis.
Currently, creating new repos when setting up a new wiki fails because
man.sr.ht does not specify the visibility of the repo to be created.
This commit fixes this by allowing the user to choose the visibility
in the "Create a new repo" form and passing the selected value to the
API call for repo creation.
Fixes: https://todo.sr.ht/~sircmpwn/man.sr.ht/58
This code is designed to put the first paragraph ahead of the table of
contents, but it could cause issues if the first HTML element was not a
paragraph tag, or if the page had the ToC disabled or had no headings.
The "existing" branch in the template is used on the repo select screen
to filter out repositories which already have a wiki created for them.
This change adds a short-circuit which avoids the check in other
situations.
While I'm here I also tweaked the appearance of this page a bit.
This adds links back to the wiki root index in two places: on the
pseudo-breadcrumbs with the username and wiki name, and on the "article"
tab. This makes it possible to navigate back to the wiki index from any
wiki page, whereas before it was impossible. The new links also fixes
the most counterintuitive link on the page, as the "article" tab linking
back to the site root (/) is very strange and unexpected.
The routes for `user_content` in mansrht/blueprints/html.py include a
tilde ('~') in them, which is required for the route to function
properly. However, .canonical_name already includes a tilde[a]. This
causes in a bug where any usage of user_content with the
owner.canonical_name field will result in a generated url where the
username is prefixed with two tildes ("~~nytpu") rather than one.
This replaces the usages of owner.canonical_name with owner.username
which is identical to .canonical_name (see link [a]) except that it does
not have a leading tilde.
[a]: 99a8168de4/item/srht/oauth/user.py (L37)
piggyback the header-extension style used in git.sr.ht for repository
descriptions in order to move wiki owner out of the wiki title while
keeping it visually adjacent. Link username to wiki profile page.
Intended to address sr.ht-discuss: Wiki "Public" page
<C96YNX5WZPFC.1CU197QUTFYCI@taiga>
This patch provides a default value so that a None is not inserted
into the HTML view
Issue reported to the mailing list:
> If a wiki page is e.g.
>
> # Foo
> ## Bar
>
> then it renders like
>
> None
> {{table of contents}}
> # Foo
> ## Bar