Compare commits

...

1 Commits

Author SHA1 Message Date
rubenwardy
6929d5fd0d Build lua_api.html in CI pipeline 2020-08-19 00:20:01 +01:00
2 changed files with 6 additions and 5 deletions

View File

@ -5,12 +5,14 @@ variables:
LC_ALL: C.UTF-8
before_script:
- apk add python3 py3-markdown
- rm Gemfile.lock
test:
stage: test
interruptible: true
script:
- python3 utils/update_lua_api.py
- bundle exec jekyll build -d test
artifacts:
paths:
@ -21,9 +23,8 @@ test:
pages:
stage: deploy
interruptible: true
before_script:
- rm Gemfile.lock
script:
- python3 utils/update_lua_api.py
- bundle exec jekyll build -d public
artifacts:
paths:

View File

@ -1,5 +1,6 @@
import markdown, urllib2, datetime, re, string
import markdown, datetime, re, string
from bs4 import BeautifulSoup
from urllib.request import urlopen
def get_key(index, li, title):
title = title.replace(" ", "-")
@ -28,8 +29,7 @@ def get_key(index, li, title):
print("Downloading lua_api.txt...")
url = "https://raw.githubusercontent.com/minetest/minetest/master/doc/lua_api.txt"
text = urllib2.urlopen(url).read()
text = unicode(text, "utf-8")
text = urlopen(url).read().decode("utf-8")
print("Pre-generation replacements...")