Skip to content

Commit dff1000

Browse files
1 parent 2022f64 commit dff1000

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

packages/core/src/lib/object_factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Pattern.prototype = {
258258
*
259259
* @param {Patternlab} patternlab Current patternlab instance
260260
*/
261-
promoteFromDirectoryToFlatPattern: function(patternlab) {
261+
promoteFromFlatPatternToDirectory: function(patternlab) {
262262
const p = new Pattern(this.relPath, this.jsonFileData, patternlab, true);
263263
// Only reset the specific fields, not everything
264264
Object.assign(this, {

packages/core/src/lib/readDocumentation.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ module.exports = function(pattern, patternlab) {
5656
}
5757

5858
if (
59-
markdownObject.hasOwnProperty('subfolder') &&
60-
!markdownObject.subfolder
59+
!markdownObject.hasOwnProperty('deeplyNested') ||
60+
(markdownObject.hasOwnProperty('deeplyNested') &&
61+
!markdownObject.deeplyNested)
6162
) {
6263
// Reset to pattern without own pattern-directory
63-
pattern.promoteFromDirectoryToFlatPattern(patternlab);
64+
pattern.promoteFromFlatPatternToDirectory(patternlab);
6465
}
6566
} else {
6667
logger.warning(`error processing markdown for ${pattern.patternPartial}`);

packages/docs/src/docs/pattern-organization.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,12 @@ Node versions support nesting of folders under `patternSubtype`. For example, yo
5050
In this example the `media-block/` directory is ignored for the purposes of generating breadcrumbs and navigation in the Pattern Lab front-end but the documentation, pattern and pseudo-patterns are still rendered.
5151

5252
Folders can be nested under `media-block/` if desired but this is discouraged because of possible collisions when using the [shorthand partial syntax](/docs/including-patterns/).
53+
54+
### Deeper Nesting Settings
55+
56+
As documented in [Documenting Patterns](/docs/documenting-patterns/) there are several options to handle the patterns state or add additional information.
57+
58+
The `deeplyNested` attribute is used to toggle the pattern building behavior and toggles the deeper nesting.
59+
60+
- **deeplyNested not set or false** - Pattern won't be handled as a deeply nested pattern
61+
- **deeplyNested: true** - Pattern will be handled like mentioned under [Deeper Nesting](#heading-deeper-nesting)

0 commit comments

Comments
 (0)