diff --git a/.gitignore b/.gitignore index da16978..3f55aab 100644 --- a/.gitignore +++ b/.gitignore @@ -152,3 +152,6 @@ ENV/ .ropeproject # End of https://www.gitignore.io/api/pycharm,python + +# Ignore output directory generated from program +output/ diff --git a/README.md b/README.md index f6fd3ca..517efa0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ See https://www.dokuwiki.org/wiki:syntax Just use the main python class. It uses `argparse`: -```python main.py --dir='some_dokuwiki_root_dir'``` +```python src/main.py --dir='some_dokuwiki_root_dir'``` Command line options: @@ -129,4 +129,4 @@ That way it's auto-loaded and wired in the main conversion. * embedding php - kill it with fire? * macro's - kill it with fire? -* what to do with footnotes? \ No newline at end of file +* what to do with footnotes? diff --git a/src/__init__.py b/src/__init__.py index bda6776..6821910 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1,2 +1,2 @@ # this initializes the submodule __init__ -from src.markdown import * +from markdown import * diff --git a/src/dokuwiki_to_hugo.py b/src/dokuwiki_to_hugo.py index e2efd6e..853e04f 100644 --- a/src/dokuwiki_to_hugo.py +++ b/src/dokuwiki_to_hugo.py @@ -1,8 +1,13 @@ import os import shutil +<<<<<<< HEAD +from hugo_file_config import HugoFileConfig +from markdown_converter import MarkdownConverter +======= from src.hugo_front_matter import HugoFrontMatter from src.markdown_converter import MarkdownConverter +>>>>>>> master class DokuWikiToHugo: diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..80cb576 --- /dev/null +++ b/src/main.py @@ -0,0 +1,16 @@ +import argparse + +from dokuwiki_to_hugo import DokuWikiToHugo + + +def main(directory, root): + DokuWikiToHugo(root).doku_to_hugo(directory) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("-d", "--dir", help="the directory of your DokuWiki pages collection", required=True) + parser.add_argument("-r", "--root", help="the root directory name in your hugo content where to link to", + required=False) + opts = parser.parse_args() + main(opts.dir, opts.root)