-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release version 0.1a2 of Stone
- Loading branch information
Showing
15 changed files
with
562 additions
and
328 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,10 +1,16 @@ | ||
Stone Changelog | ||
=============== | ||
# Stone Changelog | ||
|
||
Here are the release notes for each version of Stone. | ||
|
||
Version 0.0.1 | ||
------------- | ||
## Version 0.1 - WIP | ||
|
||
* Add init and newpage commands | ||
* Add versioned site.json | ||
* Add support for footnotes | ||
|
||
## Version 0.0.1 | ||
|
||
* Generate HTML from Markdown | ||
* jinja2 templating is processed in HTML files | ||
* Installable through setup.py | ||
* Can generate basic template |
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 was deleted.
Oops, something went wrong.
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,14 +1,22 @@ | ||
{ | ||
"sites": [ | ||
{ | ||
"site": "example.com", | ||
"pages": [ | ||
"version": 1, | ||
"sites": [ | ||
{ | ||
"source": "README.md", | ||
"target": "README.html" | ||
"site": "example.com", | ||
"source": "source", | ||
"target": "target", | ||
"pages": [ | ||
{ | ||
"source": "index.md", | ||
"target": "index.html", | ||
"page_type": "index" | ||
}, | ||
{ | ||
"source": "example.md", | ||
"target": "example.html", | ||
"page_type": "post" | ||
} | ||
] | ||
} | ||
], | ||
"templates": ["templates"] | ||
} | ||
] | ||
} | ||
] | ||
} |
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,4 @@ | ||
--- | ||
title: Hello, World! | ||
|
||
# Hello, World! |
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,6 @@ | ||
|
||
{% for post in posts %} | ||
<ul> | ||
<li><a href="{{ post.href }}">{{ post.title }}</a></li> | ||
</ul> | ||
{% endfor %} |
This file was deleted.
Oops, something went wrong.
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,3 +1,4 @@ | ||
css_html_js_minify | ||
jinja2 | ||
Markdown | ||
css_html_js_minify | ||
unidecode |
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
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,52 @@ | ||
"""Config | ||
Stone's representation for site.json | ||
""" | ||
import errno | ||
import json | ||
import os | ||
import sys | ||
|
||
from stone.site import Site, SiteEncoder | ||
|
||
|
||
class Config(object): | ||
"""Loader site.json""" | ||
|
||
site_config_file = "site.json" | ||
|
||
def __init__(self): | ||
pass | ||
|
||
def read(self, path): | ||
"""Load site configuration""" | ||
configs = [] | ||
try: | ||
json_data = json.loads( | ||
open(os.path.join(path, self.site_config_file), "r").read()) | ||
except FileNotFoundError as fnf: | ||
if fnf.errno != errno.ENOENT: | ||
raise | ||
else: | ||
print("[ERROR] No path to site config") | ||
return 1 | ||
|
||
try: | ||
if json_data["version"] != 1: | ||
print( | ||
"This is an older site.json and it doesn't checkout", | ||
file=sys.stderr) | ||
exit(1) | ||
for site_data in json_data["sites"]: | ||
configs.append(Site(path, site_data)) | ||
except KeyError: | ||
configs.append(Site(path, site_data)) | ||
|
||
return configs | ||
|
||
def write(self, path, sites): | ||
"""Serialize a site to JSON""" | ||
config = {'version': 1} | ||
config['sites'] = sites | ||
with open(os.path.join(path, self.site_config_file), "w") as cfg_file: | ||
cfg_file.write(json.dumps(config, cls=SiteEncoder, indent=4)) |
Oops, something went wrong.