mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-24 10:54:04 +08:00
article from readme
This commit is contained in:
parent
77cc389ebd
commit
9be0a630de
@ -127,6 +127,7 @@ class Interface:
|
||||
self.title = title
|
||||
self.description = description
|
||||
if article is not None:
|
||||
article = utils.readme_to_html(article)
|
||||
article = markdown2.markdown(article)
|
||||
self.article = article
|
||||
self.thumbnail = thumbnail
|
||||
|
@ -5,6 +5,7 @@ from IPython import get_ipython
|
||||
analytics_url = 'https://api.gradio.app/'
|
||||
PKG_VERSION_URL = "https://api.gradio.app/pkg-version"
|
||||
|
||||
|
||||
def version_check():
|
||||
try:
|
||||
current_pkg_version = pkg_resources.require("gradio")[0].version
|
||||
@ -18,6 +19,7 @@ def version_check():
|
||||
except: # TODO(abidlabs): don't catch all exceptions
|
||||
pass
|
||||
|
||||
|
||||
def error_analytics(type):
|
||||
"""
|
||||
Send error analytics if there is network
|
||||
@ -56,4 +58,14 @@ def ipython_check():
|
||||
is_ipython = True
|
||||
except NameError:
|
||||
is_ipython = False
|
||||
return is_ipython
|
||||
return is_ipython
|
||||
|
||||
|
||||
def readme_to_html(article):
|
||||
try:
|
||||
response = requests.get(article)
|
||||
if response.status_code == requests.codes.ok:
|
||||
article = response.text
|
||||
except requests.exceptions.MissingSchema:
|
||||
pass
|
||||
return article
|
||||
|
Loading…
Reference in New Issue
Block a user