memo: Updated README
This commit is contained in:
parent
80961a72e8
commit
1bb3a3923b
1 changed files with 44 additions and 33 deletions
|
@ -5,51 +5,62 @@
|
||||||
<br><sup>a library for made-to-measure sewing patterns</sup>
|
<br><sup>a library for made-to-measure sewing patterns</sup>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
# freesewing / plugins / macro-title
|
# plugin-title
|
||||||
|
|
||||||
This is a macro for [freesewing](https://github.com/freesewing/freesewing)
|
A freesewing plugin to add pretty part titles to your pattern.
|
||||||
to add a title to your pattern part.
|
|
||||||
|
|
||||||
## Install
|
## Usage
|
||||||
|
|
||||||
```sh
|
To load this plugin, add it to your instantiated pattern.
|
||||||
npm install @freesewing-plugins/macro-title --save
|
|
||||||
```
|
|
||||||
|
|
||||||
## Loading the plugin
|
On node.js:
|
||||||
|
|
||||||
Plugins are loaded by the `withPlugin` method of an instantiated freesewing pattern:
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import F from 'freesewing';
|
import pattern from '@freesewing/pattern-brian'
|
||||||
import partTitle from '@freesewing-plugins/macro-title';
|
import title from '@freesewing/plugin-theme'
|
||||||
|
import title from '@freesewing/plugin-title'
|
||||||
|
|
||||||
var pattern = new F.pattern()
|
pattern..with(theme).with(title);
|
||||||
.withPlugin(partTitle);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 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
|
<script>
|
||||||
part.macro('title', {
|
var pattern = freesewing.patterns.brian
|
||||||
at: points.titleAnchor
|
.with(freesewing.plugins.theme)
|
||||||
, nr: 2
|
.with(freesewing.plugins.title);
|
||||||
, name: 'backBlock'
|
</script>
|
||||||
, pattern: 'brian'
|
|
||||||
});
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 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
|
## Example
|
||||||
|
|
||||||
FIXME: include example
|
This plugin styles a title like this:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue