From fcb9eaebdaa335c10a8de733cff2729853fb74d4 Mon Sep 17 00:00:00 2001 From: Nick Mattis Date: Mon, 20 Feb 2023 16:36:28 -0500 Subject: [PATCH] :pencil2: Minor updates to plugin getting started tutorial docs (#4736) * some minor updates to plugin getting started tutorial docs * fix helloworld to stay camelcase --- docs/plugins/gettingstarted.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/plugins/gettingstarted.rst b/docs/plugins/gettingstarted.rst index 41d3ec9f7..202797501 100644 --- a/docs/plugins/gettingstarted.rst +++ b/docs/plugins/gettingstarted.rst @@ -20,7 +20,7 @@ development environment:: $ virtualenv venv [...] $ source venv/bin/activate - (venv) $ pip install -e .[develop,plugins] + (venv) $ pip install -e '.[develop,plugins]' [...] (venv) $ octoprint --help Usage: octoprint [OPTIONS] COMMAND [ARGS]... @@ -163,7 +163,7 @@ Then we can use the ``octoprint dev plugin:new`` command [#f1]_ to generate a ne email [you@example.com]: you@somewhere.net github_username [you]: yourGithubName plugin_version [0.1.0]: 1.0.0 - plugin_description [TODO]: A quick "Hello World" example plugin for OCtoPrint + plugin_description [TODO]: A quick "Hello World" example plugin for OctoPrint plugin_license [AGPLv3]: plugin_homepage [https://github.com/yourGithubName/OctoPrint-Helloworld]: plugin_source [https://github.com/yourGithubName/OctoPrint-Helloworld]: @@ -178,6 +178,9 @@ Then we can use the ``octoprint dev plugin:new`` command [#f1]_ to generate a ne This will create a project structure in the ``OctoPrint-HelloWorld`` folder we just changed to that looks like this:: extras/ + github/ + bug_report.yml + feature_request.yml README.txt helloworld.md octoprint_helloworld/ @@ -200,6 +203,7 @@ This will create a project structure in the ``OctoPrint-HelloWorld`` folder we j README.md requirements.txt setup.py + setup.cfg While we'll need some of those folders later on, we'll now delete everything that we don't need right now first, that will make it easier to understand what folder does what later on. Delete the following folders and anything in them: @@ -219,6 +223,7 @@ The final project structure should look like this for now:: MANIFEST.in README.md requirements.txt + setup.cfg setup.py Out of curiosity, take a look into the ``setup.py`` file. The cookiecutter template should have prefilled all the @@ -393,6 +398,7 @@ Our plugin's directory structure should now look like this:: README.md requirements.txt setup.py + setup.cfg Restart OctoPrint and open the web interface in your browser (make sure to clear your browser's cache!). @@ -648,6 +654,7 @@ look like this:: README.md requirements.txt setup.py + setup.cfg We need to tell OctoPrint about this new static asset so that it will properly inject it into the page. For this we just need to subclass :class:`~octoprint.plugin.AssetPlugin` and override its method :func:`~octoprint.plugin.AssetPlugin.get_assets`