Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jan 11, 2021
1 parent 3bc1396 commit b3bea56
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
19 changes: 15 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,21 @@ Invoke::
# Run server.
wireviz-web

# Render a plain YAML file.
echo "Bob -> Alice : hello" > test.yml
http --form http://localhost:3005/render [email protected] Accept:image/svg+xml
http --form http://localhost:3005/render [email protected] Accept:image/png
# Acquire WireViz YAML file.
wget https://raw.githubusercontent.com/daq-tools/wireviz-web/main/tests/demo01.yaml

# Render images.
http --form http://localhost:3005/render [email protected] Accept:image/svg+xml
http --form http://localhost:3005/render [email protected] Accept:image/png

# Render HTML page with SVG image and BOM table.
http --form http://localhost:3005/render [email protected] Accept:text/html

# Render BOM in TSV format.
http --form http://localhost:3005/render [email protected] Accept:text/plain

# Render BOM in JSON format.
http --form http://localhost:3005/render [email protected] Accept:application/json

# Render a PlantUML request.
http http://localhost:3005/plantuml/svg/SyfFKj2rKt3CoKnELR1Io4ZDoSa700==
Expand Down
13 changes: 8 additions & 5 deletions wireviz_web/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,21 @@ def post(self) -> Response:
========
::
# Acquire WireViz YAML file.
wget https://raw.githubusercontent.com/daq-tools/wireviz-web/main/tests/demo01.yaml
# Render images.
http --form http://localhost:3005/render yml_file@test.yml Accept:image/svg+xml
http --form http://localhost:3005/render yml_file@test.yml Accept:image/png
http --form http://localhost:3005/render yml_file@demo01.yaml Accept:image/svg+xml
http --form http://localhost:3005/render yml_file@demo01.yaml Accept:image/png
# Render HTML page with SVG image and BOM table.
http --form http://localhost:3005/render yml_file@test.yml Accept:text/html
http --form http://localhost:3005/render yml_file@demo01.yaml Accept:text/html
# Render BOM in TSV format.
http --form http://localhost:3005/render yml_file@test.yml Accept:text/plain
http --form http://localhost:3005/render yml_file@demo01.yaml Accept:text/plain
# Render BOM in JSON format.
http --form http://localhost:3005/render yml_file@test.yml Accept:application/json
http --form http://localhost:3005/render yml_file@demo01.yaml Accept:application/json
:return: A Flask Response object with the rendered image.
"""
Expand Down

0 comments on commit b3bea56

Please sign in to comment.