448 Commits

Author SHA1 Message Date
Anders Kaseorg
b8f8056f56 markdown: Use re-exported guess_type to ensure adding EXTRA_MIME_TYPES.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-10-08 23:36:15 -07:00
Anders Kaseorg
f24a0a6b81 ruff: Fix RUF059 Unpacked variable is never used.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-30 16:47:54 -07:00
Anders Kaseorg
40a022dcc3 zephyr: Remove Zephyr mirroring support.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-16 11:18:18 -07:00
Anders Kaseorg
1a05b2c10f tabbed-instructions: Delete activate_correct_tab.
We no longer have any OS-specific tabs; we can just activate the first
one on the server side.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-04 09:37:34 -07:00
Anders Kaseorg
35ce90d4f8 help_relative_links: Delete.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-04 09:37:34 -07:00
Shubham Padia
d333ddb961 help: Remove current help center.
This commit removes the current help center markdown files and any logic
that was used to host those files at help/.

We also remove a bunch of tests, we should the equivalent of those tests
for the new help center. Issues to track: #35649, #35647. These issues
track adding back tests for redirects and broken links.

We had a symlink from templates/zerver/integrations/email.md pointing to
help/using-zulip-via-email.md. We can no longer have that symlink since
the latter has been converted to an MDX file. We have deleted the
symlink and put a markdown file in it's place. Both the files have
comments to edit the other in case of changes.

This commit also makes changes in astro config, astro component paths
and other places to move the starlight help center docs base path from
/starlight_help to /help.

The change to rename /starlight_help/ to /help/ in MDX files is done in
the next commit. If we squash these commits, this line should be
removed.

`./tools/build-help-center` no longer does the conversion step.

We also remove some dead code related to the old help center in
documentation.py.
2025-09-03 09:28:15 -07:00
Alex Vandiver
c68be03df7 markdown: Remove vestigial Twitter code and cache.
Contrary to what the comment implied, the remaining `fetch_tweet_data`
function would never return a cache hit, as it is namespaced by the
current deploy's cache key.
2025-08-27 09:22:56 -07:00
Shubham Padia
5f9860776f test_docs: Remove help specific tests and port rest over to /api.
We do not test relative links here since relative links were only
used in the old help pages. We should probably remove the logic
for relative links after we have done the official cutover to the
starlight help center: #35654.
2025-08-08 11:59:29 -07:00
Shubham Padia
3e60b16ac1 starlight_help: Move help-beta over to starlight_help.
We are starting the cutover process and starlight_help is the directory
we have agreed on to place our new help center project. We do not want
to use `starlight_help` as the URL for the project, but this commit
changes the url from `help-beta` to `starlight_help` temporarily since
we can only change URL once we get rid of the current help center
project. That will be done in a future commit.
2025-08-08 11:59:29 -07:00
Alya Abbott
e712f02c91 help: Document channel folder management functionality.
Updates the left sidebar and relative settings link in both the
current and new help center documentation.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-08-08 07:19:57 -07:00
Lauryn Menard
07ff9ec4f9 help: Add mobile tab for "Rename a topic" instructions. 2025-07-25 10:09:56 -07:00
Anders Kaseorg
ea48a283b1 mypy: Add google-re2-stubs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-07-14 14:33:54 -04:00
Rohan Gudimetla
26abfc4d91 markdown: Render inline audio files using the ![title](url) syntax.
Previouly, there was no option to play the inline audio files
within the web app without downloading or leaving the browser.

This commit adds option to render inline audio files that use
the syntax `![title](url)`.

Fixes #27007
2025-07-11 13:11:56 -07:00
Vector73
ae9336a904 api_docs: Fix missing display_recipient object in API docs.
The `display_recipient` object was not rendered in the API docs
because the case where `items` key was inside `oneOf` block was not
handled in the "api_return_values_table_generator.py".
2025-07-11 12:32:21 -07:00
Rohan Gudimetla
05b6672777 refactor: Extract method handling URLs starting with user_uploads.
This commit extracts the method which handles both relative
URLs starting with `/user_uploads` and `user_uploads`,
converting the latter into former, and attaching the path_id
to it.

This is a preparatory commit to #27007
2025-07-08 15:46:18 -07:00
PieterCK
48e33eed31 url_encoding: Standardize to use encode_hash_component.
Previously we use `hash_util_encode` to encode channel and topic names
to be URL compatible. This uses the more capable `encode_hash_component`
from the recently added `topic_link_utils.py` module. It also moves the
function to `url_encoding.py`
2025-07-03 14:40:49 -07:00
PieterCK
c460dc3c9c url_encoding: Update encode_stream -> encode_channel. 2025-07-03 14:40:49 -07:00
Shubham Padia
d701fec37d markdown: Show inline video previews for dropbox videos.
Fixes https://chat.zulip.org/#narrow/channel/9-issues/topic/.F0.9F.93.82.20video.20preview.20not.20working.20.28Dropbox.29
2025-06-30 11:21:32 -07:00
Shubham Padia
276bc7284f markdown: Rename dropbox_image to dropbox_media.
We are adding video support to the function in upcoming commits and we
need to rename the function for that to be more generic.
We've also added a proper return type in the name of DropboxMediaInfo
TypedDict for the `dropbox_media` function.
2025-06-30 11:21:32 -07:00
Shubham Padia
a0deeae80e help-beta: Introduce NavigationSteps component for settings links.
Fixes #31254.
We are using `SHOW_RELATIVE_LINKS` as the env variable to set if we
want to show relative settings link or non-linked markdown instructions.
We are not trying to determine `SHOW_SETTINGS_LINK` by ourselves. See
https://chat.zulip.org/#narrow/channel/49-development-help/topic/Passing.20sitename.20for.20astro.20project.20in.20production.2E
for more details.
Until the cutover happens, we would need to manually update the mapping
in both the astro component and the python file, but since that mapping
is not frequently changed, that is a tradeoff we can make.
We had to add margin-bottom: 0 to icon styling since starlight was
inserting a margin-bottom of 1.25 em for list items.
2025-06-26 10:46:37 -07:00
Shubham Padia
83755c1aec markdown: Remove unused message_inline_ref.
Fixes #32640.
We cannot remove the styles yet since older dropbox previews will still
be using them. We can remove those in a followup issue.
2025-06-24 13:48:01 -07:00
Shubham Padia
bace83ec5a markdown: Change URL structure for dropbox preview to be up-to-date.
The URL structure for a shared link has changed since this function was
returned and this commit makes sure our code is in compliance with that
structure.

The concept of an album doesn't exist anymore and folders exist in-lieu
of that.

For dropbox links that are folders on non-image files, we show previews
same as any other link previews. It is not possible to get information
about the shared link except whether it is a file or folder. So for
title and description for that linked preview, we use `Dropbox file` or
`Dropbox folder` respectively.

Earlier, we were just having raw=1 as the query param to get the image
file if required, but now for every dropbox sharing link, preserving
query params is important (otherwise we get a 404), this commit makes
changes to address that.

For /sc/ links, it is not possible to generate them anymore (afaik), but
it is possible to view those existing links, so we support that link but
treat it as a folder instead.

You can check
https://www.dropboxforum.com/discussions/101001012/shared-link--scl-to-s/689070/replies/695266
for URL structure info.

We have used inline ignore for codespell since fo can be a valid
misspell of `of` and we don't want to ignore that.

https://chat.zulip.org/#narrow/channel/9-issues/topic/.F0.9F.93.82.20message_inline_ref.20dropbox.20links

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-06-24 13:48:01 -07:00
Shubham Padia
22b5744726 help: Remove unused message_handle_match.
A search for `relative|message` returns zero matches. We should remove
this unused part of `help_relative_links`.
2025-06-24 12:54:39 -07:00
Shubham Padia
5bbb7ebd1a help-beta: Convert tabs syntax to equivalent MDX syntax.
Fixes #31248.
For cases with zero tabs in our current help center, we were using the
tab syntax just to put a border around the instructions without any tab
label. We do not want that border anymore since Tabs also don't have any
borders. So, we just remove the old tab syntax in that case during our
conversion.

We also move the admonition to asides conversion before the tabs syntax
conversion since the tabs conversion happening first was messing with
the asides conversion and was resulting into some missing closing tags.
We can modify things to work regardless of order, but doesn't seem worth
digging into for a conversion script.
2025-05-28 16:42:16 -07:00
Alya Abbott
d445676807 help: Update label for all channels tab. 2025-05-18 12:41:18 -07:00
Aman Agrawal
733817cb51 reminders: Add API endpoint to schedule reminders. 2025-05-02 16:48:00 -07:00
Varun-Kolanu
aaa2db4079 webhooks: Support no_previews argument for markdown messages.
This commit enables skipping inline image previews
by passing the no_previews field to check_send_webhook_message.
2025-04-07 11:53:19 -07:00
Anders Kaseorg
67fb7daa63 ruff: Fix RUF051 Use pop instead of key in dictdel dict[key].
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-14 17:31:50 -07:00
Aman Agrawal
eae11d9056 user-group: Use 2 user cog icon for user group settings. 2025-03-12 09:14:37 -07:00
Karl Stolley
80dcd53b59 youtube: Request medium-quality preview images. 2025-03-05 13:59:58 -08:00
Alya Abbott
4aa83de15b help: Add article on viewing group members. 2025-02-25 13:26:41 -08:00
Alya Abbott
b3e80071a4 help: Update DM page to use modern terminology.
Adds a "Via search box" tabbed section for viewing DMs via the
search box in the web and desktop apps.
2025-02-20 11:36:40 -08:00
roanster007
4789de2e96 markdown: Fix #-mention of private channel's topic made by system bots.
Previously when system bots used to `#-mention` a private
channel's topics in cases like moving messages of a private
channel, then the #-mentions were not rendered by the
markdown. This was because the system bots did not have
authorization to mention these channels.

This is fixed by passing down an `acting_user` parameter
in code paths involving sending these move message
notifications so that permission of acting_user to mention
the topic is verified for rendering the markdown, rather
than that of the system bot.
2025-02-12 12:50:25 -08:00
Alya Abbott
8f7c968408 help: Update self-hosted billing instructions.
Remove most references to Server 8.0 (not relevant for new installs).
2025-02-12 09:41:20 -08:00
roanster007
410ae119d4 markdown: Convert topic links generated by "#-mentions" to permalinks.
This commit converts the links generated by the markdown
of the "#-mention" of topics to permalinks -- the links containing
the "with" narrow operator, the operand being the last message
of the channel and topic of the mention.

Fixes part of #21505
2025-02-03 18:48:24 -08:00
Tim Abbott
bd8b845a4d mention: Use filter_stream_authorization.
In preparation for accessing the messages in channels to link topics
in them, we need to check channel access.
2025-02-03 18:48:24 -08:00
Tim Abbott
dcd4d261c7 markdown: Document possible_linked_stream_names. 2025-02-02 10:06:22 -08:00
Prakhar Pratyush
0788942a68 message_link: Add support for empty string topic in syntax.
This commit adds support for empty string as a valid topic name
in syntax for linking to channel messages.

The server stores it after empty string is replaced with
`realm_empty_topic_display_name` and wrapped with an <em> tag.

The web client parses the rendered_content and updates
the topic_name part in the HTML with topic_name in user's language
+ wraps it in a <span> tag with 'empty-topic-display' css class.
2025-01-31 14:23:15 -08:00
Prakhar Pratyush
e08bf15682 stream_topic_link: Add support for empty string topic in syntax.
This commit adds support for empty string as a valid topic name
in syntax for linking to topics.

The server stores it after empty string is replaced with
`realm_empty_topic_display_name` and wrapped with an <em> tag.

The web client parses the rendered_content and updates
the topic_name part in the HTML with topic_name in user's language
+ wraps it in a <span> tag with 'empty-topic-display' css class.
2025-01-31 14:23:15 -08:00
Alex Vandiver
bd2c934523 lightbox: Remove data-video-original-url; just use 'a href="..."' URL.
`data-video-original-url` is duplicative with the `href` on the
surrounding `a` tag, which is never run through the Camo URL
translation.  The `data-video-original-url` attribute was never
documented, and is not used by either mobile project, so is simply
removed.
2025-01-09 09:10:30 -08:00
Alex Vandiver
230bae17bb thumbnail: Generate a transcoded high-res version of HEIC/TIFF images.
If the content-type of the image is not in INLINE_MIME_TYPES, then we
do not expect browsers to be able to display it.  This behaviour is
particularly confusing because the thumbnail will render properly,
since that will be in the more widely-supported WebP format, but the
lightbox will show a broken image.

In these cases, generate a high-resolution (4032x3024) "thumbnail"
which clients can choose to use instead.  This thumbnail format is not
in the listed in the server's advertised thumbnail size list, because
it is not reliably generated for every image.

The transcoded thumbnail format is set on the `img` tag if it is
generated, and the original content-type is always passed to the
client, so it can decide how or if to render the original image.  This
content-type is as the _original uploader_ specified it, so may be
incorrect.

The transcoded image is not animated, even if the original was.  HEIC
files can nominally be animated, but in testing libvips was not able
to correctly recognize them as such.  TIFF files are parsed as being
"animated," with one page per frame; this is of dubious utility, so
we merely transcode the first page.  Always generating a static
transcoded image serves to also limit the computational time spent.

THUMBNAIL_OUTPUT_FORMATS is switched to be a tuple to ensure that it
is not accidentally mutated.
2025-01-09 09:10:28 -08:00
Sahil Batra
fa099f7ce7 mention: Allow silent mentioning system user groups.
Previously, we do not allow mentioning system user groups
at all. Now we want to use silent mention syntax for system
groups in the message sent when updating the posting permission
for a stream, so it is important to allowing silent mentioning
system groups at least. And there is no problem in allowing
silent mentions of system groups for all users.

We do not allow mentioning system groups as can_mention_group
for them is set to "Nobody" group.
2025-01-07 11:28:44 -08:00
Alex Vandiver
d2464ff52b markdown: Catch OverflowErrors in global times.
This also matches the except in the block above.
2025-01-02 17:31:36 -08:00
Anders Kaseorg
19b8cde27f ruff: Fix PLC0206 Extracting value from dictionary without calling .items().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-21 21:06:53 -08:00
Mateusz Mandera
81c2c0b328 docs: Finish renaming AzureAD to Entra ID.
Microsoft has been renaming AzureAD to Entra ID. Though both names still
seem to function, even if unofficially, so this mostly renames to `Entra
ID (AzureAD)` to reference both for clarity.
2024-12-12 17:48:54 -08:00
Alya Abbott
253e7d5dff help: Add a page on managing a user's group membership. 2024-12-06 11:54:16 -08:00
Kislay Udbhav Verma
000cc7bcde markdown: Add support for a pretty syntax for message links.
Links to zulip messages can now be written as
`#**channel_name > topic_name @ message_id**.`
The `message_id` is replaced with `💬` in the rendered
message.

Fixes part of #31920
2024-11-04 13:44:40 -08:00
Kislay Udbhav Verma
65c9b249b7 markdown: Refactor classes handling stream topic links.
The classes StreamPattern and StreamTopicPattern both had a
separate copy of the function `find_stream_id` which did the same
thing. Since another Pattern will be added as a part of #31920, it
is a good idea to move that function into a superclass which is then
inherited by all the related patterns.

Fixes part of #31920
2024-11-04 13:44:40 -08:00
Anders Kaseorg
08db41660a python: Avoid deprecated cgi module, removed in Python 3.13.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-22 10:05:01 -07:00
Lauryn Menard
70ab893d34 urls: Generate narrow links in backend with "channel" operator. 2024-10-11 17:00:23 -07:00