diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4efc176ff712c7d212dc0bec9a7d1aefc9d86d7f..5ed1f4c4beb6eae16d319b25ec9959b61fe3fbc3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,3 +25,11 @@ files: \.md$ - id: remove-tabs files: \.md$ +- repo: local + hooks: + - id: convert-markdown-into-html + name: convert-markdown-into-html + description: Convert README.md into index.html + entry: python .pre-commit-hooks/convert_markdown_into_html.py + language: system + files: .+README\.md$ diff --git a/.pre-commit-hooks/convert_markdown_into_html.py b/.pre-commit-hooks/convert_markdown_into_html.py new file mode 100644 index 0000000000000000000000000000000000000000..66f44ef23c5d9a82436dfbe4b6bcdfc4e69ab55a --- /dev/null +++ b/.pre-commit-hooks/convert_markdown_into_html.py @@ -0,0 +1,95 @@ +import argparse +import re +import sys + +HEAD = """ + + + + + + + + + + + + + + + + +
+
+ + + + + + + +""" + + +def convert_markdown_into_html(argv=None): + parser = argparse.ArgumentParser() + parser.add_argument('filenames', nargs='*', help='Filenames to fix') + args = parser.parse_args(argv) + + retv = 0 + + for filename in args.filenames: + with open( + re.sub(r"README", "index", re.sub(r"\.md$", ".html", filename)), + "w") as output: + output.write(HEAD) + with open(filename) as input: + for line in input: + output.write(line) + output.write(TAIL) + + return retv + + +if __name__ == '__main__': + sys.exit(convert_markdown_into_html()) diff --git a/ltr/index.html b/ltr/index.html new file mode 100644 index 0000000000000000000000000000000000000000..cce283e33d1865f862578ae17e1dc54a54e9ba72 --- /dev/null +++ b/ltr/index.html @@ -0,0 +1,418 @@ + + + + + + + + + + + + + + + + + +
+
+ + + + + + + diff --git a/nmt_without_attention/index.html b/nmt_without_attention/index.html new file mode 100644 index 0000000000000000000000000000000000000000..d749ff5722aa4144743fdca45f2ac0418c9db0b3 --- /dev/null +++ b/nmt_without_attention/index.html @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + +
+
+ + + + + + + diff --git a/sequence_tagging_for_ner/index.html b/sequence_tagging_for_ner/index.html new file mode 100644 index 0000000000000000000000000000000000000000..b7c6c8994abdbcd80ff7347960d984e5528311a1 --- /dev/null +++ b/sequence_tagging_for_ner/index.html @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + +
+
+ + + + + + + diff --git a/text_classification/index.html b/text_classification/index.html new file mode 100644 index 0000000000000000000000000000000000000000..3ee660d8471269bfebf2444fb7c4a97deb550561 --- /dev/null +++ b/text_classification/index.html @@ -0,0 +1,302 @@ + + + + + + + + + + + + + + + + + +
+
+ + + + + + + diff --git a/word_embedding/index.html b/word_embedding/index.html new file mode 100644 index 0000000000000000000000000000000000000000..83f6809d669d9ec6e0dd002f414ba8247068e270 --- /dev/null +++ b/word_embedding/index.html @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + +
+
+ + + + + + +