Skip to content

Commit fca756f

Browse files
author
Ted Patrick
committed
1st
0 parents  commit fca756f

16 files changed

+676
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_env

Makefile

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
CONDA_ENV ?= _env
11+
12+
# Put it first so that "make" without argument is like "make help".
13+
help:
14+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
15+
16+
env := $(CONDA_ENV)
17+
conda_run := conda run -p $(env)
18+
19+
setup:
20+
@if [ -z "$${CONDA_SHLVL:+x}" ]; then echo "Conda is not installed." && exit 1; fi
21+
$(CONDA_EXE) env $(shell [ -d $(env) ] && echo update || echo create) -p $(env) --file environment.yml
22+
23+
clean:
24+
rm -rf $(BUILDDIR)
25+
26+
clean-all: clean
27+
rm -rf $(env) *.egg-info
28+
29+
shell:
30+
@export CONDA_ENV_PROMPT='<{name}>'
31+
@echo 'conda activate $(env)'
32+
33+
htmlserve: html
34+
@echo 'visit docs at http://localhost:8080'
35+
python -m http.server -d "$(BUILDDIR)/html/" 8080
36+
37+
livehtml:
38+
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
39+
40+
41+
.PHONY: help Makefile setup clean clean-all shell
42+
43+
# Catch-all target: route all unknown targets to Sphinx using the new
44+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
45+
%: Makefile
46+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

README.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# PyScript documentation
2+
3+
Welcome to the PyScript documentation directory, where you can find
4+
and contribute to discussions around PyScript and related topics.
5+
6+
## Getting started
7+
8+
Before you start contributing to the documentation, it's worthwhile to
9+
take a look at the general contributing guidelines for the PyScript project. You can find these guidelines here
10+
[Contributing Guidelines](https://github.com/pyscript/pyscript/blob/main/CONTRIBUTING.md)
11+
12+
## Documentation Principles
13+
14+
The PyScript documentation is based on a documentation framework called [Diátaxis](https://diataxis.fr/). This framework helps to solve the problem of structure in technical documentation and identifies four modes of documentation - **tutorials, how-to guides, technical reference and explanation**. Each one of these modes answers to a different user need, fulfills a different purpose and requires a different approach to its creation.
15+
16+
The picture below gives a good visual representation of that separation of concerns:
17+
18+
![pyodide-pyscript](./img/diataxis.png)
19+
20+
So, please keep that in mind when contributing to the project documentation. For more information on, make sure to check [their website](https://diataxis.fr/).
21+
22+
### Setup
23+
24+
The `docs` directory in the pyscript repository contains a
25+
[Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) documentation project. Material is a system
26+
that takes plaintext files containing documentation written in Markdown, along with
27+
static files like templates and themes, to build the static end result.
28+
29+
To setup the documentation development environment simply run `make setup` from this folder and, once it's done,
30+
activate your environment by running `conda activate ./_env`
31+
32+
### Build
33+
34+
Simply run `mkdocs serve`
35+
36+
## Cross-referencing
37+
38+
You can link to other pages in the documentation by using the `{doc}` role. For example, to link to the `docs/README.md` file, you would use:
39+
40+
```markdown
41+
{doc}`docs/README.md`
42+
```
43+
44+
You can also cross-reference the python glossary by using the `{term}` role. For example, to link to the `iterable` term, you would use:
45+
46+
```markdown
47+
{term}`iterable`
48+
```
49+
50+
You can also cross-reference functions, methods or data attributes by using the `{attr}` for example:
51+
52+
```markdown
53+
{py:func}`repr`
54+
```
55+
56+
This would link to the `repr` function in the python builtins.

docs/advanced-user-guide.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Advanced User Guide

docs/assets/images/pyscript-black.svg

+16
Loading

docs/assets/images/pyscript.svg

+16
Loading

docs/contributing.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Contributing

docs/features.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# What is PyScript - Features
2+
3+
PyScript is a software platform that combines the power of the web with the power and simplicity
4+
of the most popular programming language in the world to provide an ecosystem that let users create
5+
and distribute applications in seconds, while having fun.
6+
7+
8+
## How does it work?
9+
10+
The PyScript library provides HTML tags for embedding and executing Python code in your browser. PyScript is built using Pyodide, the WebAssembly port of CPython, which is compiled using Emscripten.
11+
12+
PyScript turns the browser into a code deployment tool that anyone can learn to use.
13+
14+
Example
15+
In this example, we are using the <py-script> HTML tag to generate a Matplotlib figure and display it as an image. Click Preview to see the rendered HTML.
16+
17+
To try it in your browser, copy the code below into an online HTML editor like W3School’s Tryit Editor, which allows you to modify, run, and even save your code. Watch the video below to see it in action!
18+
19+
20+
## Features
21+
22+
### Run Python code in the browser
23+
24+
#### In the main thread
25+
26+
#### In a web worker
27+
28+
### Environment Setup
29+
30+
#### Install Python Packages
31+
32+
#### Download files and assets
33+
34+
### Error reporting
35+
36+
### Pythonic Web APIs
37+
38+
### Access to Javascript

0 commit comments

Comments
 (0)