### Download Example Content Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart.md Clone the example project repository to get started with MyST Markdown. ```bash git clone https://github.com/jupyter-book/mystmd-quickstart.git cd mystmd-quickstart ``` -------------------------------- ### Serve MyST Quickstart Content Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-executable-documents.md Use `myst start` to serve your quickstart content locally. This command builds the project and starts a development server. ```shell $ cd mystmd-quickstart $ myst start ๐Ÿ“– Built README.md in 33 ms. ๐Ÿ“– Built 01-paper.md in 30 ms. ๐Ÿ“– Built 02-notebook.ipynb in 6.94 ms. ๐Ÿ“š Built 3 pages for myst in 76 ms. โœจโœจโœจ Starting Book Theme โœจโœจโœจ โšก๏ธ Compiled in 510ms. ๐Ÿ”Œ Server started on port 3000! ๐Ÿฅณ ๐ŸŽ‰ ๐Ÿ‘‰ http://localhost:3000 ๐Ÿ‘ˆ ``` -------------------------------- ### Install Dependencies and Start Development Server Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-parser/docs/consuming/advanced.md Install project dependencies using npm and start a local development server for interactive testing of the library. ```bash npm install npm run start # Start a development server to play with the library! ๐Ÿš€ ``` -------------------------------- ### Install and Serve MyST Content Locally Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart.md Use this command to install and serve your MyST content locally when prompted. Alternatively, use `myst start` to manually serve the content. ```bash ? Would you like to run "myst start" now? Yes ``` ```bash myst start ``` -------------------------------- ### Python Exercise Setup Code Source: https://github.com/jupyter-book/mystmd/blob/main/docs/exercises.md Example of setup code for an exercise using the gated syntax. This code is intended to be executed. ```python # Some setup code that needs executing ``` -------------------------------- ### MyST Server Output Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-myst-documents.md This is an example of the output you will see when the `myst start` command is successful, indicating the server is running and the pages have been built. ```text ๐Ÿ“– Built README.md in 33 ms. ๐Ÿ“– Built 01-paper.md in 30 ms. ๐Ÿ“– Built 02-notebook.ipynb in 6.94 ms. ๐Ÿ“š Built 3 pages for myst in 76 ms. โœจโœจโœจ Starting Book Theme โœจโœจโœจ โšก๏ธ Compiled in 510ms. ๐Ÿ”Œ Server started on port 3000! ๐Ÿฅณ ๐ŸŽ‰ ๐Ÿ‘‰ http://localhost:3000 ๐Ÿ‘ˆ ``` -------------------------------- ### Developer Install and Run Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-parser/README.md Install project dependencies and run development scripts for myst-parser. Includes commands for installation, starting a development server, building the library, and running tests. ```bash cd myst-parser npm install npm run start # Start a development server to play with the library! ๐Ÿš€ ``` ```bash npm run test ``` ```bash npm run build ``` -------------------------------- ### Check mystmd installation and Node.js prompt Source: https://github.com/jupyter-book/mystmd/blob/main/docs/installing.md Verify the mystmd installation and observe the prompt for Node.js installation if it's missing. This example also shows the version output. ```shell $ myst -v Node.js (node) is required to run MyST, but could not be found. Install Node.js in '/root/.local/share/myst/20.0.0'? (y/N): y Attempting to install Node.js in /root/.local/share/myst/20.0.0 ... Successfully installed Node.js 20.0.0 v1.3.4 ``` -------------------------------- ### MyST CLI Usage Examples Source: https://github.com/jupyter-book/mystmd/blob/main/README.md Basic commands for using the `mystmd` CLI, including initializing a new project, starting a development server, and building a MyST Markdown file. ```bash myst init myst start myst build my-doc.md --tex ``` -------------------------------- ### Install Initial Node.js Version with nvm Source: https://github.com/jupyter-book/mystmd/blob/main/docs/install-node.md After installing nvm, use it to install a default version of Node.js, such as v20. This command downloads and sets up the specified Node.js version. ```shell % nvm install 20 Downloading and installing node v20.11.1... ... Now using node v20.11.1 (npm v10.2.4) % ``` -------------------------------- ### MyST Server Build Output Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart.md This output shows the process of fetching templates, installing web libraries, building pages, and starting the local web server. Note the server port and URL. ```text ๐Ÿ• Fetching template metadata from https://api.mystmd.org/templates/site/myst/book-theme ๐Ÿ’พ Saved template to path _build/templates/site/myst/book-theme โคต๏ธ Installing web libraries (can take up to 60 s) ๐Ÿ“ฆ Installed web libraries in 13 s ๐Ÿ“– Built interactive-graphs.ipynb in 21 ms. ๐Ÿ“– Built paper.md in 32 ms. ๐Ÿ“– Built README.md in 35 ms. ๐Ÿ“š Built 3 pages for myst in 82 ms. โœจโœจโœจ Starting Book Theme โœจโœจโœจ โšก๏ธ Compiled in 524ms. ๐Ÿ”Œ Server started on port 3000! ๐Ÿฅณ ๐ŸŽ‰ ๐Ÿ‘‰ http://localhost:3000 ๐Ÿ‘ˆ ``` -------------------------------- ### Download Example Project Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-jupyter-lab-myst.md Clone the example project repository and navigate into its directory to explore MyST features in JupyterLab. ```bash git clone https://github.com/jupyter-book/jupyterlab-myst-quickstart.git cd jupyterlab-myst-quickstart ``` -------------------------------- ### Read the Docs Configuration Example Source: https://github.com/jupyter-book/mystmd/blob/main/docs/deployment-readthedocs.md This is a complete `.readthedocs.yaml` configuration file. It specifies the build environment, installs mystmd, builds the HTML site, and copies the output to the expected Read the Docs location. This file is automatically created with `myst init --readthedocs`. ```yaml :filename: .readthedocs.yaml # Read the Docs configuration file for myst # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # This file was created automatically with `myst init --readthedocs` # Required version: 2 # Set the OS, Python version, and Node.js version # Note: Python is included for executing code in notebooks or using Jupyter Book build: os: ubuntu-22.04 tools: python: "3.12" nodejs: "22" commands: # Install mystmd - npm install -g mystmd # Build the site - myst build --html # Copy the output to Read the Docs expected location - mkdir -p $READTHEDOCS_OUTPUT/html/ - cp -r _build/html/. "$READTHEDOCS_OUTPUT/html" # Clean up build artifacts - rm -rf _build ``` -------------------------------- ### Install Python Requirements Source: https://github.com/jupyter-book/mystmd/blob/main/docs/contribute-docs.md Install the necessary Python packages for building the documentation with executable content. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install and Initialize MyST CLI with Pip Source: https://github.com/jupyter-book/mystmd/blob/main/packages/mystmd-py/README.md Install the `mystmd` package using pip and initialize a new project. ```bash pip install mystmd myst init myst build my-doc.md --tex ``` -------------------------------- ### Install Execution Requirements Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-executable-documents.md Install the necessary packages for executing content by using `pip` with the `requirements.txt` file. ```shell $ pip install -r requirements.txt ``` -------------------------------- ### Start Content Server Source: https://github.com/jupyter-book/mystmd/blob/main/docs/developer.md Start a content server using 'myst start --headless'. The --headless flag prevents it from starting a theme server, allowing you to run the theme server separately. ```shell myst start --headless ``` -------------------------------- ### Start MyST Server with Execution Source: https://github.com/jupyter-book/mystmd/blob/main/docs/contribute-docs.md Build and serve the documentation locally, executing all code cells for a complete preview. ```bash myst start --execute ``` -------------------------------- ### Start Development Server Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-parser/docs/consuming/advanced.md Start a server for manually testing and interacting with the MyST library using an in-memory bundle. Note: this does not build the library. ```bash npm run start ``` -------------------------------- ### Start Local Development Server (`myst start`) Source: https://context7.com/jupyter-book/mystmd/llms.txt Launch a live-reloading local preview server for your MyST project. The `--execute` flag enables Jupyter notebook execution at build time. The server monitors source files for changes and performs incremental rebuilds. ```bash # Start dev server myst start # Start with notebook execution enabled (Beta) myst start --execute # Start with controlled parallel execution myst start --execute --execute-parallel 2 ``` -------------------------------- ### Clone Example Landing Pages Source: https://github.com/jupyter-book/mystmd/blob/main/docs/developer.md Clone the example landing pages repository to obtain sample content for testing the theme. ```shell git clone https://github.com/jupyter-book/example-landing-pages cd example-landing-pages ``` -------------------------------- ### Install jtex CLI Source: https://github.com/jupyter-book/mystmd/blob/main/packages/jtex/docs/command-line.md Install the jtex command-line tools globally using npm. ```bash npm install -g jtex ``` -------------------------------- ### Install myst-transforms Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-transforms/docs/index.md Install the myst-transforms library using npm. This is the first step to using its transformation utilities. ```bash npm install myst-transforms ``` -------------------------------- ### Install MyST Dependencies with Bun Source: https://github.com/jupyter-book/mystmd/blob/main/docs/contribute-build-locally.md Run this command in the base directory to install all necessary project dependencies using Bun. ```shell bun install ``` -------------------------------- ### Install and Build MyST Project on Netlify Source: https://github.com/jupyter-book/mystmd/blob/main/docs/deployment-netlify.md Use this command in the Netlify build settings to install the mystmd package globally and then build your project's HTML. Ensure your book content is in the root or adjust the path accordingly. ```bash npm install -g mystmd && myst build --html ``` -------------------------------- ### Install MyST Markdown CLI Source: https://github.com/jupyter-book/mystmd/blob/main/README.md Install the `mystmd` command line tool globally using npm, pip, or conda. Choose the installation method that best suits your environment. ```bash # Using npm, yarn, or pnpm npm install -g mystmd # Or using PyPI pip install mystmd # Or using Conda / Mamba conda install mystmd -c conda-forge ``` -------------------------------- ### Install nvm using Install Script Source: https://github.com/jupyter-book/mystmd/blob/main/docs/install-node.md Install the Node Version Manager (nvm) on Linux or macOS using the provided curl script. This manager helps handle multiple Node.js versions. ```shell % curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash % nvm -v 0.39.5 ``` -------------------------------- ### Check MyST Installation Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart.md Verify that the MyST CLI has been successfully installed by checking its version. ```shell $ myst -v v1.3.4 ``` -------------------------------- ### Start Local Jupyter Server Source: https://github.com/jupyter-book/mystmd/blob/main/docs/in-page-execution.md Start a local Jupyter server with options for token and allowed origins for MyST integration. ```bash jupyter lab --NotebookApp.token= --NotebookApp.allow_origin='http://localhost:3000' ``` -------------------------------- ### Install myst-to-tex Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-to-tex/docs/index.md Install the myst-to-tex package using npm. This command should be run in your project's root directory. ```bash npm install myst-to-tex ``` -------------------------------- ### Install and Initialize MyST CLI with Conda Source: https://github.com/jupyter-book/mystmd/blob/main/packages/mystmd-py/README.md Install the `mystmd` package using Conda, configuring channels, and initialize a new project. ```bash conda config --add channels conda-forge conda config --set channel_priority strict conda install mystmd myst init myst build my-doc.md --tex ``` -------------------------------- ### MyST Syntax for Exercise Start Source: https://github.com/jupyter-book/mystmd/blob/main/docs/exercises.md Demonstrates the MyST Markdown syntax for starting an exercise block using `exercise-start`. This allows for executable code cells. ```markdown ```{exercise-start} :label: ex1 ``` ```python # Some code to explain the figure ``` and maybe you wish to add a figure ```{figure} https://github.com/rowanc1/pics/blob/main/beach.png ``` ```{exercise-end} ``` ``` -------------------------------- ### MyST Role Syntax Example Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-myst-markdown.md Shows the basic syntax for MyST roles, which are inline extension points. The example demonstrates how to use a role with a given name and content. ```markdown Some content {rolename}`and here is my role's content!` ``` -------------------------------- ### Simulate Smoothing Example in Python Source: https://github.com/jupyter-book/mystmd/blob/main/docs/proofs-and-theorems.md This Python code simulates a smoothing example with a deterministic demand shock. It requires the SmoothingExample class to be defined. ```python ex2 = SmoothingExample(C2=[[0], [0]]) x0 = [0, 1, 0] ex2.simulate(x0) ``` -------------------------------- ### Naked Button Widget Example Source: https://github.com/jupyter-book/mystmd/blob/main/docs/widgets.md Displays a simple button widget with initial state. This example uses a local widget module and provides an initial 'count' value of 0. ```markdown ```{anywidget} ./example-widget.mjs { "count": 0 } ``` ``` -------------------------------- ### Install Jupyter Server and Kernel Source: https://github.com/jupyter-book/mystmd/blob/main/docs/execute-notebooks.md Install the necessary components for MyST to execute code. This includes `jupyter-server` for orchestration and `ipykernel` for Python execution. ```bash pip install jupyter-server ``` ```bash pip install ipykernel ``` -------------------------------- ### Start MyST Site Server on Custom Host Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-cli/docs/reference.md Starts a local web server for your MyST site on a host other than `localhost`. Set the `HOST` environment variable before using this option. ```bash myst start --keep-host ``` -------------------------------- ### Install jtex and cookiecutter Source: https://github.com/jupyter-book/mystmd/blob/main/packages/jtex/docs/create-a-latex-template.md Install the necessary tools for creating and managing jtex templates. `jtex` is for template rendering, and `cookiecutter` helps in quickly scaffolding new projects. ```bash npm install -g jtex pip install cookiecutter ``` -------------------------------- ### Verify NodeJS and npm Installation Source: https://github.com/jupyter-book/mystmd/blob/main/docs/install-node.md After installation, verify that node and npm are available in your system's PATH by running these commands in a new terminal. ```shell % node -v v20.19.5 % npm -v 10.8.2 ``` -------------------------------- ### Launch JupyterLab Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-jupyter-lab-myst.md Start JupyterLab to work with MyST Markdown files and notebooks. ```bash jupyter lab ``` -------------------------------- ### Find and Download Page Exports and Source Source: https://github.com/jupyter-book/mystmd/blob/main/docs/website-metadata.md Locates a page containing 'quickstart' in its URL, retrieves its metadata, and displays its title, source file location, and available exports. Requires the `requests` library. ```python # Get a page with "quickstart" in the URL example_page = next(ref for ref in xref_data["references"] if "quickstart" in ref["url"]) data_url = site_url + example_page["data"] print(f"Retrieving URL: {data_url}") page_data = requests.get(data_url).json() JSON({ "page_url": example_page["url"], "page_title": page_data["frontmatter"]["title"], "source_file": page_data["location"], "exports": page_data["frontmatter"]["exports"] }) ``` -------------------------------- ### Install NodeJS via Conda/Mamba Source: https://github.com/jupyter-book/mystmd/blob/main/docs/install-node.md Install a specific even-numbered version of NodeJS using conda-forge. This command ensures you get a version within the specified range. ```shell (my-conda-env)% conda install -c conda-forge 'nodejs>=20,<21' (my-conda-env)% node -v v20.11.1 (my-conda-env)% npm -v 10.2.4 ``` -------------------------------- ### Initialize MyST Project (`myst init`) Source: https://context7.com/jupyter-book/mystmd/llms.txt Scaffold a new MyST project by creating a `myst.yml` configuration file. Use `--write-toc` to generate a table of contents and `--gh-pages` to set up a GitHub Actions deployment workflow. ```bash # Create myst.yml for the current directory myst init # Also write a table of contents myst init --write-toc # Set up GitHub Pages deployment workflow myst init --gh-pages # => Creates .github/workflows/deploy.yml with BASE_URL configured ``` -------------------------------- ### Serve Static HTML Locally Source: https://github.com/jupyter-book/mystmd/blob/main/docs/deployment.md After building your static site, use this command to start a local web server for testing. This serves the contents of the `_build/html` directory. ```bash npx serve _build/html ``` -------------------------------- ### Start MyST Server Locally Source: https://github.com/jupyter-book/mystmd/blob/main/docs/contribute-docs.md Run this command to build and serve the MyST documentation locally, allowing you to preview changes. ```bash myst start ``` -------------------------------- ### Define Internal Page Navigation Link Source: https://github.com/jupyter-book/mystmd/blob/main/docs/website-navigation.md An example of an internal page link within the `site.nav` configuration. The URL should start with `/` and exclude the file extension. ```yaml - title: Custom title url: /path/to/document ``` -------------------------------- ### Define JavaScript Kernel Specification Source: https://github.com/jupyter-book/mystmd/blob/main/docs/notebooks-with-markdown.md Example of frontmatter to configure a MyST Markdown file to use a JavaScript kernel. Requires a JavaScript kernel to be installed. ```yaml kernelspec: name: javascript display_name: JavaScript ``` -------------------------------- ### Query Available Node Versions with nodeenv Source: https://github.com/jupyter-book/mystmd/blob/main/docs/install-node.md Use the nodeenv command to list the available Node.js versions that can be installed. ```shell % nodeenv --list % ... 20.11.1 ... ``` -------------------------------- ### GitHub Actions Workflow for MyST Site Deployment Source: https://github.com/jupyter-book/mystmd/blob/main/docs/deployment-github-pages.md This YAML file defines a GitHub Actions workflow to automatically build and deploy your MyST site to GitHub Pages on push events to the main branch. It includes steps for setup, installation, building, and deployment. ```yaml # This file was created automatically with `myst init --gh-pages` ๐Ÿช„ ๐Ÿ’š name: MyST GitHub Pages Deploy on: push: # Runs on pushes targeting the default branch branches: [main] env: # `BASE_URL` determines the website is served from, including CSS & JS assets # You may need to change this to `BASE_URL: ''` BASE_URL: /${{ github.event.repository.name }} # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: 'pages' cancel-in-progress: false jobs: deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Pages uses: actions/configure-pages@v3 - uses: actions/setup-node@v4 with: node-version: 18.x - name: Install MyST Markdown run: npm install -g mystmd - name: Build HTML Assets run: myst build --html - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: './_build/html' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 ``` -------------------------------- ### Verify jtex Installation Source: https://github.com/jupyter-book/mystmd/blob/main/packages/jtex/README.md Confirm that jtex has been installed correctly by running the version command. This verifies the installation and shows the installed version. ```bash jtex --version ``` -------------------------------- ### Install MyST CLI Source: https://context7.com/jupyter-book/mystmd/llms.txt Install the MyST CLI using npm, PyPI, or conda-forge. Node.js version 20 or higher is required for npm installs. The PyPI package can automatically install Node.js. ```bash # Via npm (requires Node.js โ‰ฅ20) npm install -g mystmd # Via PyPI (auto-installs Node.js if missing) pip install mystmd # Via conda-forge / mamba mamba install -c conda-forge mystmd conda install -c conda-forge mystmd # Verify installation myst --version # => v1.9.0 ``` -------------------------------- ### Start MyST Server Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-myst-documents.md Run this command in your project directory to serve your MyST content locally. It will watch for changes and rebuild the project. ```shell cd mystmd-quickstart myst start ``` -------------------------------- ### Install mystmd with Pip Source: https://github.com/jupyter-book/mystmd/blob/main/docs/installing.md Install mystmd using pip. Ensure Node.js is installed separately as it is a requirement for MyST to run. ```shell pip install mystmd ``` -------------------------------- ### Install nodeenv via pip Source: https://github.com/jupyter-book/mystmd/blob/main/docs/install-node.md Install the nodeenv Python package, which allows managing Node.js installations within virtual environments. ```shell % pip install nodeenv ``` -------------------------------- ### Initialize Read the Docs Configuration Source: https://github.com/jupyter-book/mystmd/blob/main/docs/deployment-readthedocs.md Run this command in the root of your Git repository to create a `.readthedocs.yaml` configuration file. It will prompt for Python and Node.js versions. ```bash myst init --readthedocs ``` -------------------------------- ### Install myst-to-jats Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-to-jats/docs/index.md Install the myst-to-jats package into your virtual environment using npm. ```bash npm install myst-to-jats ``` -------------------------------- ### Build myst-theme Locally Source: https://github.com/jupyter-book/mystmd/blob/main/docs/developer.md Build a static site against a local theme by running the 'make build-book' target in the myst-theme directory. This produces a production-ready theme under .deploy/book. ```bash cd myst-theme make build-book # because mystmd docs site uses the book theme ``` -------------------------------- ### Initialize GitHub Pages Deployment Source: https://github.com/jupyter-book/mystmd/blob/main/docs/deployment-github-pages.md Run this command in the root of your Git repository to set up a GitHub Action for deploying to GitHub Pages. It will prompt for branch and action file names. ```bash myst init --gh-pages ``` -------------------------------- ### MyST Table of Contents Example Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-toc/README.md Example MyST YAML configuration for a table of contents. ```yaml toc: - title: Main file: main.md - title: Overview children: - file: overview-1.md - file: overview-2.md - url: https://google.com - file: getting-started.md children: - file: getting-started-part-1.md - file: getting-started-part-2.md ``` -------------------------------- ### Initialize MyST Project Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart.md Run the `myst` command to initialize a new MyST project and create a `myst.yml` configuration file. This command guides you through setting up your project for website creation. ```shell $ myst Welcome to the MyST Markdown CLI!! ๐ŸŽ‰ ๐Ÿš€ myst init walks you through creating a myst.yml file. You can use myst to: - create interactive websites from Markdown and Jupyter Notebooks ๐Ÿ“ˆ - build & export professional PDFs and Word documents ๐Ÿ“„ Learn more about this CLI and MyST Markdown at: https://mystmd.org ๐Ÿ’พ Writing new project and site config file: myst.yml ``` -------------------------------- ### Verify JupyterLab Extension Installation Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-jupyter-lab-myst.md Check if the jupyterlab-myst extension is correctly registered with your Jupyter installation. ```bash jupyter labextension list ``` -------------------------------- ### Initialize MyST Project Source: https://github.com/jupyter-book/mystmd/blob/main/docs/contribute-add-feature.md Initialize a new MyST project within your demo directory. You will be prompted to start the development server, which you can decline for a single build. ```shell myst init ``` -------------------------------- ### Check Node.js Version Source: https://github.com/jupyter-book/mystmd/blob/main/README.md Verify that an updated version of Node.js is installed before proceeding with the installation of `mystmd`. ```bash node -v >> v20.4.0 ``` -------------------------------- ### Build PDF and website Source: https://github.com/jupyter-book/mystmd/blob/main/docs/website-downloads.md Build the PDF export using `myst build --pdf`, then rebuild your website to include the new download link for the exported PDF. ```bash myst build --pdf ``` -------------------------------- ### Install myst-to-md Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-to-md/docs/index.md Install the myst-to-md package using npm. This command should be run in your project's terminal. ```bash npm install myst-to-md ``` -------------------------------- ### Navigate to Docs Directory Source: https://github.com/jupyter-book/mystmd/blob/main/docs/contribute-docs.md Change your current directory to the 'docs' folder within the cloned repository. ```bash cd docs/ ``` -------------------------------- ### Build MyST Site with Notebook Execution Source: https://context7.com/jupyter-book/mystmd/llms.txt Command-line options for building a MyST site with code execution enabled. Control parallelism for resource-intensive notebooks. ```bash # Build with execution myst build --execute --html # Control parallelism (useful for resource-intensive notebooks) myst build --execute --execute-parallel 2 # Disable parallel execution myst build --execute --execute-parallel 1 ``` -------------------------------- ### Equivalent Binder Configurations Source: https://github.com/jupyter-book/mystmd/blob/main/docs/in-page-execution.md These configurations are functionally equivalent for setting up Binder. ```yaml project: jupyter: true ``` ```yaml project: jupyter: 'binder' ``` ```yaml project: jupyter: binder: true ``` ```yaml project: jupyter: binder: repo: executablebooks/thebe-binder-base # default repo ``` ```yaml project: jupyter: binder: repo: https://github.com/executablebooks/thebe-binder-base # default repo ``` -------------------------------- ### Page Frontmatter Example Source: https://github.com/jupyter-book/mystmd/blob/main/docs/frontmatter.md Fields placed in page frontmatter are top-level. This example shows the `edit_url` field. ```md :filename: page.md --- edit_url: null --- ``` -------------------------------- ### Combine Execution with HTML Output Source: https://github.com/jupyter-book/mystmd/blob/main/docs/execute-notebooks.md To produce static HTML output from your content while also executing notebooks, pass both the `--execute` and `--html` flags. ```bash myst build --execute --html ``` -------------------------------- ### Install mystmd with Mamba Source: https://github.com/jupyter-book/mystmd/blob/main/docs/installing.md Use mamba to install mystmd from the conda-forge channel. This is recommended if you are unfamiliar with package managers. ```shell mamba install -c conda-forge mystmd ``` -------------------------------- ### Link Video and Image with Wildcard for Static Exports Source: https://github.com/jupyter-book/mystmd/blob/main/docs/figures.md Use a wildcard (*) in the path to link both a video file (e.g., `.mp4`) and a corresponding image file (e.g., `.png`). This ensures the video is used for HTML output and the image for static exports like PDF. ```md ![](myvideo.*) ``` -------------------------------- ### MyST Cross-Reference File Example Source: https://github.com/jupyter-book/mystmd/blob/main/docs/website-metadata.md An example structure of the `myst.xref.json` file, which lists all cross-references within a MyST project. ```json { "version": "1", "myst": "1.2.0", "references": [ { "kind": "page", "data": "/index.json", "url": "/" }, { "identifier": "xref-features", "kind": "heading", "data": "/index.json", "url": "/", "implicit": true } ] } ``` -------------------------------- ### Launch myst-theme Server Source: https://github.com/jupyter-book/mystmd/blob/main/docs/developer.md Launch the myst-theme development server. This server fetches AST JSON from the content server and renders the website. ```shell bun run theme:book ``` -------------------------------- ### Install JupyterLab MyST Extension Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-jupyter-lab-myst.md Install the jupyterlab-myst extension using pip. This enables MyST Markdown support in JupyterLab. ```bash pip install jupyterlab_myst ``` -------------------------------- ### Manage Theme with Local Storage and MatchMedia Source: https://github.com/jupyter-book/mystmd/blob/main/packages/mystmd/tests/hidden-pages/outputs/not-hidden.html Applies a theme (light or dark) based on user's OS preference or saved theme in local storage. If no theme is set, it defaults to the OS preference. ```javascript const savedTheme = localStorage.getItem("myst:theme"); const theme = window.matchMedia("(prefers-color-scheme: light)").matches ? 'light' : 'dark'; const classes = document.documentElement.classList; const hasAnyTheme = classes.contains('light') || classes.contains('dark'); if (!hasAnyTheme) classes.add(savedTheme ?? theme); ``` -------------------------------- ### Build MyST Application with Bun Source: https://github.com/jupyter-book/mystmd/blob/main/docs/contribute-build-locally.md Execute this command after dependency installation to build the MyST application. The first build may take time, but subsequent builds are faster due to caching. ```shell bun run build ``` -------------------------------- ### Display Text Output (Zen of Python) Source: https://github.com/jupyter-book/mystmd/blob/main/docs/interactive-notebooks.ipynb Import and print the 'Zen of Python' to demonstrate text-based output. ```python #| label:zen import this ``` -------------------------------- ### Build and Link MyST Locally Source: https://github.com/jupyter-book/mystmd/blob/main/docs/contribute-add-feature.md Install dependencies, build the MyST application, and link it locally. These steps are necessary to test the newly added role using the MyST CLI. ```shell $ bun install $ bun run build $ bun run link ``` -------------------------------- ### Install myst-parser for Node.js Source: https://github.com/jupyter-book/mystmd/blob/main/packages/myst-parser/docs/consuming/basic.md Install the myst-parser package using npm. This is the first step before importing and using the library in your Node.js project. ```bash npm install myst-parser ``` -------------------------------- ### Clone myst-theme Repository and Install Dependencies Source: https://github.com/jupyter-book/mystmd/blob/main/docs/developer.md Clone the myst-theme repository and install its dependencies using Bun. This is required for developing the theme. ```shell git clone https://github.com/jupyter-book/myst-theme/ cd myst-theme bun install ``` -------------------------------- ### Widget with Initial State Source: https://github.com/jupyter-book/mystmd/blob/main/docs/widgets.md Shows how to instantiate a widget with initial state values. The JSON object following the widget module path provides key-value pairs for the widget's model. ```markdown ```{anywidget} my-widget.mjs { "count": 0 } ``` ``` -------------------------------- ### Install ImageMagick for GIF Conversion Source: https://github.com/jupyter-book/mystmd/blob/main/docs/quickstart-static-exports.md Install ImageMagick on your system to enable the conversion of animated GIFs to static images for PDF exports. ```bash # on Mac OS brew install imagemagick # on Ubuntu apt install imagemagick ``` -------------------------------- ### Copy Build Output to Apache DocumentRoot Source: https://github.com/jupyter-book/mystmd/blob/main/docs/deployment-webserver.md Use this command to copy the static site files to the web server's file system. Ensure the destination path matches your server's configuration. ```shell cp -r _build/html /var/www/html/my-project ``` -------------------------------- ### Install Mamba and Conda versions Source: https://github.com/jupyter-book/mystmd/blob/main/docs/installing.md Check the mamba version and then install texlive-core and latexmk from conda-forge for $\LaTeX$ and PDF export dependencies. ```shell $ mamba --version mamba 1.5.8 conda 24.7.1 ``` ```shell $ mamba install -c conda-forge texlive-core latexmk ``` -------------------------------- ### Print Hello World in Python Source: https://github.com/jupyter-book/mystmd/blob/main/packages/mystmd/tests/notebook-with-fm/input.ipynb A basic Python command to print a string to the console. Ensure Python is installed and accessible in your environment. ```python print('hello world') ``` -------------------------------- ### Install mystmd with NPM Source: https://github.com/jupyter-book/mystmd/blob/main/docs/installing.md Install mystmd globally using npm, yarn, or pnpm. Ensure your Node.js version is up to date (v20+). ```shell npm install -g mystmd ``` -------------------------------- ### Install mystmd with Conda Source: https://github.com/jupyter-book/mystmd/blob/main/docs/installing.md Use conda to install mystmd from the conda-forge channel. Conda is typically included with the Anaconda Python distribution. ```shell conda install -c conda-forge mystmd ``` -------------------------------- ### Project-Wide Configuration Example Source: https://github.com/jupyter-book/mystmd/blob/main/docs/frontmatter.md Fields placed in project-wide configuration are nested under the `project` key in `myst.yml`. This example shows the `edit_url` field. ```yaml project: edit_url: null ```