Commit Graph

52 Commits

Author SHA1 Message Date
Anders Kaseorg f8aac58a6a docs: Update Ruff badge and links.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-26 15:51:46 -07:00
Karl Stolley 30782f7aa4 docs: Remove zid reference.
@timabbott note that it's been years since this has posed any problems:
https://github.com/zulip/zulip/pull/25733#discussion_r1203144805
2023-05-24 12:31:11 -07:00
Karl Stolley ee7b6f476d docs: Add testing example and supporting links. 2023-05-24 12:31:11 -07:00
Karl Stolley fe1b7a9bb3 docs: Integrate HTML and CSS style with subsystem doc. 2023-05-24 12:31:11 -07:00
Karl Stolley 3443e1d479 docs: Make surface edits to dangerous constructs. 2023-05-24 12:31:11 -07:00
Karl Stolley bb78c21fda docs: Rewrite and update JavaScript guidance. 2023-05-24 12:31:11 -07:00
Karl Stolley 5ff853fa71 docs: Update Python guidance in code style. 2023-05-24 12:31:11 -07:00
Karl Stolley 72b16e2fe7 docs: Edit and tighten opening sections. 2023-05-24 12:31:11 -07:00
Karl Stolley 761ae28551 docs: Rewrite and restructure introduction to code style. 2023-05-24 12:31:11 -07:00
Karl Stolley 827dd22fe1 docs: Restructure and rewrite style and conventions headings. 2023-05-24 12:31:11 -07:00
Karl Stolley c7c9322651 docs: Reorganize code style and conventions doc.
This commit represents an in-place reordering of the document. No
headings or content has been changed (that will happen in subsequent
commits).

The goal is to open the document with generic advice and guidance
applicable to all Zulip developers across all languages:

1. Consistency, enforced by linters and automated tests, opens the
   document.
2. General, largely language-neutral advice about line length,
   third-party code, translation, paths, and secrets come next.
3. Next up is language-specific advice and conventions: Python,
   followed by JavaScript and TypeScript, followed by HTML and CSS
   (although the HTML and CSS will be moved in a subsequent commit
   to their own file).
4. Closing the file, rather than opening it, is the section on
   Dangerous constructs. Some of these are fairly specialized, so
   it makes sense not to ask readers to read through them before
   presenting, say, our philosophy on line length.

Finally, in trying to come up with a sensible order for all sections
of this document, the "More arbitrary style things" heading has been
removed.
2023-05-24 12:31:11 -07:00
Karl Stolley deabb8ed53 docs: Document preference for hyphenated class and ID values.
This clarifies that kebab case should be the preferred style for
multiword classes in HTML and CSS.
2023-03-27 17:31:31 -07:00
Anders Kaseorg c1675913a2 web: Move web app to ‘web’ directory.
Ever since we started bundling the app with webpack, there’s been less
and less overlap between our ‘static’ directory (files belonging to
the frontend app) and Django’s interpretation of the ‘static’
directory (files served directly to the web).

Split the app out to its own ‘web’ directory outside of ‘static’, and
remove all the custom collectstatic --ignore rules.  This makes it
much clearer what’s actually being served to the web, and what’s being
bundled by webpack.  It also shrinks the release tarball by 3%.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-23 16:04:17 -08:00
Anders Kaseorg 7eb2cffcb4 templates: Update comments referencing Mustache to Handlebars.
(We switched to Handlebars very early in commit
4793cee888431b41f0aaf5341e2d8c77a155e8b8.)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-09 14:12:54 -08:00
khadeom 9c18641ec4
docs: Fix variable name typo in code-style.md. 2022-12-27 10:43:52 -08:00
Anders Kaseorg adffad384c lint: Replace pycodestyle and pyflakes with ruff.
https://github.com/charliermarsh/ruff

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-11-03 12:10:15 -07:00
Zixuan James Li ae33873902 docs: Update documentation for secrets related settings.
This is a follow-up to #22699 to document the new `get_mandatory_secret`
helper.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-08-25 14:50:41 -07:00
Anders Kaseorg cc30ed8ec7 actions: Delete zerver.lib.actions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-04-14 17:14:38 -07:00
Anders Kaseorg 21cd1c10b3 docs: Add missing space in “time zone”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-24 14:05:12 -08:00
AEsping 55f9178506 dev docs: Update Black link.
Updates the link to the editior integration for Black.
2021-11-30 14:36:29 -08:00
Ankur c578f186b6
docs: Change chat.zulip.org links to zulip.com/developer-community.
This helps increase the probability that folks read the guidelines for how the
chat.zulip.org community works and what streams to use before arriving there.

Fixes #19827.
2021-11-17 22:25:55 -08:00
Anders Kaseorg a4dbc1edd4 docs: Format Markdown with Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-08 12:06:24 -07:00
Anders Kaseorg 35c1c8d41b docs: Apply sentence single-spacing from Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-08 12:06:24 -07:00
Anders Kaseorg 915884bff7 docs: Apply bullet style changes from Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-08 12:06:24 -07:00
Anders Kaseorg 6145fdf678 docs: Rewrap to avoid line breaks in inline code spans.
This works around https://github.com/prettier/prettier/issues/11372.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-08 12:06:24 -07:00
Anders Kaseorg b29b6f6526 docs: Add syntax highlighting languages to code blocks.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-20 06:14:47 -07:00
Anders Kaseorg a0d0b89adb docs: Document Black and isort.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-12 15:31:59 -08:00
Tim Abbott 992c6126a8 docs: Update many references to Casper. 2020-08-30 17:16:02 -07:00
Alex Vandiver b4c2ae9cae settings: Adjust documentation and comment references to settings.py.
`zproject/settings.py` itself is mostly-empty now.  Adjust the
references which should now point to `zproject/computed_settings.py`
or `zproject/default_settings.py`.
2020-08-24 13:13:16 -07:00
Anders Kaseorg c6ed5c81de styles: Format CSS with Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-04 16:34:19 -07:00
Anders Kaseorg ab6ed22bff docs: Document that we use Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-22 15:49:48 -07:00
Sharif Naas 17afd460bc docs: Fix typos in contributing/code-style.md. 2020-06-08 11:13:32 -07:00
Anders Kaseorg 1f565a9f41 timezone: Use standard library datetime.timezone.utc consistently.
datetime.timezone is available in Python ≥ 3.2.  This also lets us
remove a pytz dependency from the PostgreSQL scripts.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-06-05 09:34:17 -07:00
Tim Abbott 196d5b8c59 docs: Add a few introductory paragraphs to our code style doc. 2020-05-19 14:22:15 -07:00
Tim Abbott ccd306d3f4 docs: Improve code style commentary on testing. 2020-05-19 14:11:53 -07:00
Alex Vandiver fb3f6bb68e docs: Reword `zulip_path` suggestion.
"declare the path with `zulip_path`" is opaque; be more explicit about
what should be done.
2020-05-19 14:07:12 -07:00
Alex Vandiver 310487c868 docs: Reformat timezone advice into bullet form. 2020-05-19 14:07:12 -07:00
Alex Vandiver 001334ed2d docs: Provide "right" example of using ids in sets. 2020-05-19 14:05:20 -07:00
Alex Vandiver d17baaf2af docs: Stop suggesting get_stream, which is anti-suggested.
Use of `get_stream` itself is explicitly suggested against by a
linter, in preference to the `access_stream_by_` methods; suggest
those here instead.
2020-05-19 14:05:20 -07:00
Alex Vandiver 9800392beb docs: Be more explicit about good prefetching patterns.
The problem is not the list comprehension, as the previous wording
implied, but rather the fact that data is needed from the linked
table.

Be explicit about _what_ in the QuerySet API is helpful for addressing
this -- namely, use of `select_related`.
2020-05-19 14:05:20 -07:00
Alex Vandiver 3a7a032ee2
docs: Remove unnecessary double-backticks in indented line.
These came in during the conversion from rST in 337155f280.
2020-05-05 21:28:00 -07:00
Anders Kaseorg 7ff9b22500 docs: Convert many http URLs to https.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-03-26 21:35:32 -07:00
Anders Kaseorg 4c1453df68 code-style: Modernize some ancient JavaScript advice.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-02-10 14:08:12 -08:00
Anders Kaseorg 93b1c3d94b settings: Extract config file functions to a module.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-11-13 12:38:45 -08:00
Anders Kaseorg 6fe5e44b35 settings: Define logging paths with, like, normal human variables.
This makes these variables available for type-checking.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-11-13 12:38:35 -08:00
David Rosa bdbc384de5 docs: Reduce the number of apparently broken links on github.
- Updated 260+ links from ".html" to ".md" to reduce the number of issues
reported about hyperlinks not working when viewing docs on Github.
- Removed temporary workaround that suppressed all warnings reported
by sphinx build for every link ending in ".html".

Details:
The recent upgrade to recommonmark==0.5.0 supports auto-converting
".md" links to ".html" so that the resulting HTML output is correct.

Notice that links pointing to a heading i.e. "../filename.html#heading",
were not updated because recommonmark does not auto-convert them.
These links do not generate build warnings and do not cause any issues.
However, there are about ~100 such links that might still get misreported
as broken links.  This will be a follow-up issue.

Background:
docs: pip upgrade recommonmark and CommonMark #13013
docs: Allow .md links between doc pages #11719

Fixes #11087.
2019-10-07 12:08:27 -07:00
Anders Kaseorg 3c3471b720 templates: Rename *.handlebars ↦ *.hbs and - ↦ _.
Tweaked by tabbott to avoid accidentally disabling the linter for
handlebars templates.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:03 -07:00
Marco Burstein ae5496020b docs: Add ".ts" support in docs and configuration.
Add references to TypeScript in documentation where appropriate, such
as in example bash commands and discussions of the file structure.
Add a new section to the Reading List with TypeScript resources.
Also update `.editorconfig` to support ".ts" files.

Fix part of #12000.
2019-04-12 11:26:17 -07:00
Tim Abbott abc7a00d35 Revert "docs: Update .html links to .md."
This doesn't work without the CommonMark upgrade.

This reverts commit c87893feea.
2019-04-05 17:58:54 -07:00
Samuel Searles-Bryant c87893feea docs: Update .html links to .md.
Sphinx/ReadTheDocs supports automatically translating links written as
to `.md` files to point to the corresponding `.html` files, so this
migration does not change the resulting HTML output in ReadTheDocs.
But it does fix apparent broken links on GitHub.

This doesn't prevent people from reading the documentation on GitHub
(so doesn't mitigate the fact that some rtd-specific syntax does not
render properly on GH), but it will prevent us from getting erroneous
issues reported about the hyperlinks not working.

Fixes: #11087.
2019-04-05 17:16:25 -07:00