Browse Source

Add yaml-editor documentation.

Pawan Singh Pal 4 months ago
parent
commit
6c8533c9a1

+ 1
- 1
doc/source/getting_started.rst View File

@@ -73,7 +73,7 @@ Supported Features
73 73
    endpoint.
74 74
 
75 75
 3. YAML Editor for Intermediary YAML: Support runtime editing of missing
76
-   site parameters
76
+   site parameters, see :ref:`yaml-editor-info`
77 77
 
78 78
 Future Work
79 79
 -----------

+ 1
- 0
doc/source/index.rst View File

@@ -33,3 +33,4 @@ fed to Shipyard for site deployment / updates.
33 33
 
34 34
    getting_started
35 35
    tugboat
36
+   yaml-editor

+ 2
- 2
doc/source/tugboat.rst View File

@@ -1,4 +1,4 @@
1
-
1
+..
2 2
       Copyright 2018 AT&T Intellectual Property.
3 3
       All Rights Reserved.
4 4
 
@@ -90,7 +90,7 @@ Example: Tugboat Plugin Usage
90 90
    b) Excel Spec: excel_spec_upstream.yaml
91 91
    c) Site Config: site_config.yaml
92 92
    d) Template_dir: '../examples/templates'
93
-   c) Site name: airship-seaworthy
93
+   e) Site name: airship-seaworthy
94 94
 
95 95
 2. Spyglass CLI Command:
96 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'

+ 65
- 0
doc/source/yaml-editor.rst View File

@@ -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
+===========
20
+Yaml Editor
21
+===========
22
+
23
+What is Yaml Editor?
24
+--------------------
25
+
26
+Yaml Editor is a spyglass utility which lets user edit their generated
27
+intermediary file in a browser window. It is a minimal flask app which is
28
+invoked from the parser engine in order to let user edit fields which
29
+could not be fetched via :ref:`tugboatinfo` plugin.
30
+
31
+
32
+Yaml Editor Utility Inputs
33
+--------------------------
34
+
35
+a) Yaml File: Yaml file required to be edited (This is required field)
36
+b) Port: Port on which app shall be running
37
+c) Host: This is only used to form URL which can be followed to open file in browser
38
+d) String: String which is required to be updated in the file (default is '#CHANGE_ME')
39
+
40
+Yaml 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.

+ 1
- 1
spyglass/utils/editor/editor.py View File

@@ -105,7 +105,7 @@ def run(*args, **kwargs):
105 105
     default='0.0.0.0',
106 106
     type=click.STRING,
107 107
     multiple=False,
108
-    help="Optional port parameter to run Flask on."
108
+    help="Optional host parameter to run Flask on."
109 109
 )
110 110
 @click.option(
111 111
     '--port',

Loading…
Cancel
Save