-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rationalize code folder/file structure
* Add more explicit documentation * Add docopt for handling init command
- Loading branch information
Showing
48 changed files
with
183 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*.pyc | ||
node_modules | ||
yarn-error.log | ||
config.yml | ||
public | ||
build | ||
dist | ||
*.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
include LICENSE *.md *.yml *.dist | ||
recursive-include pages * | ||
recursive-include posts * | ||
recursive-include skel * | ||
recursive-include templates * | ||
include LICENSE *.md | ||
recursive-include monopati * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (C) 2015-2019 Nikos Roussos <nikos@roussos.cc>. | ||
# This file is part of Monopati - https://github.com/comzeradd/monopati | ||
|
||
# Monopati is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
|
||
# Monopati is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
# See the file 'LICENSE' for more information. | ||
|
||
""" | ||
Usage: | ||
monopati [options] init | ||
monopati render | ||
monopati --version | ||
monopati -h, --help | ||
Options: | ||
-p, --path=<path> top directory of your website. | ||
""" | ||
|
||
from docopt import docopt | ||
import sys | ||
|
||
from monopati import __version__, helpers, render | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
args = docopt(__doc__, version=__version__) | ||
|
||
if args['init']: | ||
if args['--path']: | ||
helpers.kickstart(args['--path']) | ||
else: | ||
print('Usage:\n\tmonopati --path=mywebsite init') | ||
sys.exit() | ||
elif args['render']: | ||
render.generate_pages() | ||
posts, tag_set = render.generate_posts() | ||
render.generate_archive(posts, tag_set) | ||
render.generate_feeds(posts, tag_set) | ||
render.copy_static() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env python3 | ||
|
||
__version__ = '0.3.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (C) 2015-2019 Nikos Roussos <nikos@roussos.cc>. | ||
# This file is part of Monopati - https://github.com/comzeradd/monopati | ||
|
||
# Monopati is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
|
||
# Monopati is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
# See the file 'LICENSE' for more information. | ||
|
||
from os import path, mkdir, listdir | ||
from shutil import copy2, copytree | ||
import sys | ||
|
||
|
||
def kickstart(folder): | ||
dest = path.abspath(folder) | ||
|
||
if not path.isdir(dest): | ||
mkdir(dest) | ||
print('Creating website folder...') | ||
else: | ||
print('Folder already exists') | ||
sys.exit() | ||
|
||
skel = path.join(path.dirname(path.abspath(__file__)), 'skel') | ||
|
||
for item in listdir(skel): | ||
s = path.join(skel, item) | ||
d = path.join(dest, item) | ||
if path.isdir(s): | ||
copytree(s, d) | ||
else: | ||
copy2(s, d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
max-complexity = 23 | ||
max-line-length = 99 | ||
ignore = F403 | ||
exclude = *migrations/* |
Oops, something went wrong.