summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhemanthnakkina <mail2hemanth.n@gmail.com>2018-11-29 21:12:43 +0530
committerGitHub <noreply@github.com>2018-11-29 21:12:43 +0530
commita2eedb63702ae473b7c5ab57e7615a1d0684e0c5 (patch)
treea6038b6e20e7d2488d1bdeac1466690bf38e2817
parent89a0a3c4874211ddddfc508669466fb0a80d82b3 (diff)
parent6c8533c9a1d8ca8795cf35a04530fd2d58c9a270 (diff)
Merge pull request #6 from pawansingh126/master
Add yaml-editor documentation.
-rw-r--r--doc/source/getting_started.rst2
-rw-r--r--doc/source/index.rst1
-rw-r--r--doc/source/tugboat.rst4
-rw-r--r--doc/source/yaml-editor.rst65
-rw-r--r--spyglass/utils/editor/editor.py2
5 files changed, 70 insertions, 4 deletions
diff --git a/doc/source/getting_started.rst b/doc/source/getting_started.rst
index 892e476..fec8cc6 100644
--- a/doc/source/getting_started.rst
+++ b/doc/source/getting_started.rst
@@ -73,7 +73,7 @@ Supported Features
73 endpoint. 73 endpoint.
74 74
753. YAML Editor for Intermediary YAML: Support runtime editing of missing 753. YAML Editor for Intermediary YAML: Support runtime editing of missing
76 site parameters 76 site parameters, see :ref:`yaml-editor-info`
77 77
78Future Work 78Future Work
79----------- 79-----------
diff --git a/doc/source/index.rst b/doc/source/index.rst
index b0ec2b9..924681c 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -33,3 +33,4 @@ fed to Shipyard for site deployment / updates.
33 33
34 getting_started 34 getting_started
35 tugboat 35 tugboat
36 yaml-editor
diff --git a/doc/source/tugboat.rst b/doc/source/tugboat.rst
index 3236128..9851149 100644
--- a/doc/source/tugboat.rst
+++ b/doc/source/tugboat.rst
@@ -1,4 +1,4 @@
1 1..
2 Copyright 2018 AT&T Intellectual Property. 2 Copyright 2018 AT&T Intellectual Property.
3 All Rights Reserved. 3 All Rights Reserved.
4 4
@@ -90,7 +90,7 @@ Example: Tugboat Plugin Usage
90 b) Excel Spec: excel_spec_upstream.yaml 90 b) Excel Spec: excel_spec_upstream.yaml
91 c) Site Config: site_config.yaml 91 c) Site Config: site_config.yaml
92 d) Template_dir: '../examples/templates' 92 d) Template_dir: '../examples/templates'
93 c) Site name: airship-seaworthy 93 e) Site name: airship-seaworthy
94 94
952. Spyglass CLI Command: 952. Spyglass CLI Command:
96 spyglass -mg -t tugboat -x SiteDesignSpec_v0.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<relative path to '../examples/templates' 96 spyglass -mg -t tugboat -x SiteDesignSpec_v0.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<relative path to '../examples/templates'
diff --git a/doc/source/yaml-editor.rst b/doc/source/yaml-editor.rst
new file mode 100644
index 0000000..56b9ec5
--- /dev/null
+++ b/doc/source/yaml-editor.rst
@@ -0,0 +1,65 @@
1..
2 Copyright 2018 AT&T Intellectual Property.
3 All Rights Reserved.
4
5 Licensed under the Apache License, Version 2.0 (the "License"); you may
6 not use this file except in compliance with the License. You may obtain
7 a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 License for the specific language governing permissions and limitations
15 under the License.
16
17.. _yaml-editor-info:
18
19===========
20Yaml Editor
21===========
22
23What is Yaml Editor?
24--------------------
25
26Yaml Editor is a spyglass utility which lets user edit their generated
27intermediary file in a browser window. It is a minimal flask app which is
28invoked from the parser engine in order to let user edit fields which
29could not be fetched via :ref:`tugboatinfo` plugin.
30
31
32Yaml Editor Utility Inputs
33--------------------------
34
35a) Yaml File: Yaml file required to be edited (This is required field)
36b) Port: Port on which app shall be running
37c) Host: This is only used to form URL which can be followed to open file in browser
38d) String: String which is required to be updated in the file (default is '#CHANGE_ME')
39
40Yaml Editor Utility Usage
41-------------------------
42
43 With Spyglass (edit option is True by default):
44 ::
45
46 spyglass -mg --edit_intermediary -t tugboat -x SiteDesignSpec_v0.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<relative path to '../examples/templates'
47
48 As a stand-alone editor:
49 ::
50
51 yaml-editor -f <yaml-file>
52
53 Help:
54 ::
55
56 > yaml-editor --help
57 Usage: yaml-editor [OPTIONS]
58
59 Options:
60 -f, --file FILENAME Path with file name to the intermediary yaml file.
61 [required]
62 -h, --host TEXT Optional host parameter to run Flask on.
63 -p, --port INTEGER Optional port parameter to run Flask on.
64 -s, --string TEXT Text which is required to be changed on yaml file.
65 --help Show this message and exit.
diff --git a/spyglass/utils/editor/editor.py b/spyglass/utils/editor/editor.py
index 689b054..d2b9d04 100644
--- a/spyglass/utils/editor/editor.py
+++ b/spyglass/utils/editor/editor.py
@@ -105,7 +105,7 @@ def run(*args, **kwargs):
105 default='0.0.0.0', 105 default='0.0.0.0',
106 type=click.STRING, 106 type=click.STRING,
107 multiple=False, 107 multiple=False,
108 help="Optional port parameter to run Flask on." 108 help="Optional host parameter to run Flask on."
109) 109)
110@click.option( 110@click.option(
111 '--port', 111 '--port',