From ab3157aef896cc7839c3a246524a1324688e05b1 Mon Sep 17 00:00:00 2001 From: Sashank Thupukari Date: Wed, 27 Jan 2021 09:16:18 -0500 Subject: [PATCH] (docs-infra-5) Rest of docs scaffolding Summary: This diff introduces the most of the rest of the scaffolding for the new site, including versioning, MDX rendering, sidebar logic, and design. Test Plan: unit Reviewers: yuhan Reviewed By: yuhan Differential Revision: https://dagster.phacility.com/D6176 --- docs/Makefile | 6 +- docs/next/.versioned_content/.gitkeep | 0 docs/next/components/Icons.tsx | 58 + docs/next/components/MDXComponents.tsx | 52 + docs/next/components/Pagination.tsx | 83 + docs/next/components/Sidebar.tsx | 580 +++++ docs/next/components/VersionedLink.tsx | 19 + docs/next/content/_navigation.json | 612 +++++ .../concepts/solids-pipelines/solids.mdx | 45 + docs/next/layouts/MainLayout.tsx | 475 ++++ docs/next/next.config.js | 18 + docs/next/package.json | 6 +- docs/next/pages/[...page].tsx | 63 + docs/next/pages/_app.tsx | 7 +- docs/next/pages/_modules/index.tsx | 9 - docs/next/pages/index.tsx | 2 +- docs/next/tailwind.config.js | 21 + docs/next/yarn.lock | 1959 ++++++++++++++++- docs/update_version.py | 49 + 19 files changed, 4019 insertions(+), 45 deletions(-) create mode 100644 docs/next/.versioned_content/.gitkeep create mode 100644 docs/next/components/Icons.tsx create mode 100644 docs/next/components/MDXComponents.tsx create mode 100644 docs/next/components/Pagination.tsx create mode 100644 docs/next/components/Sidebar.tsx create mode 100644 docs/next/components/VersionedLink.tsx create mode 100644 docs/next/content/_navigation.json create mode 100644 docs/next/content/concepts/solids-pipelines/solids.mdx create mode 100644 docs/next/layouts/MainLayout.tsx create mode 100644 docs/next/next.config.js create mode 100644 docs/next/pages/[...page].tsx delete mode 100644 docs/next/pages/_modules/index.tsx create mode 100644 docs/update_version.py diff --git a/docs/Makefile b/docs/Makefile index 9fe2425f6e47c..e50dcaaee3ef4 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,2 +1,6 @@ build: - cd sphinx; make clean; make json; cd ..; python pack_json.py \ No newline at end of file + cd sphinx; make clean; make json; cd ..; python pack_json.py + +update_version: + echo "Saving version $(version)" + python update_version.py --version $(version) \ No newline at end of file diff --git a/docs/next/.versioned_content/.gitkeep b/docs/next/.versioned_content/.gitkeep new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/docs/next/components/Icons.tsx b/docs/next/components/Icons.tsx new file mode 100644 index 0000000000000..c54e05a7fe909 --- /dev/null +++ b/docs/next/components/Icons.tsx @@ -0,0 +1,58 @@ +const BookOpenIcon = ( + +); + +const MenuIcon = ( + +); + +const AcademicCapIcon = ( + <> + + + + +); + +const CodeIcon = ( + +); + +const CloudUploadIcon = ( + +); + +const Icons = { + BookOpen: BookOpenIcon, + Menu: MenuIcon, + AcademicCap: AcademicCapIcon, + Code: CodeIcon, + CloudUpload: CloudUploadIcon, +}; + +export default Icons; diff --git a/docs/next/components/MDXComponents.tsx b/docs/next/components/MDXComponents.tsx new file mode 100644 index 0000000000000..bc2332dc32763 --- /dev/null +++ b/docs/next/components/MDXComponents.tsx @@ -0,0 +1,52 @@ +// This file contains components used by MDX files. It is important to be careful when changing these, +// because these components need to be backwards compatible. If you need to udpate a component with a +// breaking change, rename the existing component across the codebase and save a copy. + +// For example, if you need to update `PyObject`, rename the existing component to `PyObjectLegacy` +// and update all existing usage of it + +import { useState } from "react"; + +const ExampleComponent = () => { + return Hello!; +}; + +const AlertComponent = ({ children }) => { + return
{children}
; +}; + +const PyObject = ({ object, displayText }) => { + return ( + + {displayText || object} + + ); +}; + +const Counter = () => { + const [count, setCount] = useState(0); + + return ( +
+
{count}
+
+ + +
+
+ ); +}; + +export default { + ExampleComponent, + AlertComponent, + PyObject, + Counter, +}; diff --git a/docs/next/components/Pagination.tsx b/docs/next/components/Pagination.tsx new file mode 100644 index 0000000000000..8bdaf86b0c1d8 --- /dev/null +++ b/docs/next/components/Pagination.tsx @@ -0,0 +1,83 @@ +import { useRouter } from "next/router"; +import React from "react"; +import navigation from "../content/_navigation.json"; +import VersionedLink from "./VersionedLink"; + +function flatten(yx: any) { + const xs = JSON.parse(JSON.stringify(yx)); + + return xs.reduce((acc: any, x: any) => { + acc = acc.concat(x); + if (x.children) { + acc = acc.concat(flatten(x.children)); + x.children = []; + } + return acc; + }, []); +} + +const flattenedNavigation = flatten(navigation).filter( + (n: { path: any }) => n.path +); + +const Pagination = () => { + const { asPath } = useRouter(); + const currentIndex = flattenedNavigation.findIndex( + (n: { path: string }) => n.path === asPath + ); + const prev = flattenedNavigation[currentIndex - 1]; + const next = flattenedNavigation[currentIndex + 1]; + + return ( + + ); +}; + +export default Pagination; diff --git a/docs/next/components/Sidebar.tsx b/docs/next/components/Sidebar.tsx new file mode 100644 index 0000000000000..e3bd7362e3261 --- /dev/null +++ b/docs/next/components/Sidebar.tsx @@ -0,0 +1,580 @@ +import Link from "next/link"; +import cx from "classnames"; +import { useRouter } from "next/router"; +import { useState } from "react"; + +import navigation from "../content/_navigation.json"; +import Icons from "../components/Icons"; +import VersionedLink from "./VersionedLink"; +import { Menu, Transition } from "@headlessui/react"; + +const getCurrentSection = () => { + const { asPath } = useRouter(); + const match = navigation.find( + (item) => item.path !== "/" && asPath.startsWith(item.path) + ); + return match || navigation.find((item) => item.path === "/"); +}; + +const TopLevelNavigation = () => { + const currentSection = getCurrentSection(); + + return ( +
+ {navigation.map((item) => { + const match = item == currentSection; + + return ( + + + + {item.title} + + + ); + })} +
+ ); +}; + +const SecondaryNavigation = () => { + const currentSection = getCurrentSection(); + + if (!currentSection?.children) { + return null; + } + + return ( + <> + {currentSection.children.map((section) => { + return ( +
+

+ {section.title} +

+ +
+
+ {section.children.map((section) => { + return ( + + ); + })} +
+
+
+ ); + })} + + ); +}; + +const Dropdown = () => { + const { locale: currentVersion, locales: versions, asPath } = useRouter(); + + return ( +
+
+ + {({ open }) => ( + <> +
+ + + + + {" "} + + {currentVersion} + + + + {/* Heroicon name: selector */} + + + +
+ + + +
+

+ You are currently viewing the docs for Dagster{" "} + + {currentVersion} + + . You can select a different version below. +

+
+ +
+ {versions.map((version) => { + return ( + + + {({ active }) => ( + + {version} + + )} + + + ); + })} +
+ +
+ + {({ active }) => ( + + Legacy Site (pre-0.11.0) + + )} + +
+
+
+ + )} +
+
+
+ ); +}; + +const VersionDropdown = () => { + const { locale: currentVersion, locales: versions, asPath } = useRouter(); + + const [openVersionsDropdown, setOpenVersionsDropdown] = useState( + false + ); + + const toggleVersionsDropdown = () => { + setOpenVersionsDropdown(!openVersionsDropdown); + }; + + return ( +
+
+ +
+ {/* +Dropdown panel, show/hide based on dropdown state. + +Entering: "transition ease-out duration-100" +From: "transform opacity-0 scale-95" +To: "transform opacity-100 scale-100" +Leaving: "transition ease-in duration-75" +From: "transform opacity-100 scale-100" +To: "transform opacity-0 scale-95" +*/} +
+
+ {versions.map((version) => ( + + + {version} + + + ))} +
+ +
+
+ ); +}; + +const RecursiveNavigation = ({ section }) => { + const { asPath, locale: version } = useRouter(); + + return ( + + + {section.title} + + + ); +}; + +const Sidebar = () => { + const [openMobileMenu, setOpenMobileMenu] = useState(false); + + const openSidebar = () => { + setOpenMobileMenu(true); + }; + + const closeSidebar = () => { + setOpenMobileMenu(false); + }; + + return ( + <> + {/* Off-canvas menu for mobile, show/hide based on off-canvas menu state. */} +
+
+ {/* + Off-canvas menu overlay, show/hide based on off-canvas menu state. + + Entering: "transition-opacity ease-linear duration-300" + From: "opacity-0" + To: "opacity-100" + Leaving: "transition-opacity ease-linear duration-300" + From: "opacity-100" + To: "opacity-0" +*/} + +
+ {/* Static sidebar for desktop */} +
+
+ + + {/* Sidebar component, swap this element with another sidebar if you like */} +
+
+ {/* Sidebar Search */} +
+ +
+ + +
+
+ {/* Navigation */} + +
+
+
+ + ); +}; + +export default Sidebar; diff --git a/docs/next/components/VersionedLink.tsx b/docs/next/components/VersionedLink.tsx new file mode 100644 index 0000000000000..a136025b6f7ee --- /dev/null +++ b/docs/next/components/VersionedLink.tsx @@ -0,0 +1,19 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; + +interface VersionedLinkProps { + href: string; + children: JSX.Element; +} + +const VersionedLink = ({ href, children }: VersionedLinkProps) => { + const { locale } = useRouter(); + + return ( + + {children} + + ); +}; + +export default VersionedLink; diff --git a/docs/next/content/_navigation.json b/docs/next/content/_navigation.json new file mode 100644 index 0000000000000..d2bed640c8ce2 --- /dev/null +++ b/docs/next/content/_navigation.json @@ -0,0 +1,612 @@ +[ + { + "title": "Tutorial", + "icon": "AcademicCap", + "path": "/tutorial", + "children": [ + { + "title": "Intro Tutorial", + "children": [ + { + "title": "Setup", + "path": "/tutorials/intro-tutorial/tutorial-1-setup" + }, + + { + "title": "Inputs and Outputs", + "path": "/tutorials/intro-tutorial/tutorial-2-inputs-outputs" + }, + + { + "title": "Using Dagit", + "path": "/tutorials/intro-tutorial/tutorial-3-using-dagit" + }, + { + "title": "Solid Configuration", + "path": "/tutorials/intro-tutorial/tutorial-4-solid-configuration" + }, + { + "title": "Modes and Resources", + "path": "/tutorials/intro-tutorial/tutorial-5-modes-resources" + }, + { + "title": "Testing Pipelines", + "path": "/tutorials/intro-tutorial/tutorial-5-testing-pipelines" + }, + { + "title": "Next Steps", + "path": "/tutorials/intro-tutorial/tutorial-6-next-steps" + } + ] + }, + + { + "title": "Advanced Tutorials", + "children": [ + { + "title": "Setting up a Workspace", + "path": "/tutorials/advanced-tutorial/tutorial-1-getting-started" + }, + + { + "title": "Dagster Types", + "path": "/tutorials/advanced-tutorial/tutorial-2-inputs-outputs" + }, + + { + "title": "Presets", + "path": "/tutorials/advanced-tutorial/tutorial-3-using-dagit" + }, + { + "title": "Advanced Dagster Types", + "path": "/tutorials/advanced-tutorial/tutorial-4-solid-configuration" + }, + { + "title": "Customizing Execution", + "path": "/tutorials/advanced-tutorial/tutorial-5-modes-resources" + }, + { + "title": "Re-execution", + "path": "/tutorials/advanced-tutorial/tutorial-5-testing-pipelines" + }, + { + "title": "Asset Materializations", + "path": "/tutorials/advanced-tutorial/tutorial-6-next-steps" + }, + + { + "title": "Composite Solids", + "path": "/tutorials/advanced-tutorial/tutorial-6-next-steps" + }, + + { + "title": "Partitions and Backfills", + "path": "/tutorials/advanced-tutorial/tutorial-6-next-steps" + }, + { + "title": "Scheduling and Sensors", + "path": "/tutorials/advanced-tutorial/tutorial-6-next-steps" + } + ] + } + ] + }, + { + "title": "Main Concepts", + "icon": "Menu", + "path": "/", + "children": [ + { + "title": "Solids & Pipelines", + "children": [ + { + "title": "Solids", + "path": "/overview/solids-pipelines/solids" + }, + { + "title": "Inputs and Outputs", + "path": "/overview/solids-pipelines/inputs-and-outputs" + }, + { + "title": "Solid Configuration", + "path": "/overview/solids-pipelines/inputs-and-outputs" + }, + { + "title": "Pipelines", + "path": "/overview/solids-pipelines/pipelines" + }, + { + "title": "Solid Events", + "path": "/overview/solids-pipelines/solid-events" + }, + { + "title": "Solid Factories", + "path": "/overview/solids-pipelines/solid-factories" + }, + { + "title": "Testing Solids and Pipelines", + "path": "/overview/solids-pipelines/solid-factories" + } + ] + }, + { + "title": "Pipeline Runs", + "children": [ + { + "title": "Run Config", + "path": "/overview/solids-pipelines/solids" + }, + { + "title": "Creating Pipeline Runs", + "path": "/overview/solids-pipelines/pipelines" + } + ] + }, + { + "title": "Modes", + "children": [ + { + "title": "Pipeline Modes", + "path": "/overview/solids-pipelines/solids" + } + ] + }, + { + "title": "Resources", + "children": [ + { + "title": "Resource Definitions", + "path": "/overview/resources/resource-definition" + }, + { + "title": "Testing Resources", + "path": "/overview/reources/testing-resources" + } + ] + }, + { + "title": "Configuration System", + "children": [ + { + "title": "Config Types", + "path": "/overview/configuration/run-config" + }, + { + "title": "Configured API", + "path": "/overview/configuration/configured" + }, + { + "title": "Presets", + "path": "/overview/configuration/configured" + } + ] + }, + { + "title": "Inputs and Outputs", + "children": [ + { + "title": "IOManagers", + "path": "/overview/configuration/run-config" + }, + { + "title": "Writing custom IO Managers", + "path": "/overview/configuration/run-config" + } + ] + }, + { + "title": "Assets", + "children": [ + { + "title": "Asset Materializations", + "path": "/overview/configuration/run-config" + }, + { + "title": "Asset Catalog", + "path": "/overview/configuration/configured" + } + ] + }, + { + "title": "Repositories & Workspaces", + "children": [ + { + "title": "Overview", + "path": "/overview/repositories-workspaces/repositories" + }, + { + "title": "Repositories", + "path": "/overview/repositories-workspaces/repositories" + }, + { + "title": "Workspaces", + "path": "/overview/repositories-workspaces/workspaces" + } + ] + }, + { + "title": "Logging", + "childPath": true, + "children": [ + { + "title": "Loggers", + "path": "/overview/logging/logging" + }, + { + "title": "Customize Logging", + "path": "/overview/logging/customize-logging" + } + ] + }, + { + "title": "Partitions & Schedules", + "children": [ + { + "title": "Partitions", + "path": "/overview/scheduling-partitions/partitions" + }, + { + "title": "Schedules", + "path": "/overview/scheduling-partitions/schedules" + }, + { + "title": "Backfills", + "path": "/overview/scheduling-partitions/backfill" + } + ] + }, + + { + "title": "Run Launchers & Executors", + "children": [ + { + "title": "Run Launchers", + "path": "/overview/run-launchers-executors/run-launcher" + }, + { + "title": "Executors", + "path": "/overview/run-launchers-executors/executor" + } + ] + }, + + { + "title": "Dagster Instance", + "children": [ + { + "title": "Storages (Run/Event/Schedule)", + "path": "/overview/run-launchers-executors/run-launcher" + }, + + { + "title": "Dagster Daemon", + "path": "/overview/run-launchers-executors/run-launcher" + }, + + { + "title": "Scheduler", + "path": "/overview/run-launchers-executors/run-launcher" + }, + + { + "title": "Run Coordinator", + "path": "/overview/run-launchers-executors/run-launcher" + }, + { + "title": "Run Launcher", + "path": "/overview/run-launchers-executors/run-launcher" + } + ] + } + ] + }, + + { + "title": "Guides", + "icon": "CloudUpload", + "path": "/deployment", + "children": [ + { + "title": "Dagster Deployments", + "children": [ + { + "title": "Overview", + "path": "/deployment/overview" + }, + { + "title": "Dagster Instance", + "path": "/deployment/dagster-instance" + }, + { + "title": "User Code Isolation", + "path": "/deployment/user-code-isolation" + }, + { + "title": "Building User Code Images", + "path": "/deployment/building-user-code-images" + }, + { + "title": "Executors & Run Launchers", + "path": "/deployment/executors-run-launchers" + }, + { + "title": "Dagster Daemon", + "path": "/deployment/dagster-daemon" + } + ] + }, + + { + "title": "Deploy on AWS", + "children": [ + { + "title": "EC2 Deployment Guide", + "path": "/deployment/guides/overview" + }, + { + "title": "ECS Deployment Guide", + "path": "/deployment/guides/overview" + }, + { + "title": "EKS Deployment Guide", + "path": "/deployment/guides/overview" + } + ] + }, + { + "title": "Deploy on Kubernetes", + "children": [ + { + "title": "K8s Executor & Launcher", + "path": "/deployment/guides/overview" + }, + { + "title": "EKS Deployment Guide", + "path": "/deployment/guides/overview" + }, + { + "title": "GKE Deployment Guide", + "path": "/deployment/guides/overview" + }, + { + "title": "Other Cluster Deployment", + "path": "/deployment/guides/overview" + } + ] + }, + { + "title": "Deploy on Custom Infra", + "children": [ + { + "title": "Single-node Deployment", + "path": "/deployment/guides/overview" + }, + { + "title": "Celery-based Deployment", + "path": "/deployment/guides/overview" + }, + { + "title": "Writing a custom run Launcher", + "path": "/deployment/guides/overview" + } + ] + }, + { + "title": "Deploy on PAAS", + "children": [ + { + "title": "Heroku Deployment Guide", + "path": "/deployment/guides/overview" + }, + { + "title": "Render Deployment Guide", + "path": "/deployment/guides/overview" + } + ] + } + ] + }, + { + "title": "Examples", + "icon": "Code", + "path": "/examples", + "children": [] + }, + { + "title": "API Reference", + "icon": "BookOpen", + "path": "/_apidocs", + "children": [ + { + "title": "Core", + "children": [ + { + "title": "Solids", + "path": "/_apidocs/solids" + }, + { + "title": "Pipelines", + "path": "/_apidocs/pipeline" + }, + { + "title": "Modes & Resources", + "path": "/_apidocs/modes-resources" + }, + { + "title": "Presets", + "path": "/_apidocs/presets" + }, + { + "title": "Loggers", + "path": "/_apidocs/loggers" + }, + { + "title": "Repositories", + "path": "/_apidocs/repositories" + }, + { + "title": "Config", + "path": "/_apidocs/config" + }, + { + "title": "Types", + "path": "/_apidocs/types" + }, + { + "title": "Dagster CLI", + "path": "/_apidocs/cli" + }, + { + "title": "Schedules and Sensors", + "path": "/_apidocs/schedules-sensors" + }, + { + "title": "Partitions", + "path": "/_apidocs/partitions" + }, + { + "title": "Errors", + "path": "/_apidocs/errors" + }, + { + "title": "Execution", + "path": "/_apidocs/execution" + }, + { + "title": "Hooks", + "path": "/_apidocs/hooks" + }, + { + "title": "Asset Stores (Experimental)", + "path": "/_apidocs/assets" + }, + { + "title": "Utilities", + "path": "/_apidocs/utilities" + }, + { + "title": "Internals", + "path": "/_apidocs/internals" + } + ] + }, + { + "title": "Libraries", + "children": [ + { + "title": "Dagstermill", + "path": "/_apidocs/libraries/dagstermill" + }, + { + "title": "Airflow (dagster_airflow)", + "path": "/_apidocs/libraries/dagster_airflow" + }, + { + "title": "AWS (dagster_aws)", + "path": "/_apidocs/libraries/dagster_aws" + }, + { + "title": "Azure (dagster_azure)", + "path": "/_apidocs/libraries/dagster_azure" + }, + { + "title": "Celery (dagster_celery)", + "path": "/_apidocs/libraries/dagster_celery" + }, + { + "title": "Celery + Docker (dagster_celery_docker)", + "path": "/_apidocs/libraries/dagster_celery_docker" + }, + { + "title": "Cron (dagster_cron)", + "path": "/_apidocs/libraries/dagster_cron" + }, + { + "title": "Dask (dagster_dask)", + "path": "/_apidocs/libraries/dagster_dask" + }, + { + "title": "Datadog (dagster_datadog)", + "path": "/_apidocs/libraries/dagster_datadog" + }, + { + "title": "Databricks (dagster_databricks)", + "path": "/_apidocs/libraries/dagster_databricks" + }, + { + "title": "dbt (dagster_dbt)", + "path": "/_apidocs/libraries/dagster_dbt" + }, + { + "title": "GCP (dagster_gcp)", + "path": "/_apidocs/libraries/dagster_gcp" + }, + { + "title": "Great Expectations (dagster_ge)", + "path": "/_apidocs/libraries/dagster_ge" + }, + { + "title": "Github (dagster_github)", + "path": "/_apidocs/libraries/dagster_github" + }, + { + "title": "Kubernetes (dagster_k8s)", + "path": "/_apidocs/libraries/dagster_k8s" + }, + { + "title": "PagerDuty (dagster_pagerduty)", + "path": "/_apidocs/libraries/dagster_pagerduty" + }, + { + "title": "Pandas (dagster_pandas)", + "path": "/_apidocs/libraries/dagster_pandas" + }, + { + "title": "Papertrail (dagster_papertrail)", + "path": "/_apidocs/libraries/dagster_papertrail" + }, + { + "title": "PostgreSQL (dagster_postgres)", + "path": "/_apidocs/libraries/dagster_postgres" + }, + { + "title": "Prometheus (dagster_prometheus)", + "path": "/_apidocs/libraries/dagster_prometheus" + }, + { + "title": "Pyspark (dagster_pyspark)", + "path": "/_apidocs/libraries/dagster_pyspark" + }, + { + "title": "Shell (dagster_shell)", + "path": "/_apidocs/libraries/dagster_shell" + }, + { + "title": "Slack (dagster_slack)", + "path": "/_apidocs/libraries/dagster_slack" + }, + { + "title": "Snowflake (dagster_snowflake)", + "path": "/_apidocs/libraries/dagster_snowflake" + }, + { + "title": "Spark (dagster_spark)", + "path": "/_apidocs/libraries/dagster_spark" + }, + { + "title": "SSH / SFTP (dagster_ssh)", + "path": "/_apidocs/libraries/dagster_ssh" + }, + { + "title": "Twilio (dagster_twilio)", + "path": "/_apidocs/libraries/dagster_twilio" + }, + { + "title": "Lakehouse (experimental)", + "path": "/_apidocs/libraries/lakehouse" + } + ] + } + ] + } +] diff --git a/docs/next/content/concepts/solids-pipelines/solids.mdx b/docs/next/content/concepts/solids-pipelines/solids.mdx new file mode 100644 index 0000000000000..0f27b5f0445dd --- /dev/null +++ b/docs/next/content/concepts/solids-pipelines/solids.mdx @@ -0,0 +1,45 @@ +--- +title: Solids +description: This frontmatter description will appear below the title +--- + +# Solids + + + +The core abstraction of Dagster is the _solid_. A solid is a functional unit of computation. It has defined inputs and +outputs, and multiple solids can be wired together to form a by +defining dependencies between solid inputs and outputs. + +A solid has a number of properties: + +- Coarse-grained and for use in batch computations. +- Defines inputs and outputs, optionally typed within the Dagster type system. +- Embeddable in a dependency graph (pipeline) that is constructed by connecting the inputs and outputs of + multiple solids. +- Emits a stream of typed, structured events — such as expectations and materializations — + corresponding to the semantics of its computation. +- Exposes self-describing, strongly typed configuration. +- Testable and reusable. + +## Defining a solid + +There are two ways to define a solid: + +1. Wrap a python function in the decorator + _\[Preferred\]_ +2. Construct a object + +**Method 1: Using the decorator** + +To use the decorator, +wrap a function that takes a `context` argument as the first +parameter. The context is provides access to system information such as +resources and solid configuration. See [Solid Context](#solid-context) for more information. + +```python literalinclude caption=solids.py +file:/docs_snippets/docs_snippets/overview/solids_pipelines/solid_definition.py +lineno-start: +startAfter:start_solid_definition_marker_0 +endBefore:end_solid_definition_marker_0 +``` diff --git a/docs/next/layouts/MainLayout.tsx b/docs/next/layouts/MainLayout.tsx new file mode 100644 index 0000000000000..f5256cad23975 --- /dev/null +++ b/docs/next/layouts/MainLayout.tsx @@ -0,0 +1,475 @@ +import React, { useEffect, useState } from "react"; +import Sidebar from "../components/Sidebar"; +import { useRouter } from "next/router"; +import Link from "next/link"; + +const SearchBar = ({ openSearch, setSearchTerm }) => { + return ( +
+
+ +
+
+ {/* Heroicon name: search */} + +
+ setSearchTerm(event.target.value)} + onFocus={openSearch} + /> +
+
+
+ ); +}; + +const RandomResult = ({ searchTerm }) => { + const front = Math.floor(Math.random() * 6) + 1; + const back = Math.floor(Math.random() * 6) + 1; + + return ( + + {searchTerm}{" "} + + ); +}; + +const SearchResults = ({ searchTerm }) => { + const results = Math.floor(Math.random() * 40) + 1; + + return ( + <> +
+
+
+ + +
+
+
+ +
+
+ {results} Results +
+
+
+
+
+
+
+ {[...Array(results)].map((i) => ( + + ))} +
+ + ); +}; + +const FeedbackModal = ({ closeFeedback }: { closeFeedback: () => void }) => { + const { asPath } = useRouter(); + const [currentPage, setCurrentPage] = useState(asPath); + + return ( +
+
+
+ {/* + Slide-over panel, show/hide based on slide-over state. + + Entering: "transform transition ease-in-out duration-500 sm:duration-700" + From: "translate-x-full" + To: "translate-x-0" + Leaving: "transform transition ease-in-out duration-500 sm:duration-700" + From: "translate-x-0" + To: "translate-x-full" +*/} +
+
+
+
+
+

+ Submit Feedback +

+
+ +
+
+
+

+ Feedback helps us improve our documentation so you can be + more productive. Please let us know about anything! +

+
+
+
+
+
+
+ +
+ + setCurrentPage(event.target.value) + } + /> +
+
+
+ +
+