1
0
Fork 0

memo: Updated README

This commit is contained in:
joostdecock 2018-07-26 07:34:23 +00:00 committed by Joost De Cock
parent 80961a72e8
commit 1bb3a3923b

View file

@ -5,51 +5,62 @@
<br><sup>a library for made-to-measure sewing patterns</sup>
</h4>
# freesewing / plugins / macro-title
# plugin-title
This is a macro for [freesewing](https://github.com/freesewing/freesewing)
to add a title to your pattern part.
A freesewing plugin to add pretty part titles to your pattern.
## Install
## Usage
```sh
npm install @freesewing-plugins/macro-title --save
```
To load this plugin, add it to your instantiated pattern.
## Loading the plugin
Plugins are loaded by the `withPlugin` method of an instantiated freesewing pattern:
On node.js:
```js
import F from 'freesewing';
import partTitle from '@freesewing-plugins/macro-title';
import pattern from '@freesewing/pattern-brian'
import title from '@freesewing/plugin-theme'
import title from '@freesewing/plugin-title'
var pattern = new F.pattern()
.withPlugin(partTitle);
pattern..with(theme).with(title);
```
## Using the plugin
In the browser, this plugin will register as `freesewing.plugins.title`:
This plugin provides the `title` macro which you can call with the `macro` method on an instantiated pattern part:
```html
<script type="text/javascript" src="https://unpkg.com/freesewing"></script>
<script type="text/javascript" src="https://unpkg.com/@freesewing/pattern-brian"></script>
<script type="text/javascript" src="https://unpkg.com/@freesewing/plugin-theme"></script>
<script type="text/javascript" src="https://unpkg.com/@freesewing/plugin-title"></script>
```js
part.macro('title', {
at: points.titleAnchor
, nr: 2
, name: 'backBlock'
, pattern: 'brian'
});
<script>
var pattern = freesewing.patterns.brian
.with(freesewing.plugins.theme)
.with(freesewing.plugins.title);
</script>
```
### Parameters
- `at`: A point object to anchor the title on
- `nr`: The part number
- `name`: The part name
- `pattern`: The name of the pattern
As all freesewing macros, bundle these parameters into a single object.
## Example
FIXME: include example
This plugin styles a title like this:
![Example of the title inserted by this plugin](https://github.com/freesewing/plugin-title/raw/master/img/example.png)
## Install
To install, run:
```sh
npm install @freesewing/plugin-title
```
## Build
To build this plugin, run:
```sh
npm run build
```
## License: MIT
See [the license file](https://github.com/freesewing/plugin-theme/blob/master/LICENSE)
for details.