diff options
author | Louie Shprung <lshprung@tutanota.com> | 2024-12-25 11:23:05 -0800 |
---|---|---|
committer | Louie Shprung <lshprung@tutanota.com> | 2024-12-25 11:23:05 -0800 |
commit | 01ac12a8475f98c4094b074caa18279064538482 (patch) | |
tree | ea6c8a1dfa6fb96c0f38118d1e2829cb4b12e4b0 /src/index-pages.py | |
parent | e772062371ddbbacc20d6f2ec1b6fefddd76dc7e (diff) |
python rewrite; index terms
Diffstat (limited to 'src/index-pages.py')
-rwxr-xr-x | src/index-pages.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/index-pages.py b/src/index-pages.py new file mode 100755 index 0000000..6dee7d0 --- /dev/null +++ b/src/index-pages.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import os +import re +import sys + +sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", "scripts")) +from create_table import create_table +from get_title import get_title +from insert import insert + +def insert_page(db_path, html_path): + page_name = get_title(html_path) + page_name = page_name.replace('(GNU Coding Standards)', '') + + page_type = "Guide" + + insert(db_path, page_name, page_type, os.path.basename(html_path)) + +if __name__ == '__main__': + db_path = sys.argv[1] + + create_table(db_path) + for html_path in sys.argv[2:]: + insert_page(db_path, html_path) |