ray/doc/test_myst_doc.py
Max Pumperla 5cc9355303
[Docs ] Tune docs overhaul (first part) (#22112)
Continuing docs overhaul, tune now has:

- [x] better landing page
- [x] a getting started guide
- [x] user guide was cut down, partially merged with FAQ, and partially integrated with tutorials
- [x] the new user guide contains guides to tune features and practical integrations
- [x] we rewrote some of the feature guides for clarity 
- [x] we got rid of sphinx-gallery for this sub-project (only data and core left), as it looks bad and is unnecessarily complicated anyway (plus, makes the build slower)
- [x] sphinx-gallery examples are now moved to markdown notebook, as started in #22030.
- [x] Examples are tested in the new framework, of course.

There's still a lot one can do, but this is already getting too large. Will follow up with more fine-tuning next week.

Co-authored-by: Antoni Baum <antoni.baum@protonmail.com>
Co-authored-by: Kai Fricke <krfricke@users.noreply.github.com>
2022-02-07 15:47:03 +00:00

32 lines
714 B
Python

"""Execute a jupytext markdown notebook."""
import subprocess
import argparse
import tempfile
import sys
import jupytext
parser = argparse.ArgumentParser(description="Run a jupytext parsable markdown file.")
parser.add_argument(
"--path",
help="path to the markdown file",
)
if __name__ == "__main__":
args, remainder = parser.parse_known_args()
with open(args.path, "r") as f:
notebook = jupytext.read(f)
name = ""
with tempfile.NamedTemporaryFile("w", delete=False) as f:
jupytext.write(notebook, f, fmt="py:percent")
name = f.name
remainder.insert(0, name)
remainder.insert(0, sys.executable)
# Run the notebook
subprocess.run(remainder)