Skip to content

Commit 9509895

Browse files
committed
Docs - first draft
0 parents  commit 9509895

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1740
-0
lines changed

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
*~
2+
*.pyc
3+
.DS_Store
4+
deploy
5+
deploy/*
6+
*.cprof
7+
*.profile
8+
*.log
9+
pylint*
10+
*.tmproj
11+
test_site
12+
dist
13+
build
14+
*egg*
15+
.idea
16+
PYSMELLTAGS
17+
.noseids
18+
*.tar.gz
19+
.hyde_deps

content/commandline.html

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
===
2+
title: Command Line
3+
subtitle: working with hyde
4+
created: 2011-01-27 11:02:43
5+
===
6+
7+
§§ blurb
8+
9+
The hyde command line supports three subcommands:
10+
11+
1. create - Initializes a new site at a given path
12+
2. gen - Generates the website to a configured deploy folder
13+
3. serve - Starts a local http server that regenerates based on the requested file
14+
15+
§§ /blurb
16+
17+
## The create command
18+
19+
Creates a new hyde website.
20+
21+
~~~sh~~~
22+
hyde create
23+
24+
hyde [-s </site/path>] [-v] create [-l <layout>] [-f] [-h]
25+
~~~~~~~~
26+
27+
`-s SITEPATH, --sitepath SITEPATH`
28+
: Where the site must be created. If this path is not empty then the `-f`
29+
option must be specified to overwrite the site.
30+
31+
*Optional* - defaults to current working directory.
32+
33+
`-f, --force`
34+
: Specifying this option will overwrite files and folders at the given
35+
site path.
36+
37+
*Optional* - If the target directory is not empty, hyde will throw an
38+
exception unless this is specified.
39+
40+
`-l LAYOUT, --layout LAYOUT`
41+
: The name of the layout to use for creating the initial site. Hyde currently
42+
has three layouts: `basic`, `test` and `doc`.
43+
44+
While basic and test are really barebones, doc is the one that generates
45+
this documentation and is completely usable. Hyde will get more layouts
46+
over time.
47+
48+
Hyde tries to locate the specified layout in the following folders:
49+
50+
1. In `layouts` folder under the path specified by the `HYDE_DATA`
51+
environment variable
52+
2. In `layouts` folder under hyde
53+
54+
*Optional* - defaults to `basic`
55+
56+
`-v, --verbose`
57+
: Logs detailed messages to the console.
58+
59+
*Optional* - shows only essential messages if this option is omitted.
60+
61+
`-h`
62+
: Displays the help text for the `create` command.
63+
64+
Assuming the `HYDE_DATA` environment variable is empty and the folder
65+
`~/test` is empty, the following command will create a new hyde site
66+
at `~/test` with the contents of `layouts/doc` folder:
67+
68+
~~~sh~~~
69+
hyde -s ~/test create -l doc
70+
~~~~~~~~
71+
72+
## The generate command
73+
74+
Generates the given website.
75+
76+
~~~sh~~~
77+
hyde gen
78+
79+
hyde [-s </site/path>] [-v] gen [-d </deploy/path>] [-c <config/path>] [-h]
80+
~~~~~~~~
81+
82+
`-s SITEPATH, --sitepath SITEPATH`
83+
: The path to the site to be generated.
84+
85+
*Optional* - defaults to current working directory.
86+
87+
`-d DEPLOY_PATH, --deploy-path DEPLOY_PATH`
88+
: Location where the site should be generated. This option overrides any
89+
setting specified in the hyde [configuration][]. The path is assumed to
90+
be relative to the site path unless a preceding path separator is found.
91+
92+
*Optional* - Uses what is specified in the config file. The default option
93+
in the configuration file is: `deploy` folder under the current site path.
94+
95+
96+
`-c CONFIG, --config-path CONFIG`
97+
: This is used for specifying an alternate configuration file to use for
98+
generating the site. This is useful if you have two different configurations
99+
for you production versus development websites.
100+
101+
The path is assumed to be relative to the site path unless a preceding path
102+
separator is found.
103+
104+
*Optional* - defaults to `site.yaml`
105+
106+
`-v, --verbose`
107+
: Logs detailed messages to the console.
108+
109+
*Optional* - shows only essential messages if this option is omitted.
110+
111+
`-h`
112+
: Displays the help text for the `gen` command.
113+
114+
The following command will use `production.yaml` as the configuration file and
115+
generate the website at `~/test` to `~/production_site` directory.
116+
117+
~~~sh~~~
118+
cd ~/test
119+
hyde gen -c production.yaml -d ~/production_site
120+
~~~~~~~~
121+
122+
## The serve command
123+
124+
Starts the built in web server that also regenerates based on the request if there are
125+
changes.
126+
127+
~~~sh~~~
128+
hyde serve
129+
130+
hyde [-s </site/path>] [-v] gen [-d </deploy/path>] [-c <config/path>] [-h]
131+
~~~~~~~~
132+
133+
`-s SITEPATH, --sitepath SITEPATH`
134+
`-d DEPLOY_PATH, --deploy-path DEPLOY_PATH`
135+
`-c CONFIG, --config-path CONFIG`
136+
137+
: Since the `serve` command auto generates if there is a need, it needs
138+
the same parameters as the `gen` command. The above parameters serve
139+
the same purpose here as in the `gen` command.
140+
141+
`-a ADDRESS, --address ADDRESS`
142+
143+
: The address to serve the website.
144+
145+
*Optional* - defaults to `localhost`
146+
147+
`-p PORT, --port`
148+
149+
: The port to serve the website.
150+
151+
*Optional* - defaults to `8080`
152+
153+
`-h`
154+
155+
: Displays the help text for the `serve` command.
156+
157+
The following command will serve the website at `http://localhost:8181`
158+
159+
~~~sh~~~
160+
cd ~/test
161+
hyde serve -p 8181
162+
~~~~~~~~

content/configuration.html

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
===
2+
title: Configuration
3+
subtitle: change hyde to match your style
4+
created: 2011-01-28 01:30:05
5+
===
6+
7+
§§ blurb
8+
9+
Hyde is configured using one or more `yaml` files. On top of all
10+
the niceties `yaml` provides out of the box, hyde also adds a few
11+
power features to manage complex websites.
12+
13+
If a site has a `site.yaml` file in the root directory it is used
14+
as the configuration for generating the website. This can be
15+
overridden by providing a command line option. See the
16+
[command line reference][commandline] for details.
17+
18+
§§ /blurb
19+
20+
## Inheritance
21+
22+
Configuration files can inherit from another file using the
23+
`extends` option.
24+
25+
For example, the following configuration will inherit all properties
26+
from `site.yaml` and override the `mode` property.
27+
28+
~~~yaml~~~
29+
extends: site.yaml
30+
mode: production
31+
~~~~~~~~~~
32+
33+
This is useful for customizing the site to operate in different modes.
34+
For example, when running locally you may want your media files to
35+
come from `/media` but on production you may have a subdomain and want
36+
the media to come from `http://abc.example.com/media`.
37+
38+
This can be accomplished by creating an _extended_ configuration file and
39+
overriding the media_url property. For a real world example, you can take
40+
a look at the [source of this documentation][hydedocpages].
41+
42+
## Paths & Urls
43+
44+
The following path & url properties can be defined for use in templates:
45+
46+
`media_root`
47+
: The root path where media files(images, css, javascript etc.,)
48+
can be found. This may be used by plugins for special processing.
49+
If your website does not have a folder that contains all media,
50+
you can safely omit this property.
51+
52+
_Optional_. Default: `media`
53+
54+
`media_url`
55+
: The url prefix for serving media files. If you are using a CDN like
56+
Amazon S3 or the Rackspace cloud and host all your media files from
57+
there, you can make use of this property to specify the prefix for
58+
all media files.
59+
60+
_Optional_. Default: `/media`
61+
62+
`base_url`
63+
: The base url from which the site is served. If you are hosting the
64+
website in a subdomain or as part of a larger website, you can specify
65+
this property to indicate the path of this project in your website.
66+
67+
_Optional_. Default: `/`
68+
69+
`deploy_root`
70+
: Where the generated files should go. This can either be a relative
71+
path from the root of the site source or an absolute path. Note that
72+
this can also be overridden in the [command line][commandline] using
73+
the `-d` option.
74+
75+
## Plugins & templates
76+
77+
`template`
78+
: The template engine to use for processing the website can be specified
79+
in the configuration file as a python class path. Currently no other
80+
templates apart from `Jinja2` are supported, so the `template` setting
81+
is a NOOP at the moment.
82+
83+
_Optional_. Default: `hyde.ext.templates.jinja.Jinja2Template`
84+
85+
`plugins`
86+
: Plugins are specified as list of python class paths. Events that are
87+
raised during the generation of the website are issued to the plugins
88+
in the same order as they are listed here. You can learn more about
89+
how the individual plugins themselves are configured in the
90+
[plugin documentation][plugins].
91+
92+
_Optional_. Default: No plugins are loaded.
93+
94+
The following configuration option would load the metadata plugin
95+
and the blockdown plugin and execute events in the same order.
96+
97+
~~~yaml~~~
98+
plugins:
99+
- hyde.ext.plugins.meta.MetaPlugin
100+
- hyde.ext.plugins.blockdown.BlockdownPlugin
101+
~~~~~~~~~~~
102+
103+
## Context
104+
105+
The context section contains key / value pairs that are simply passed
106+
on to the templates
107+
108+
_Optional_. Default: No context variables are defined.
109+
110+
For example, given the following configuration, the statement
111+
`{%raw%}{{hyde.current_version}}{%endraw%}` in any template
112+
will output `0.6`.
113+
114+
~~~yaml~~~
115+
context:
116+
hyde:
117+
current_version: 0.6
118+
~~~~~~~~~~~
119+
120+
## Providers
121+
122+
Providers are special constructs used to import data into the context.
123+
For example, data from a database can be exported as `yaml` and imported
124+
as providers.
125+
126+
For example, consider the following snippet:
127+
128+
~~~yaml~~~
129+
context:
130+
providers:
131+
versions: hyde-versions.yaml
132+
~~~~~~~~~~~
133+
134+
This would import the data in `hyde-versions.yaml` into `context[versions]`.
135+
This data can be used directly in templates in this manner:
136+
`{%raw%}{{ versions.latest }}{%endraw%}`.
137+
138+
139+
## Markdown
140+
141+
Extensions and extension configuration for markdown can be configured in the
142+
`markdown` property. You can read about markdown extensions in
143+
[python markdown documentation][pymarkdown].
144+
145+
The following configuration:
146+
147+
~~~yaml~~~
148+
markdown:
149+
extensions:
150+
- def_list
151+
- tables
152+
- headerid
153+
~~~~~~~~~~
154+
155+
will use the def_list, tables and headerid extensions in python markdown.
156+
157+
158+
[commandline]: [[commandline.html]]
159+
[plugins]: [[plugins.html]]
160+
[pymarkdown]: http://www.freewisdom.org/projects/python-markdown/Available_Extensions
161+
[hydedocpages]: https://github.com/hyde/hyde/blob/master/hyde/layouts/doc/pages.yaml

content/extend/index.html

Whitespace-only changes.

content/extend/layouts.html

Whitespace-only changes.

content/extend/plugins.html

Whitespace-only changes.

content/extend/templates.html

Whitespace-only changes.

content/favicon.ico

1.12 KB
Binary file not shown.

0 commit comments

Comments
 (0)