diff options
-rw-r--r-- | libpathod/app.py | 14 | ||||
-rw-r--r-- | libpathod/templates/docframe.html | 26 | ||||
-rw-r--r-- | libpathod/templates/docs_lang.html | 2 | ||||
-rw-r--r-- | libpathod/templates/docs_libpathod.html | 2 | ||||
-rw-r--r-- | libpathod/templates/docs_pathoc.html | 2 | ||||
-rw-r--r-- | libpathod/templates/docs_pathod.html | 2 | ||||
-rw-r--r-- | libpathod/templates/docs_test.html | 2 | ||||
-rw-r--r-- | libpathod/templates/frame.html | 97 | ||||
-rw-r--r-- | libpathod/templates/layout.html | 74 |
9 files changed, 122 insertions, 99 deletions
diff --git a/libpathod/app.py b/libpathod/app.py index 42989355..fb1d6a2d 100644 --- a/libpathod/app.py +++ b/libpathod/app.py @@ -58,27 +58,31 @@ def make_app(noapi): @app.route('/docs/pathod') def docs_pathod(): - return render("docs_pathod.html", True, section="docs") + return render("docs_pathod.html", True, section="docs", subsection="pathod") @app.route('/docs/language') def docs_language(): - return render("docs_lang.html", True, section="docs", uastrings=http_uastrings.UASTRINGS) + return render( + "docs_lang.html", True, + section="docs", uastrings=http_uastrings.UASTRINGS, + subsection="lang" + ) @app.route('/docs/pathoc') def docs_pathoc(): - return render("docs_pathoc.html", True, section="docs") + return render("docs_pathoc.html", True, section="docs", subsection="pathoc") @app.route('/docs/libpathod') def docs_libpathod(): - return render("docs_libpathod.html", True, section="docs") + return render("docs_libpathod.html", True, section="docs", subsection="libpathod") @app.route('/docs/test') def docs_test(): - return render("docs_test.html", True, section="docs") + return render("docs_test.html", True, section="docs", subsection="test") @app.route('/log') diff --git a/libpathod/templates/docframe.html b/libpathod/templates/docframe.html new file mode 100644 index 00000000..f780f379 --- /dev/null +++ b/libpathod/templates/docframe.html @@ -0,0 +1,26 @@ +{% extends "layout.html" %} + +{% macro subs(s) %} +{% if subsection == s %} class="active" {% endif %} +{% endmacro %} + + +{% block content %} +<div class="row"> + <div class="span3"> + <div class="well sidebar-nav"> + <ul class="nav nav-list"> + <li {{subs("pathod")}}><a href="/docs/pathod">pathod</a></li> + <li {{subs("pathoc")}}><a href="/docs/pathoc">pathoc</a></li> + <li {{subs("lang")}}><a href="/docs/language">language</a></li> + <li {{subs("libpathod")}}><a href="/docs/libpathod">libpathod</a></li> + <li {{subs("test")}}><a href="/docs/test">libpathod.test</a></li> + </ul> + </div> + </div> + <div class="span9"> + {% block body %} + {% endblock %} + </div> +</div> +{% endblock %} diff --git a/libpathod/templates/docs_lang.html b/libpathod/templates/docs_lang.html index 26672bb2..aef12a8d 100644 --- a/libpathod/templates/docs_lang.html +++ b/libpathod/templates/docs_lang.html @@ -1,4 +1,4 @@ -{% extends "frame.html" %} +{% extends "docframe.html" %} {% block body %} <div class="page-header"> diff --git a/libpathod/templates/docs_libpathod.html b/libpathod/templates/docs_libpathod.html index aa404eed..3e18c1d9 100644 --- a/libpathod/templates/docs_libpathod.html +++ b/libpathod/templates/docs_libpathod.html @@ -1,4 +1,4 @@ -{% extends "frame.html" %} +{% extends "docframe.html" %} {% block body %} <div class="page-header"> diff --git a/libpathod/templates/docs_pathoc.html b/libpathod/templates/docs_pathoc.html index cae2e620..424af414 100644 --- a/libpathod/templates/docs_pathoc.html +++ b/libpathod/templates/docs_pathoc.html @@ -1,4 +1,4 @@ -{% extends "frame.html" %} +{% extends "docframe.html" %} {% block body %} <div class="page-header"> <h1> diff --git a/libpathod/templates/docs_pathod.html b/libpathod/templates/docs_pathod.html index d9897245..d0e6ec88 100644 --- a/libpathod/templates/docs_pathod.html +++ b/libpathod/templates/docs_pathod.html @@ -1,4 +1,4 @@ -{% extends "frame.html" %} +{% extends "docframe.html" %} {% block body %} <div class="page-header"> diff --git a/libpathod/templates/docs_test.html b/libpathod/templates/docs_test.html index b40ca919..25205d41 100644 --- a/libpathod/templates/docs_test.html +++ b/libpathod/templates/docs_test.html @@ -1,4 +1,4 @@ -{% extends "frame.html" %} +{% extends "docframe.html" %} {% block body %} <div class="page-header"> <h1> diff --git a/libpathod/templates/frame.html b/libpathod/templates/frame.html index cbb4582b..b5c5c67c 100644 --- a/libpathod/templates/frame.html +++ b/libpathod/templates/frame.html @@ -1,90 +1,9 @@ -<!DOCTYPE html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <title>pathod</title> - <link href="/static/bootstrap.min.css" rel="stylesheet"> - <link href="/static/pathod.css" rel="stylesheet"> - <link href="/static/syntax.css" rel="stylesheet"> - <script src="/static/jquery-1.7.2.min.js"></script> - <script src="/static/jquery.scrollTo-min.js"></script> - <script src="/static/jquery.localscroll-min.js"></script> - <script src="/static/bootstrap.min.js"></script> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta name="description" content=""> - <meta name="author" content=""> - <style type="text/css"> - body { - padding-top: 60px; - padding-bottom: 40px; - } - </style> - <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> - <!--[if lt IE 9]> - <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> - <![endif]--> - </head> - - <body> - - <div class="navbar navbar-fixed-top"> - <div class="navbar-inner"> - <div class="container"> - <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </a> - <a class="brand" href="/index.html">pathod</a> - <div class="nav-collapse"> - <ul class="nav"> - <li {% if section== "main" %} class="active" {% endif %}><a href="/">home</a></li> - <li {% if section== "download" %} class="active" {% endif %}><a href="/download">download</a></li> - {% if not noapi %} - <li {% if section== "log" %} class="active" {% endif %}><a href="/log">log</a></li> - {% endif %} - <li class="dropdown {% if section== "docs" %}active{% endif %}"> - <a class="dropdown-toggle" data-toggle="dropdown"> - docs - <b class="caret"></b> - </a> - <ul class="dropdown-menu"> - <li><a href="/docs/pathod">pathod</a></li> - <li><a href="/docs/pathoc">pathoc</a></li> - <li><a href="/docs/language">language</a></li> - <li><a href="/docs/libpathod">libpathod</a></li> - <li><a href="/docs/test">libpathod.test</a></li> - </ul> - </li> - <li {% if section== "about" %} class="active" {% endif %}><a href="/about">about</a></li> - </ul> - </div> - </div> - </div> +{% extends "layout.html" %} +{% block content %} +<div class="row"> + <div class="span12"> + {% block body %} + {% endblock %} </div> - - <div class="container"> - <div class="row"> - <div class="span12"> - {% block body %} - {% endblock %} - </div> - </div> - <hr> - <footer> - <span>© Aldo Cortesi 2012</span> - <span class="pull-right">[served by pathod]</span> - </footer> - </div> - </body> - <script> - $(function(){ - $.localScroll( - { - duration: 300, - offset: {top: -45} - } - ); - }); - </script> -</html> +</div> +{% endblock %} diff --git a/libpathod/templates/layout.html b/libpathod/templates/layout.html new file mode 100644 index 00000000..4ab0b464 --- /dev/null +++ b/libpathod/templates/layout.html @@ -0,0 +1,74 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>pathod</title> + <link href="/static/bootstrap.min.css" rel="stylesheet"> + <link href="/static/pathod.css" rel="stylesheet"> + <link href="/static/syntax.css" rel="stylesheet"> + <script src="/static/jquery-1.7.2.min.js"></script> + <script src="/static/jquery.scrollTo-min.js"></script> + <script src="/static/jquery.localscroll-min.js"></script> + <script src="/static/bootstrap.min.js"></script> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="description" content=""> + <meta name="author" content=""> + <style type="text/css"> + body { + padding-top: 60px; + padding-bottom: 40px; + } + </style> + <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + </head> + + <body> + + <div class="navbar navbar-fixed-top"> + <div class="navbar-inner"> + <div class="container"> + <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </a> + <a class="brand" href="/index.html">pathod</a> + <div class="nav-collapse"> + <ul class="nav"> + <li {% if section== "main" %} class="active" {% endif %}><a href="/">home</a></li> + <li {% if section== "download" %} class="active" {% endif %}><a href="/download">download</a></li> + {% if not noapi %} + <li {% if section== "log" %} class="active" {% endif %}><a href="/log">log</a></li> + {% endif %} + <li {% if section== "docs" %} class="active" {% endif %}><a href="/docs/pathod">docs</a></li> + <li {% if section== "about" %} class="active" {% endif %}><a href="/about">about</a></li> + </ul> + </div> + </div> + </div> + </div> + + <div class="container"> + {% block content %} + {% endblock %} + <hr> + <footer> + <span>© Aldo Cortesi 2012</span> + <span class="pull-right">[served by pathod]</span> + </footer> + </div> + </body> + <script> + $(function(){ + $.localScroll( + { + duration: 300, + offset: {top: -45} + } + ); + }); + </script> +</html> |