From 1745d192f9c3f5c19e5d5eea7a7330f9bc296b57 Mon Sep 17 00:00:00 2001 From: Laverne Henderson Date: Wed, 17 Aug 2022 11:35:23 -0700 Subject: [PATCH] Remove incorrect "template" information (#13911) Co-authored-by: Jirka Borovec --- .../from_scratch_content.rst | 61 ------------------- .../from_scratch_component_content.rst | 47 -------------- 2 files changed, 108 deletions(-) diff --git a/docs/source-app/workflows/build_lightning_app/from_scratch_content.rst b/docs/source-app/workflows/build_lightning_app/from_scratch_content.rst index d90d8662dd..7641b4f4e7 100644 --- a/docs/source-app/workflows/build_lightning_app/from_scratch_content.rst +++ b/docs/source-app/workflows/build_lightning_app/from_scratch_content.rst @@ -58,64 +58,3 @@ Run the Lightning App on the cloud: .. code:: bash lightning run app app.py --cloud - ----- - -************************************* -Build a Lightning App from a template -************************************* -If you didn't find an Lightning App similar to the one you need (in the `Lightning App gallery `_), another option is to start from a template. -The Lightning CLI can generate a template with built-in testing that can be easily published to the -Lightning App Gallery. - -Generate a Lightning App with our template generator: - -.. code:: bash - - lightning init app your-app-name - -You'll see a print-out like this: - -.. code:: bash - - ➜ lightning init app your-app-name - - /Users/Your/Current/dir/your-app-name - INFO: laying out app template at /Users/Your/Current/dir/your-app-name - INFO: - Lightning app template created! - /Users/Your/Current/dir/your-app-name - - run your app with: - lightning run app your-app-name/app.py - - run it on the cloud to share with your collaborators: - lightning run app your-app-name/app.py --cloud - ----- - -Modify the Lightning App template -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The command above generates a Lightning App file like this: - -.. code:: python - - from your_app_name import ComponentA, ComponentB - - import lightning as L - - - class LitApp(L.LightningFlow): - def __init__(self) -> None: - super().__init__() - self.component_a = ComponentA() - self.component_b = ComponentB() - - def run(self): - self.component_a.run() - self.component_b.run() - - - app = L.LightningApp(LitApp()) - -Now you can add your own components as you wish! diff --git a/docs/source-app/workflows/build_lightning_component/from_scratch_component_content.rst b/docs/source-app/workflows/build_lightning_component/from_scratch_component_content.rst index f3168e5668..a42be9b739 100644 --- a/docs/source-app/workflows/build_lightning_component/from_scratch_component_content.rst +++ b/docs/source-app/workflows/build_lightning_component/from_scratch_component_content.rst @@ -151,50 +151,3 @@ run the app .. code:: bash lightning run app app.py - ----- - -******************************************* -Build a Lightning component from a template -******************************************* -If you'd prefer a component template with built-in testing that can be easily published to the -Lightning component gallery, generate it with our template generator: - -.. code:: bash - - lightning init component your-component-name - -You'll see a print-out like this: - -.. code:: bash - - ➜ lightning init component your-component-name - INFO: laying out component template at /Users/williamfalcon/Developer/opensource/_/lightning/scratch/hello-world - INFO: - ⚡ Lightning component template created! ⚡ - /Users/williamfalcon/Developer/opensource/_/lightning/scratch/hello-world - - ... - ----- - -Modify the component template -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The command above generates a component file like this: - -.. code:: python - - import lightning as L - - - class TemplateComponent(L.LightningWork): - def __init__(self) -> None: - super().__init__() - self.value = 0 - - def run(self): - self.value += 1 - print("welcome to your work component") - print("this is running inside a work") - -Now you can modify the component as you wish!