Added support for docsify-based docs site.

This commit is contained in:
Eric Traut 2023-03-06 15:46:07 -07:00
parent b3fd962116
commit 4c4aec52a5
5 changed files with 128 additions and 0 deletions

0
docs/.nojekyll Normal file
View File

10
docs/README.md Normal file
View File

@ -0,0 +1,10 @@
![Pyright](/img/PyrightLarge.png)
# Static type checker for Python
Pyright is a full-featured, standards-based static type checker for Python. It is designed for high performance and can be used with large Python source bases.
### Command-line Tool or Visual Studio Code Extension
Pyright includes both a [command-line tool](command-line.md) and an [extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright) that implements the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/).

38
docs/_sidebar.md Normal file
View File

@ -0,0 +1,38 @@
- Getting started
- [Installation](installation.md)
- [Type Concepts](type-concepts.md)
- [Getting Started with Type Checking](getting-started.md)
- [Pyright Features](features.md)
- Customization
- [Continuous Integration (CI)](ci-integration.md)
- [Configuration](configuration.md)
- [Configuration Options](configuration.md#main-pyright-config-options)
- [Diagnostic Rules](configuration.md#type-check-diagnostics-settings)
- [Execution Environments](configuration.md#execution-environment-options)
- [Sample pyrightconfig.json](configuration.md#sample-config-file)
- [Sample pyproject.toml](configuration.md#sample-pyprojecttoml-file)
- [Diagnostic Rule Defaults](configuration.md#diagnostic-rule-defaults)
- [Settings](settings.md)
- [Comments](comments.md)
- Usage
- [Type Inference](type-inference.md)
- [Import Statements](import-statements.md)
- [Import Resolution](import-resolution.md)
- [Extending Builtins](builtins.md)
- [Type Stubs](type-stubs.md)
- [Types in Libraries](typed-libraries.md)
- [Differences from Mypy](mypy-comparison.md)
- [Commands](commands.md)
- Advanced Topics
- [Building & Debugging](build-debug.md)
- [Pyright Internals](internals.md)

41
docs/index.html Normal file
View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: '',
repo: ''
}
</script>
<script>
window.$docsify = {
search: 'auto',
loadSidebar: true,
auto2top: true,
search: {
maxAge: 86400000, // Expiration time, the default one day
paths: 'auto',
placeholder: 'Type to search',
noData: 'No Results',
depth: 4, // Headline depth, 1 - 6
hideOtherSidebarContent: true,
},
};
</script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-python.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-yml.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-toml.min.js"></script>
</html>

39
docs/installation.md Normal file
View File

@ -0,0 +1,39 @@
## Installation
### VS Code Extension
For most VS Code users, we recommend using the Pylance extension rather than Pyright. Pylance incorporates the Pyright type checker but features additional capabilities such as semantic token highlighting and symbol indexing. You can install the latest-published version of the Pylance VS Code extension directly from VS Code. Simply open the extensions panel and search for “Pylance”.
### Vim
Vim/neovim users can install [coc-pyright](https://github.com/fannheyward/coc-pyright), the Pyright extension for coc.nvim.
Alternatively, [ALE](https://github.com/dense-analysis/ale) will automatically check your code with Pyright if added to the linters list.
### Sublime Text
Sublime text users can install the [LSP-pyright](https://github.com/sublimelsp/LSP-pyright) plugin from [package control](https://packagecontrol.io/packages/LSP-pyright).
### Emacs
Emacs users can install [eglot](https://github.com/joaotavora/eglot) or [lsp-mode](https://github.com/emacs-lsp/lsp-mode) with [lsp-pyright](https://github.com/emacs-lsp/lsp-pyright).
### Command-line
A [community-maintained](https://github.com/RobertCraigie/pyright-python) Python package by the name of “pyright” is available on pypi and conda-forge. This package will automatically install node (which Pyright requires) and keep Pyright up to date.
`pip install pyright`
or
`conda install pyright`
Once installed, you can run the tool from the command line as follows:
`pyright <options>`
Alternatively, you can install the command-line version of Pyright directly from npm, which is part of node. If you don't have a recent version of node on your system, install that first from [nodejs.org](https://nodejs.org).
To install pyright globally:
`npm install -g pyright`
On MacOS or Linux, sudo may be required to install globally:
`sudo npm install -g pyright`
To update to the latest version:
`sudo npm update -g pyright`