|
| 1 | +gLabels Product Template Style Guide |
| 2 | +==================================== |
| 3 | + |
| 4 | +This file describes the prefered style for product template submissions. See |
| 5 | +[PRODUCT-TEMPLATES.md](PRODUCT-TEMPLATES.md) located in this directory for detailed |
| 6 | +systax documentation. |
| 7 | + |
| 8 | + |
| 9 | +Organization |
| 10 | +------------ |
| 11 | + |
| 12 | +Template files are located in the [templates](../templates/) directory. The following |
| 13 | +is the naming convention for these files: |
| 14 | + |
| 15 | + <pre><i>brand</i>-<i>class</i>-templates.xml</pre> |
| 16 | + |
| 17 | +Where *brand* is the lowercase brand name, and *class* is the media size class (currently |
| 18 | +`iso`, `us`, and `other`). |
| 19 | + |
| 20 | +Templates should be sorted in [natural order](https://en.wikipedia.org/wiki/Natural_sort_order) |
| 21 | +by part number within each file. An exception to this rule is to group equivalent templates |
| 22 | +directly below their referenced template. For example: |
| 23 | + |
| 24 | +```xml |
| 25 | + <Template brand="Avery" part="5126" size="US-Letter" _description="Shipping labels"> |
| 26 | + <Meta category="label"/> |
| 27 | + <Meta category="rectangle-label"/> |
| 28 | + <Meta category="mail"/> |
| 29 | + <Label-rectangle id="0" width="8.5in" height="5.5in" round="0in" x_waste="0in" y_waste="0in"> |
| 30 | + <Markup-margin size="9pt"/> |
| 31 | + <Layout nx="1" ny="2" x0="0in" y0="0in" dx="0in" dy="5.5in"/> |
| 32 | + </Label-rectangle> |
| 33 | + </Template> |
| 34 | + |
| 35 | + <Template brand="Avery" part="5526" equiv="5126"/> |
| 36 | + <Template brand="Avery" part="8126" equiv="5126"/> |
| 37 | + <Template brand="Avery" part="15516" equiv="5126"/> |
| 38 | + <Template brand="Avery" part="18126" equiv="5126"/> |
| 39 | + |
| 40 | + |
| 41 | + <Template brand="Avery" part="5159" size="US-Letter" _description="Address labels">... |
| 42 | +``` |
| 43 | + |
| 44 | +When creating a new template file, it must be added to the variable template_files in |
| 45 | +the [CMakeLists.txt](../templates/CMakeLists.txt) file in this same directory. |
| 46 | + |
| 47 | + |
| 48 | +*Template* Node Attributes |
| 49 | +-------------------------- |
| 50 | + |
| 51 | +### *brand* Attribute |
| 52 | + |
| 53 | +This is the brand name or manufacturer of the product. It must match one of the vendors |
| 54 | +in the [vendors.xml](../templates/vendors.xml) file. Add a new vendor line if it does not |
| 55 | +currently exist. |
| 56 | + |
| 57 | + |
| 58 | +### *part* Attribute |
| 59 | + |
| 60 | +This is the actual part number of the product. This is usually a short set of numbers and/or |
| 61 | +letters. This is not a description or name of the product. The following are examples |
| 62 | +of part numbers: |
| 63 | + |
| 64 | +- `5160` |
| 65 | +- `WL-102` |
| 66 | +- `J8435B` |
| 67 | + |
| 68 | +Sometimes a product includes multiple label types, either as separate sheets or different |
| 69 | +types of labels on the same sheet. In these cases, providing a short suffix to part number |
| 70 | +is acceptable. For example: |
| 71 | + |
| 72 | +- `3274.1`, `3274.2`, and `3274.3` |
| 73 | +- `5931-Disc`, and `5931-Spine` |
| 74 | + |
| 75 | + |
| 76 | +### *_description* Attribute |
| 77 | + |
| 78 | +- Descriptions should be short. They should describe what the product is in very simple terms |
| 79 | + without being too detailed. They should not describe details such as size, quantity, layout, |
| 80 | + color, or material. The description should not include brand or part number information. |
| 81 | + Size, quantity, layout, brand, and part number are described by other elements of the |
| 82 | + template - do not repeat them in the description. |
| 83 | + |
| 84 | +- If at all possible, try to reuse descriptions from other templates (this keeps the |
| 85 | + number of unique strings that need translation to a minimum). |
| 86 | + |
| 87 | +- Don't repeat the brand or part number in the description. |
| 88 | + |
| 89 | +- Only capitalize the first word of the description. |
| 90 | + |
| 91 | +The following are good bad descriptions: |
| 92 | + |
| 93 | +| description | Good/Bad | Notes | |
| 94 | +|:-------------------------|:--------:|:----------------------------------------------| |
| 95 | +| `Address labels` | ✅ | | |
| 96 | +| `Address Labels` | ❌ | Capitalized second word of description. | |
| 97 | +| `Business cards` | ✅ | | |
| 98 | +| `Multipurpose labels` | ✅ | | |
| 99 | +| `CD/DVD labels` | ✅ | | |
| 100 | +| `19mm x 30mm labels` | ❌ | Don't include size information. | |
| 101 | +| `Labels 15 per sheet` | ❌ | Don't include layout or quantity information. | |
| 102 | +| `Dymo continuous labels` | ❌ | Don't include brand or part number. | |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +*Meta* Node Attributes |
| 107 | +---------------------- |
| 108 | + |
| 109 | +### *category* Attribute |
| 110 | + |
| 111 | +- All templates should include all appropriate `<Meta category=...` nodes. |
| 112 | +- Categories must match one of the existing categories in the [categories.xml](../templates/categories.xml) file. Do not add new categories! |
| 113 | +- All templates should include either a `<Meta category="label"/>` or `<Meta category="card"/>` node. |
| 114 | + |
| 115 | + |
| 116 | +### *product_url* Attribute |
| 117 | + |
| 118 | +Unfortunately, manufacturer websites are constantly being updated and rearranged, rendering such deep URLs obsolete very quickly. Therefore, |
| 119 | +use of this attribute is deprecated. |
| 120 | + |
0 commit comments