Fixes#31253.
We've added another env variable called `SHOW_BILLING_HELP_LINKS`.
This env variable is set to `settings.CORPORATE_ENABLED` if the
`build-help-center` tool is used.
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.
We want to follow the Astro way of doing things and the middleware was
adding more magic + it was violating commonmark spec:
https://spec.commonmark.org/0.31.2/#example-301.
We insert FlattenList component where include files are being
treated as part of ordered lists. Astro renders included files as it's
own component, which would result in multiple ordered lists instead of
a single list if we did not use this component. See the astro component
file itself to know more how FlattenedSteps works.
We are not inserting FlattenList component for files with !!! tip
components, since we need to do it inside the include file. There are 4
such files at the time of writing this comment.
`is_include_only_ordered_list` makes sure of that. We can do the
conversion for it manually during cutover or in a followup PR.
All unordered lists at the time of writing this comment are standalone
components and we do not need to do any transformation for them.
We also changed the order of conversion of include and main files.
Include files are now being converted first to calculate
include_files_info.
Relevant topic:
https://chat.zulip.org/#narrow/channel/19-documentation/topic/Stage.202.3A.20New.20syntax.20for.20imports
Fixes#34705.
We just copied the css from Steps component of Astro and applied it to
all ordered lists in our case. Future starlight upgrades have the
potential to break this css if they change the underlying variable
names, but the breaks would be obvious when testing the upgrade and if
it becomes a consistent issue, we can look into some other solution.
The reason we were doing string manipulation was that when using the
keyboard icon for KeyboardTip.astro, we were getting a blank spot if the
fill was not sent to currentColor. This commit instead passes the
currentColor for the imported unplugin icon directly. This commit only
addresses this specific component, any other instances of the icon color
being same as the page color still remain and this commit does not solve
that.
We also add unplugin types to tsconfig.json. We didn't need them before
since those types were not used in any astro components and were used in
mdx files directly instead.
We have an open PR to the upstream starlight repository to add support
for custom icons in the Aside starlight component. The PR is stalled
due to dependency on some of the custom icons work being done on
starlight. We should replace the code below with the Aside starlight
component along with a custom icon (keyboard in out case).
Not linking it directly to avoid necessary mentions on the original PR
whenever this commit is pushed. The PR number is 2261 in
https://github.com/withastro/starlight.
Earlier, we were just renaming the files in help/include and copying
them over. Which meant that none of the mdx features or any of the
components we add could be used there. We could also not support nested
imports which are a part of the help/include files.
We also set an explcit height and width of 1em for icons, since some odd
behaviour for icon height and width was noticed when writing this
commit. unplugin-icons sets height and width by itself. It was setting
the height to 1024 and 960 for some icons. It is better to set the
height explicitly.
In our app, we use the font-awesome stylesheet, add it to our webpack
bundle and use the appropriate class with the <i> tag.
Here. although for font-awesome, we can use the stylesheet to do the
same, we would need to use `webfonts-loader` for our custom icons.
In this astro project, we want to follow the Astro way, and
unplugin-icons fits better with the Astro way of doing things.
See this topic on the discussion on how we chose unplugin-icons:
https://chat.zulip.org/#narrow/channel/19-documentation/topic/Stage.202.3A.20Icons/near/2168842
Fixes#31252.
One of our major use cases for file imports is to have bullet points as
partials to import at different places in the project. But when
importing the file with Astro, it creates its own lists. So we merge
lists together if they have nothing but whitespace between them.
There were some talks to use a component called FlattenList that would
flatten the list inside it, but that would also flatten lists that were
nested on purpose. This approach while feeling a bit hacky would not
flatten nested lists.
We use all these markdown files in `include` only to import them into
our main help markdown files. Most of these files are bulleted lists of
text. When importing these files, they might appear as an indented
sublist of an existing list. We plan to introduce mechanism to flatten
it in further commits.
Instead of referring to users being added or removed from channels,
we now use subscribe or unsubscribed from channels.
Splits the article for adding and removing users from a channel
into separate articles: /help/subscribe-users-to-a-channel and
/help/unsubscribe-users-from-a-channel.
The URL redirects for the combined add/remove articles (for both
channel and stream terminology) go to the subscribe users to a
channel article.
Creates a URLRedirect for this help center article to go to the
new "Moving to Zulip" guide.
Updates the astro.config.mjs file for the changes to the help
center sidebar that have been made as part of the replacement
of this help center guide.
Fixes#31499.
Fixes#31251.
All these values have been taken from `sidebar_index.md`. We will worry
about syncing that file and the starlight sidebar config option later on
during the `help-beta` migration.
Instead of using `.home-link` class to insert the black left-pointing
triangle, we are just using the unicode character directly in
astro.config.mjs.
We've also added a class because we wanted a section header in sidebar
for `Zulip Administration` without it acting as a group for all the
links below it. It is bit of a hacky approach but workable for now
considering we only have 1 instance where we are using it. `rem` was
used as the unit for font-size since that is the unit being used by
starlight for it's font size too.
We also add the `run-dev` commands to `/devtools` page. The GitHub
issue link is duplicated between both, but it's a useful duplication
and the link is unlikely to change.
We are adding MDX files to `.gitignore` for now since they are
just a result of a build process, once the migration is done,
we will not ignore them.
We're using PNPM workspaces to manage this project.
The new project's tsconfig.json has been copied from the current
root tsconfig.json while omitting some details that are only
relevant to that project.
`help-beta/src/env.d.ts` is a type declaration file auto-generated
by Astro. See https://github.com/withastro/astro/issues/6013.