-# metaforge - v0.1.2
+# metaforge - v0.1.3
a pattern driven static site generator for extensible snippet insertion.
## about
metaforge is a static site generator that lets you write something once, and re-use it
-across your site. it requires previous knowledge of html, and doesn't come with pre-made
-themes or templates except for a completely bare skeleton directory. it gives you extremely
-fine grained control over the generated html, customizing each pattern to a source file
+across your site.
+
+metaforge doesn't come with pre-made themes or templates except for a completely bare skeleton directory.
+it gives you extremely fine grained control over the generated html, customizing each pattern to a source file
with variables and mappable arrays.
metaforge also lets you write metapatterns that contain classes, masking choices to a
such as an rss feed. metaforge can also technically translate between any two document formats pandoc supports,
but nothing other than the default markdown to html gets tested.
-the full documentation is available in this repository under the **files/README/source/docs**
+the full documentation is available in this repository under the **docs/source**
directory. it's currently setup as a working example of a metaforge site, so you can poke around
and see one way a site can be setup.
this command can be run as many times as needed to regenerate the documentation, and is
reccomended after upgrading to a new version to see what's changed. the generated docs will
-be available in **files/README/build**, and can be looked at in any web browser.
+be available in **docs/build**, and can be looked at in any web browser.
-{ index is a folder up in this directory }
home = '../index.html'
-{ using substitutions for example code so it doesn't mess up parsing }
- var = '${ '
- arr = '@{ '
- pat = '&{ '
- head = '#{ '
- com = '-{ '
+ var = '${'
+ arr = '@{'
+ pat = '&{'
+ head = '#{'
+ com = '-{'
}
${
title = 'definitions'
description = 'definining variables and patterns'
- arr_sub = '@{'
}
## rules
foo.bar = [ 'foobar', 'foobaz' ]
${com} this will copy pattern/foo/*.meta twice, inserting 'foobar and 'foobaz'
- once each at the location of ${arr_sub}bar} }
+ once each at the location of ${arr}bar} }
}
${com} all of these patterns are only defined for this file }
${
title = 'expansions'
description = 'expanding variables and patterns in a file'
- var_sub = '${'
- arr_sub = '@{'
- pat_sub = '&{'
}
## syntax
### examples
- ...this is a string with a ${var_sub}variable} to be expanded...
+ ...this is a string with a ${var}variable} to be expanded...
- ...this line has a ${pat_sub}pattern} inside of it...
+ ...this line has a ${pat}pattern} inside of it...
- ...this ${arr_sub}array} will be replaced...
+ ...this ${arr}array} will be replaced...
## behavior
quux = BLANK
}
- pattern [foo]: <p>${var_sub}baz} ${var}quux}</p>
+ pattern [foo]: <p>${var}baz} ${var}quux}</p>
expanded [foo]: <p>foo </p>
- pattern [bar]: <p>${var_sub}baz} ${var}quux}</p>
+ pattern [bar]: <p>${var}baz} ${var}quux}</p>
expanded [bar]: <p>quux </p>
#### example
- pattern [foo]: <p>${arr_sub}bar}</p>
+ pattern [foo]: <p>${arr}bar}</p>
defintion: ${arr} foo.bar = ['foo', 'bar', 'baz'] }
source files.
### example
- ...lorem ${pat_sub}SOURCE.foo.bar} ipsum dolor...
+ ...lorem ${pat}SOURCE.foo.bar} ipsum dolor...
once the filename is determined, it is parsed and expands any contained variables,
arrays and patterns. if it is a ***SOURCE*** pattern, it is converted to html after
## building
as each source file is built, the first thing expanded is the defined or default
-**[SOURCE]/base/[FILE].meta** pattern, so it is required to have at least a **default.meta**
+**[PATTERN]/base/[FILE].meta** pattern, so it is required to have at least a **default.meta**
in the **pattern/base** directory
### example
- pattern [base]: <html>${pat_sub}body}</html>
+ pattern [base]: <html>${pat}body}</html>
- pattern [body]: <body>${pat_sub}SOURCE}</body>
+ pattern [body]: <body>${pat}SOURCE}</body>
source [SOURCE]: foo *bar* baz
but can contain anything that you'd like to substitute.
required directories are:
+
- source (site structure and contents)
- pattern (patterns for expansion)
- pattern/base (gets expanded to start building each pattern)