From 2730d7b83c8e6efc9f0bfae9af7ef5fe80dd6dde Mon Sep 17 00:00:00 2001 From: teemukataja Date: Thu, 1 Nov 2018 14:45:00 +0200 Subject: [PATCH 1/5] remove deprecated guideline --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d119b40..56e08726 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,6 @@ The way to contribute development effort and code to the project is via GitHub p Some general rules to follow: -- [Fork](https://help.github.com/articles/fork-a-repo) the main project into your personal GitHub space to work on. - Create a branch for each update that you're working on. These branches are often called "feature" or "topic" branches. Any changes that you push to your feature branch will automatically be shown in the pull request. - Keep your pull requests as small as possible. Large pull requests are hard to review. Try to break up your changes into self-contained and incremental pull requests. - The first line of commit messages should be a short (<80 character) summary, followed by an empty line and then any details that you want to share about the commit. From 2788782c758b4deee0d34d796d6dd49d00101046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Haziza?= Date: Wed, 21 Nov 2018 14:41:33 +0100 Subject: [PATCH 2/5] Using Node JS --- .gitignore | 4 ++++ Makefile | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 894eaeeb..104be33f 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,7 @@ Session.vim #********** IntelliJ files ****** *.iml + +#********** Node JS ****** +package-lock.json +node_modules diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..2c90a619 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ + +all: beacon.html + +beacon.html: beacon.yaml ./node_modules/.bin/redoc-cli + ./node_modules/.bin/redoc-cli bundle -o $@ $< + +./node_modules/.bin/redoc-cli: + npm install redoc-cli + +clean: + rm beacon.html + +cleanall: clean + rm -rf ./node_modules package-lock.json From 368c33e94513730c321b52a2a54f5f3664f2f0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Haziza?= Date: Wed, 21 Nov 2018 14:43:37 +0100 Subject: [PATCH 3/5] Using the swagger module itself --- Makefile | 10 ++-------- yaml-to-html.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 yaml-to-html.py diff --git a/Makefile b/Makefile index 2c90a619..4e540223 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,8 @@ all: beacon.html -beacon.html: beacon.yaml ./node_modules/.bin/redoc-cli - ./node_modules/.bin/redoc-cli bundle -o $@ $< - -./node_modules/.bin/redoc-cli: - npm install redoc-cli +beacon.html: beacon.yaml + python yaml-to-html.py < $< > $@ clean: rm beacon.html - -cleanall: clean - rm -rf ./node_modules package-lock.json diff --git a/yaml-to-html.py b/yaml-to-html.py new file mode 100644 index 00000000..3c8a2315 --- /dev/null +++ b/yaml-to-html.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +""" +Usage: + + python yaml-to-html.py < /path/to/api.yaml > doc.html + +""" +import yaml, json, sys + +TEMPLATE = """ + + + + + Beacon OpenAPI + + + +
+ + + + + +""" + +print(TEMPLATE % json.dumps(yaml.load(sys.stdin))) From d3d9bb4d3a0a41b52ba6f05e54cc03e378dd0b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Haziza?= Date: Wed, 21 Nov 2018 14:58:45 +0100 Subject: [PATCH 4/5] No makefile, just the readme is fine --- Makefile | 8 -------- README.md | 8 +++++++- 2 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 4e540223..00000000 --- a/Makefile +++ /dev/null @@ -1,8 +0,0 @@ - -all: beacon.html - -beacon.html: beacon.yaml - python yaml-to-html.py < $< > $@ - -clean: - rm beacon.html diff --git a/README.md b/README.md index 99e77a7b..6912bc26 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,13 @@ This page is used to plan and manage the work across the ga4gh-beacon repositori ## More information -More information for developers is available on [our wiki](https://github.com/ga4gh-beacon/specification/wiki). A list of related tools and projects developed by the community is maintained on the [Resources](https://github.com/ga4gh-beacon/specification/wiki/Resources) page. +More information for developers is available on [our wiki](https://github.com/ga4gh-beacon/specification/wiki). A list of related tools and projects developed by the community is maintained on the [Resources](https://github.com/ga4gh-beacon/specification/wiki/Resources) page. + +You can render the specification from YAML to HTML using + + python yaml-to-html.py < beacon.yaml > beacon.html + +Open then `beacon.html` in your web browser. ## Notify GA4GH of potential security flaw in specification From 4575f5efbb2bccf666655b8d072865cda616e8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Haziza?= Date: Wed, 21 Nov 2018 15:05:29 +0100 Subject: [PATCH 5/5] Moving the yaml-to-html to doc --- README.md | 6 ---- doc/README.md | 7 +++++ doc/beacon.html | 38 ++++++++++++++++++++++++++ yaml-to-html.py => doc/yaml-to-html.py | 0 4 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 doc/README.md create mode 100644 doc/beacon.html rename yaml-to-html.py => doc/yaml-to-html.py (100%) diff --git a/README.md b/README.md index 6912bc26..4bd9a4b8 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,6 @@ This page is used to plan and manage the work across the ga4gh-beacon repositori More information for developers is available on [our wiki](https://github.com/ga4gh-beacon/specification/wiki). A list of related tools and projects developed by the community is maintained on the [Resources](https://github.com/ga4gh-beacon/specification/wiki/Resources) page. -You can render the specification from YAML to HTML using - - python yaml-to-html.py < beacon.yaml > beacon.html - -Open then `beacon.html` in your web browser. - ## Notify GA4GH of potential security flaw in specification To enable a long-term contact for potential security flaws an email address of security-notification@ga4gh.org has been set up. This email will be monitored by the GA4GH secretariat and GA4GH security members to allow for an incoming response to be directed to appropriate parties. diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 00000000..44415c37 --- /dev/null +++ b/doc/README.md @@ -0,0 +1,7 @@ +You can render the specification from YAML to HTML using + + python yaml-to-html.py < ../beacon.yaml > beacon.html + +Open then `beacon.html` in your web browser. + +The output looks like a Swagger page. diff --git a/doc/beacon.html b/doc/beacon.html new file mode 100644 index 00000000..159fbf63 --- /dev/null +++ b/doc/beacon.html @@ -0,0 +1,38 @@ + + + + + + Beacon OpenAPI + + + +
+ + + + + + diff --git a/yaml-to-html.py b/doc/yaml-to-html.py similarity index 100% rename from yaml-to-html.py rename to doc/yaml-to-html.py