Commit 6fa2940c authored by Jesse Bakker's avatar Jesse Bakker

Add pages

parent 9d7a9011
Pipeline #28581 passed with stage
in 32 seconds
pages:
image: python:alpine
stage: deploy
script:
- mkdir .public
- cp -r examples .public
- python scripts/render_markdown.py > .public/index.html
- mv .public public
artifacts:
paths:
- public
only:
- master
\ No newline at end of file
import json
import os
from urllib import request
text = ""
with open('README.md', 'r') as f:
text = f.read()
os.environ['CI_PROJECT_PATH'] = "ss-2019-other4/protocol-specification"
os.environ['CI_INSTANCE_URL'] = "https://git.snt.utwente.nl"
data = json.dumps(
{
'text': text,
'gfm': True,
'project': os.environ['CI_PROJECT_PATH']
}
).encode('utf-8')
req = request.Request(os.environ['CI_INSTANCE_URL'] + "/api/v4/markdown")
req.add_header('Content-Type', 'application/json; charset=utf-8')
req.add_header('Content-Length', len(data))
response = request.urlopen(req, data)
html = json.loads(response.read())['html']
print(html)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment