Skip to content

Commit

Permalink
Update:
Browse files Browse the repository at this point in the history
- Updated source code
- Updated unit-tests
- Updated .gitignore
- Added packaging
- Updated README
  • Loading branch information
abatomunkuev committed Nov 27, 2021
1 parent 6da9897 commit 36a2af4
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 13 deletions.
Binary file modified .DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
dist/
__pycache__/
.coverage
.coverage
*.egg
*.egg-info
build/
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Fast Static Site Generator (Fast SSG) - a tool for generating a complete HTML fi
## Tool installation
To install the tool run the following command
```
pip3 install -r requirements.txt
pip install fast-ssg==1.0.0
```

## Tool features
Expand All @@ -27,11 +27,11 @@ pip3 install -r requirements.txt
## Usage with shorthand flags
| Description | Command |
| ------------ | -------- |
|Generate basic HTML file(s)|`python3 fast_ssg --input "relative path or absolute path to the file or folder"`|
|Generate basic HTML file(s) with CSS stylesheet | `python3 fast_ssg --input "relative path or absolute path to the file or folder" --stylesheet "URL to CSS stylesheet"`|
|New Feature: Support arguments passed with Config File | `python3 fast_ssg -c ./ssg-config.json` |
|Help | `python3 fast_ssg --help` |
|Get current version | `python3 fast_ssg --version`|
|Generate basic HTML file(s)|`fast_ssg --input "relative path or absolute path to the file or folder"`|
|Generate basic HTML file(s) with CSS stylesheet | `fast_ssg --input "relative path or absolute path to the file or folder" --stylesheet "URL to CSS stylesheet"`|
|New Feature: Support arguments passed with Config File | `fast_ssg -c ./ssg-config.json` |
|Help | `fast_ssg --help` |
|Get current version | `fast_ssg --version`|

## Shorthand flags
| Flag | Shorthand version |
Expand Down Expand Up @@ -84,6 +84,7 @@ pip3 install -r requirements.txt
|Code | `<code>Code</code>`|
|Horizontal rule | `<hr>`|

# Live version
# Live version & Project-package website

https://abatomunkuev.github.io/static_site_generator/
https://pypi.org/project/fast-ssg/1.0.0/
1 change: 1 addition & 0 deletions fast_ssg/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import os
import shutil
from text import OUTPUT_DIR, TextFile
Expand Down
2 changes: 1 addition & 1 deletion fast_ssg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def cla_parser():
"-v",
"--version",
action="version",
version="Fast Static Site Generator 0.1",
version="Fast Static Site Generator 1.0.0",
help="show program's version number and exit",
)
# --stylesheet -s argument
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"beautifulsoup4==4.10.0"
]
build-backend = "setuptools.build_meta"
25 changes: 25 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[metadata]
name = fast_ssg
version = 1.0.0
author = Andrei Batomunkuev
author_email = [email protected]
description = Fast Static Site Generator - a tool for generating a complete HTML files from raw data like txt and markdown files.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/abatomunkuev/static_site_generator
project_urls =
Bug Tracker = https://github.com/abatomunkuev/static_site_generator/issues
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent

[options]
package_dir =
packages = fast_ssg
python_requires = >=3.6
install_requires =
beautifulsoup4 == 4.10.0
[options.entry_points]
console_scripts =
fast_ssg = fast_ssg.__main__:main
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from setuptools import setup

setup()
8 changes: 4 additions & 4 deletions tests/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ def test_cla_parser_version_arg(self):
)
assert (
shortcut_version_output.decode("utf-8")
== "Fast Static Site Generator 0.1\n"
), 'Should output "Static Site Generator 0.1"'
== "Fast Static Site Generator 1.0.0\n"
), 'Should output "Fast Static Site Generator 1.0.0"'
# Check full argument --version
full_version_output = subprocess.check_output(
"python3 -c 'from fast_ssg.utils import cla_parser; cla_parser()' --version",
shell=True,
)
assert (
full_version_output.decode("utf-8") == "Fast Static Site Generator 0.1\n"
), 'Should output "Static Site Generator 0.1"'
full_version_output.decode("utf-8") == "Fast Static Site Generator 1.0.0\n"
), 'Should output "Fast Static Site Generator 1.0.0"'

def test_cla_parser_invalid_input_arg(self):
"""
Expand Down

0 comments on commit 36a2af4

Please sign in to comment.