-
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.
Merge pull request #26 from crempp/release/v0.2
Release v0.2
- Loading branch information
Showing
71 changed files
with
1,290 additions
and
521 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 |
---|---|---|
|
@@ -12,3 +12,4 @@ _mailinglist | |
shippable | ||
nosetests.xml | ||
.coverage | ||
wsgi.py |
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,16 @@ | ||
doc-warnings: yes | ||
test-warnings: yes | ||
strictness: veryhigh | ||
max-line-length: 80 | ||
autodetect: yes | ||
|
||
ignore-paths: | ||
- themes | ||
- content | ||
|
||
uses: | ||
- flask | ||
|
||
python-targets: | ||
- 2 | ||
- 3 |
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 |
---|---|---|
@@ -1,30 +1,16 @@ | ||
MDWeb versions | ||
==== | ||
|
||
v0.1 [2016-02-22] | ||
v0.2 \[future\] | ||
---- | ||
1. ✓ Basic markdown page hosting | ||
1. ✓ File change watcher | ||
1. ✓ Arbitrary depth navigation with page metadata definition | ||
1. ✓ >90% test coverage | ||
1. Asset support in content directory | ||
|
||
v0.2 [future] | ||
v0.1 \[2016-02-22\] | ||
---- | ||
1. Support for favicon.ico and similar root-level files | ||
1. Ordering nav levels | ||
1. Navigation level metadata | ||
1. Basic markdown page hosting | ||
1. File change watcher | ||
1. Arbitrary depth navigation with page metadata definition | ||
1. \>90% test coverage | ||
|
||
v0.3 [future] | ||
---- | ||
1. Plugin architecture | ||
1. Sphinx documentation (http://www.sphinx-doc.org/en/stable/) | ||
|
||
v0.4 [future] | ||
---- | ||
1. Caching architecture | ||
1. Figure out how to test watchdog | ||
1. Test blinker signals | ||
|
||
v1.0 [future] | ||
---- | ||
1. Everything works |
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,2 @@ | ||
Nav Name: About | ||
Order: 1 |
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,7 +1,38 @@ | ||
/* | ||
Title: MDWeb History | ||
Description: The long and storied history of MDWeb | ||
Nav Name: History | ||
Author: Chad Rempp | ||
Order: 8 | ||
Order: 3 | ||
Sitemap Priority: 0.5 | ||
Sitemap Changefreq: monthly | ||
*/ | ||
This all began in 1993... | ||
|
||
MDWeb began out of my need for a framework to host a site for my | ||
personal projects called lapinlabs.com. Over the past four years I went | ||
through the following iterations: | ||
|
||
### ~July 2012 | ||
Started building a site in Python, Django and Django-CMS. This | ||
iteration was never completed. | ||
|
||
### ~March 2013 | ||
Started over again, this time using PHP and Drupal. This iteration was | ||
never completed. | ||
|
||
### May 2014 | ||
Started over again, this time using PHP and the Pico framework. I | ||
completed a basic version of this iteration but there were some issues | ||
I found with the Pico framework. Despite the issues I realized that | ||
the project was onto something. I decided to try a Markdown-based | ||
framework of my own. | ||
|
||
### Jan 2015 | ||
Started over again, this time building my own Markdown framework on | ||
top of Python and Flask. So far so good... | ||
|
||
### The Present | ||
That brings us to the present. My projects site is now hosted on MDWeb | ||
(lapinlabs.com)[http://lapinlabs.com] and I consider my journey | ||
complete. I have opensourced the framework and hope others find it | ||
useful. | ||
|
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,9 +1,20 @@ | ||
/* | ||
Title: MDWeb | ||
Nav Name: About | ||
Title: About MDWeb | ||
Description: This description will go in the meta description tag | ||
Author: Chad Rempp | ||
Order: 8 | ||
Nav Name: About MDWeb | ||
Sitemap Priority: 0.9 | ||
Sitemap Changefreq: monthly | ||
*/ | ||
|
||
This is me | ||
MDWeb is painstakingly designed to be as minimalistic as possible while | ||
taking less than 5 minutes to setup and less than a minute to add | ||
content. | ||
|
||
This project was borne out of my frustration with maintaining websites | ||
and adding content. I'm a firm believer in the ethos that CMS is an | ||
evil that should be rid from this world. I spent years fighting | ||
horrific battles with enemies such as Drupal, Wordpress and Joomla. | ||
The things I saw during those dark days can not be unseen. | ||
|
||
After years of battle, this weary web developmer built himself a tiny | ||
oasis. This is MDWeb, I hope you find respite in it. |
10 changes: 9 additions & 1 deletion
10
demo-content/license/index.md → demo-content/about/license.md
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Nav Name: Documentation | ||
Order: 10 |
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,2 @@ | ||
Nav Name: Download | ||
Order: 5 |
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,2 @@ | ||
Nav Name: Examples | ||
Order: 15 |
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
Binary file not shown.
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
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
"""MDWeb Base Navigation Item. | ||
This is broken out into a separate file to avoid circular imports. | ||
""" | ||
import re | ||
|
||
from mdweb.Exceptions import PageMetaInfFieldException | ||
|
||
|
||
class NavigationBaseItem(object): # pylint: disable=R0903 | ||
|
||
"""Base object for navigation items such as nav-levels or pages.""" | ||
|
||
#: Type of navigation item | ||
@property | ||
def nav_type(self): | ||
"""Return the type of this nav item (the class name).""" | ||
return self.__class__.__name__ | ||
|
||
|
||
class MetaInfParser(object): # pylint: disable=R0903 | ||
|
||
"""Base Meta Inf Parser.""" | ||
|
||
FIELD_TYPES = {} | ||
FIELD_VALUE_REGEX = r'^(?P<key>[a-zA-Z0-9 ]*):(?P<value>.*)$' | ||
|
||
def __init__(self, meta_string): | ||
"""Initialize the parser.""" | ||
# Initialize attributes defined in FIELD_TYPES | ||
for attribute, attribute_details in self.FIELD_TYPES.items(): | ||
setattr(self, attribute, attribute_details[1]) | ||
|
||
self._parse_meta_inf(meta_string) | ||
|
||
def _parse_meta_inf(self, meta_inf_string): | ||
"""Parse given meta information string into a dictionary. | ||
:param meta_inf_string: Raw meta content | ||
""" | ||
lines = meta_inf_string.split('\n') | ||
|
||
for line in lines: | ||
if line.strip(' ') == '' or re.match(r'^ *#', line): | ||
continue | ||
match = re.search(self.FIELD_VALUE_REGEX, line) | ||
key = match.group('key').strip().lower().replace(' ', '_') | ||
value = match.group('value').strip() | ||
if key not in self.FIELD_TYPES.keys(): | ||
raise PageMetaInfFieldException("Unsupported field '%s'" % key) | ||
# Cast field value to appropriate type | ||
if '' == value: | ||
raise PageMetaInfFieldException( | ||
"Empty value for meta-inf field '%s'" % key) | ||
if 'int' == self.FIELD_TYPES[key][0]: | ||
value = int(value) | ||
elif 'unicode' == self.FIELD_TYPES[key][0]: | ||
if 'unicode' in __builtins__.keys(): | ||
# Python 2.x | ||
value = __builtins__['unicode'](value) | ||
else: | ||
# Python 3.x | ||
value = str(value) | ||
|
||
setattr(self, key, value) |
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,22 +1,56 @@ | ||
"""MDWeb Exceptions.""" | ||
|
||
class ThemeException(Exception): | ||
|
||
"""Theme directory or content error.""" | ||
|
||
pass | ||
|
||
|
||
class ConfigException(Exception): | ||
|
||
"""Configuration error.""" | ||
|
||
pass | ||
|
||
|
||
class ContentException(Exception): | ||
|
||
"""Markdown content exception.""" | ||
|
||
pass | ||
|
||
|
||
class ContentStructureException(Exception): | ||
|
||
"""Invalid structure of content directory.""" | ||
|
||
pass | ||
|
||
|
||
class PageMetaInfFieldException(Exception): | ||
|
||
"""Invalid field in page metadata.""" | ||
|
||
pass | ||
|
||
|
||
class PageParseException(Exception): | ||
|
||
"""Error parsing page markdown.""" | ||
|
||
pass | ||
|
||
|
||
class FileExistsError(Exception): # pylint: disable=W0622 | ||
|
||
"""Shim for FileExistsError in Python 2.x.""" | ||
|
||
pass | ||
|
||
|
||
class PermissionError(Exception): # pylint: disable=W0622 | ||
|
||
"""Shim for FileExistsError in Python 2.x.""" | ||
|
||
pass |
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
Oops, something went wrong.