Commit Graph

37 Commits

Author SHA1 Message Date
Hood Chatham 61fc59497a
Update docs on NativeFS and NodeFS (#4562)
Also I added a useful mountDirectory method to console.html
2024-02-27 07:20:26 -08:00
Hood Chatham 7422ab370d
Implement more detailed streams support (#3268)
Resolves https://github.com/pyodide/pyodide/issues/3112
This adds a carefully designed API for controlling stdin, stdout, and stderr. It changes
the default behavior to be a bit more useful, though in doing so introduces some mild
backwards incompatibility. In particular:

1. By default, stdin reads directly from `process.stdin` in node (as before) and raises an
error if in browser (not as before).
2. By default, stdout writes directly to `process.stdout` in node (before it called console.log)
and calls console.log in browser (as before).
3. By default, stderr writes directly to `process.stderr` in node (before it called console.warn)
and calls console.warn in browser (as before).
4. In all three cases, by default isatty(stdin/stdout/stderr) is true in node and false in browser
(in the browser it used to be true).
5. As before, if you pass `stdin`, `stdout`, or `stderr` as arguments to `loadPyodide`, `isatty` of
the corresponding stream is set to false.

The stdin function is now more flexible: we now correctly handle the case where it returns an
ArrayBuffer or ArrayBufferView.

I also added 3 new functions to set streams after Pyodide is loaded which offer additional
control:
* `setStdin({stdin?, error?, isatty = false})` -- Sets the stdin function. The stdin function takes no
arguments and should return null, undefined, a string, or a buffer. Sets and `isatty(stdin)` to 
`isatty` (by default `false`). If error is true, set stdin to always raise an EIO error when it is read.
* `setStdout({raw?, batched?, isatty = false})` -- If neither raw nor batched is passed, restore 
default stdout behavior. If rwa is passed, the raw stdout function receives a byte which it should
interpret as a utf8 character code. Sets `isatty(stdout)` to isatty (by default `false`). If batched is
passed but not raw, it sets a batched stdout function. The stdout function receives a string and
should do something with it. In this case it ignores isatty and sets isatty(stdout) to false.
* `setStderr({raw?, batched?, isatty = false})` -- same but with stderr.
2022-12-18 15:55:52 -08:00
Loïc Estève 16083881eb
Fix Pyodide REPL URL (#3244)
* Fix Pyodide REPL URL

* Use stable URL in quickstart.md

* try relative URL for Pyodide REPL

* use HTML rather than md syntax

* Revert "use HTML rather than md syntax"

This reverts commit e911f17181.

* Fix relative URL

* Use rst trying to avoid myst_parser cleverness

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [skip ci] trigger CI

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-10 15:53:37 +01:00
Hood Chatham 09af24b3b5
DOCS Add docs for out of tree builds (#3109) 2022-09-18 17:36:12 -07:00
jmdyck 5dcdf95e0f
index.rst: fix typo (#2543)
help ==> helps
2022-05-11 06:59:19 -07:00
Gyeongjae Choi ce2746b690
DOCS Documentation cleanup [skip ci] (#2070)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Co-authored-by: Sylvain Riondet <sylvain.riondet@emailtree.ai>
Co-authored-by: Sylvain <sylvainriondet@gmail.com>
2022-01-04 16:46:00 +01:00
Hood Chatham feeab0cf03
Rewrite intro text (#2031) 2021-12-13 09:36:35 -08:00
Roman Yurchak 35620ef34d
DOC Improve the documentation home page (#1958)
* DOC Improve the documentation home page [skip CI]

* Link to the blog [skip ci]

* Apply suggestions from code review [skip ci]

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
2021-11-15 10:30:59 +01:00
Gyeongjae Choi ea92661365
Replace "PyPi" to "PyPI" in docs and yaml (#1962) 2021-11-15 10:26:55 +01:00
Grimmer 89682dabfe
DOC Replace "Javascript" with "JavaScript" in documents and comments [skip ci] (#1860) 2021-09-29 10:01:53 +02:00
Hood Chatham 3e3d6eb8a9
ENH Support PyErr_CheckSignals interrupts (#1294) 2021-09-26 11:53:46 -07:00
Roman Yurchak 8797f92f59
Documentation on using Pyodide with Node.js [skip ci] (#1788) 2021-08-12 11:39:13 +02:00
Roman Yurchak e5391ef1a7
DOC Improve documentation on downloading and deploying [skip ci] (#1778) 2021-08-11 12:00:44 +02:00
Hood Chatham b4f4bcffdc
Update to Python 3.9.5 (#1637)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2021-06-19 15:49:25 -07:00
Roman Yurchak 263309102d
Unvendor distutils (#1543)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2021-05-02 15:42:28 +02:00
Roman Yurchak 126193d8c4
DOC Add instructions for making a release (#1533) 2021-04-28 19:28:11 +02:00
Roman Yurchak 1d623f4690
DOC Minor documentation improvements (#1522) 2021-04-21 22:57:45 +02:00
Hood Chatham 60100c8fc6
DOC Add in missing api docs by monkey patching autodoc (#1511) 2021-04-20 14:28:33 -07:00
Roman Yurchak ed3e005c53
DOC Add project roadmap [skip ci] (#1499)
Co-authored-by: Hood <hood@mit.edu>
2021-04-20 20:26:44 +02:00
Hood Chatham 57db723dd3
DOCS Add info about compiling with debug symbols & interactive debugging (#1450) 2021-04-13 21:51:32 +02:00
Hood Chatham 7716755d0e
DOCS Update readme, index and about page, edits to usage docs (#1420) 2021-04-07 00:11:00 +02:00
Hood Chatham e0966c83b3
Docs textwrap, typo fixes, add links (#1351) 2021-03-20 11:56:10 -07:00
Roman Yurchak c4a4f518bb
RFC pyodide governance and decision-making process (#1229)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2021-03-03 19:09:05 +01:00
Aditya Shankar 7f66a38ffd
Create related-projects.md, a file to show related projects (#1271)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2021-03-02 13:47:31 +01:00
Roman Yurchak f34787df54
Re-organize changelog by submodule (#1255) 2021-02-17 08:58:56 +01:00
leafjolt fe1e304ae7
DOC Fix broken links in documentation homepage (#1260) 2021-02-16 22:59:51 +01:00
Roman Yurchak a79e2893f2
DOC Update project subtitle to be more general (#1246) 2021-02-15 21:27:28 +01:00
Hood Chatham 3e2e4960ad
DOCS: document core (#1048) 2021-01-19 06:28:59 +01:00
Hood Chatham dbc60a8abf
DOCS: Move docs into three subfolders based on top level sections (#1149) 2021-01-18 20:56:47 +01:00
Dexter Chua c4548db3c0
DOC Update docs for iodide code removal (#981) 2020-12-31 13:23:03 +01:00
Roman Yurchak f1cc304717
DOC Refactor API reference documentation (#782) 2020-10-31 21:00:58 +01:00
Roman Yurchak a260ea3bbf
DOC Refactor instructions for loading packages (#781) 2020-10-31 10:02:23 +01:00
Roman Yurchak 5ce2614a36
DOC/MAINT Use MyST markdown parser in the documentation (#778) 2020-10-30 21:09:25 +01:00
Roman Yurchak f2c92ad431
DOC Add FAQ about loading external python files (#727) 2020-07-14 11:29:58 +02:00
Roman Yurchak f2c4d63c89
DOC Improve README and documentation (#665) 2020-05-19 18:14:56 +02:00
Roman Yurchak 5ba82b81f9 Add mechanism to build a subset of packages 2020-05-09 01:28:44 +02:00
Carol Willing 9f4dceb812 Adds Sphinx documentation build (#474)
* create proof of concept

* add rtd config file

* edit config

* minor edits in rst files

* update config from proof of concept to prod

* add a bit more explanation to contents page

* Label markdown block as js to prevent Sphinx warning

* correct links warning in Sphinx

* fix typo
2019-06-22 18:22:38 -04:00