diff --git a/docs/generate.py b/docs/generate.py index 94fff181..928eacf1 100755 --- a/docs/generate.py +++ b/docs/generate.py @@ -218,6 +218,7 @@ def generate_documentation(scheme_file): original_paths = { 'css': 'css/docs.css', 'arrow': 'img/arrow.svg', + '404': '404.html', 'index_all': 'index.html', 'index_types': 'types/index.html', 'index_methods': 'methods/index.html', @@ -540,13 +541,15 @@ def generate_documentation(scheme_file): 'constructor_urls': constructor_urls } - with open('../res/core.html') as infile: - with open(original_paths['index_all'], 'w') as outfile: - text = infile.read() - for key, value in replace_dict.items(): - text = text.replace('{' + key + '}', str(value)) + shutil.copy('../res/404.html', original_paths['404']) - outfile.write(text) + with open('../res/core.html') as infile,\ + open(original_paths['index_all'], 'w') as outfile: + text = infile.read() + for key, value in replace_dict.items(): + text = text.replace('{' + key + '}', str(value)) + + outfile.write(text) # Everything done print('Documentation generated.') diff --git a/docs/res/404.html b/docs/res/404.html new file mode 100644 index 00000000..8eb3d37d --- /dev/null +++ b/docs/res/404.html @@ -0,0 +1,44 @@ + + + Oopsie! | Telethon + + + + + + + +
+

You seem a bit lost…

+

You seem to be lost! Don't worry, that's just Telegram's API being + itself. Shall we go back to the Main Page?

+
+ +