Skip to content

Commit f5a3bd0

Browse files
authored
Merge pull request #145 from basiljs/chore/update-docs
chore: Update Basil.js api to latest state πŸ’β€β™‚οΈ
2 parents 7fdc492 + db58faa commit f5a3bd0

File tree

6 files changed

+289
-1
lines changed

6 files changed

+289
-1
lines changed

β€Ž_source/_data/categories.json

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,52 @@
13431343
"summary": "Parses (decodes) a string to a JSON object.",
13441344
"codetitle": "JSON.parse(text, [reviver])"
13451345
},
1346+
{
1347+
"name": "contains",
1348+
"description": "Checks wether a string contains a specific string or if an array contains a specific element.",
1349+
"returns": {
1350+
"name": null,
1351+
"description": "Returns either true or false",
1352+
"type": [
1353+
"Boolean"
1354+
]
1355+
},
1356+
"category": "Data",
1357+
"subcategory": "String Functions",
1358+
"parameters": [
1359+
{
1360+
"name": "searchContainer",
1361+
"description": "A string or an array to be checked",
1362+
"optional": false,
1363+
"type": [
1364+
"String"
1365+
]
1366+
},
1367+
{
1368+
"name": "valueToFind",
1369+
"description": "The value to search for",
1370+
"optional": false,
1371+
"type": [
1372+
"String"
1373+
]
1374+
}
1375+
],
1376+
"kind": "function",
1377+
"tags": [
1378+
{
1379+
"title": "summary",
1380+
"description": "Checks wether a string contains a specific string or if an array contains a specific element."
1381+
},
1382+
{
1383+
"title": "description",
1384+
"description": "Checks wether a string contains a specific string or if an array contains a specific element."
1385+
}
1386+
],
1387+
"examples": [],
1388+
"todo": null,
1389+
"summary": "Parses (decodes) a string to a JSON object.",
1390+
"codetitle": "JSON.parse(text, [reviver])"
1391+
},
13461392
{
13471393
"name": "contains",
13481394
"description": "Checks wether a string contains a specific string or if an array contains a specific element.",
@@ -3550,6 +3596,55 @@
35503596
"summary": "Runs a function on all page items of a script label or returns them.",
35513597
"codetitle": "labels(label, [cb])"
35523598
},
3599+
{
3600+
"name": "linkedTextFrames",
3601+
"description": "Returns an array of all linked text frames or text paths in relation to a given Text Frame, Text Path, Story or Text Object.\nIf a callback function is given, `textFrames()` calls this callback function on each text frame of the given container. When the callback function returns false, the loop stops and the `textFrames()` function returns an array of all text frames up to this point.",
3602+
"returns": {
3603+
"name": null,
3604+
"description": "The array of linked text frames or text paths.",
3605+
"type": [
3606+
"Array"
3607+
]
3608+
},
3609+
"category": "Document",
3610+
"subcategory": "Page Items",
3611+
"parameters": [
3612+
{
3613+
"name": "item",
3614+
"description": "The text frame, text path, story or text object of the text frame chain.",
3615+
"optional": false,
3616+
"type": [
3617+
"TextFrame",
3618+
"TextPath",
3619+
"Story",
3620+
"TextObject"
3621+
]
3622+
},
3623+
{
3624+
"name": "cb",
3625+
"description": "The callback function to call with each text frame or text path. When this function returns false the loop stops. Passed arguments: `textFrame`, `loopCount`.",
3626+
"optional": true,
3627+
"type": [
3628+
"Function"
3629+
]
3630+
}
3631+
],
3632+
"kind": "function",
3633+
"tags": [
3634+
{
3635+
"title": "summary",
3636+
"description": "Runs a function on a chain of linked text frames or returns them."
3637+
},
3638+
{
3639+
"title": "description",
3640+
"description": "Returns an array of all linked text frames or text paths in relation to a given Text Frame, Text Path, Story or Text Object.\nIf a callback function is given, `textFrames()` calls this callback function on each text frame of the given container. When the callback function returns false, the loop stops and the `textFrames()` function returns an array of all text frames up to this point."
3641+
}
3642+
],
3643+
"examples": [],
3644+
"todo": null,
3645+
"summary": "Runs a function on a chain of linked text frames or returns them.",
3646+
"codetitle": "linkedTextFrames(item, [cb])"
3647+
},
35533648
{
35543649
"name": "nameOnPage",
35553650
"description": "Returns the first item on the active page that is named by the given name in the Layers pane (`Window -> Layer`).",
@@ -3702,6 +3797,58 @@
37023797
"summary": "Runs a function on all selected page items or returns them.",
37033798
"codetitle": "selections([cb])"
37043799
},
3800+
{
3801+
"name": "textFrames",
3802+
"description": "Returns a collection of all text frames in the given container. The container object can be a Document, Page, Layer, Group, Story, Page Item or Text Object.\nIf a callback function is given, `textFrames()` calls this callback function on each text frame of the given container. When the callback function returns false, the loop stops and the `textFrames()` function returns an array of all text frames up to this point.",
3803+
"returns": {
3804+
"name": null,
3805+
"description": "An array of Text Frames.",
3806+
"type": [
3807+
"Array"
3808+
]
3809+
},
3810+
"category": "Document",
3811+
"subcategory": "Page Items",
3812+
"parameters": [
3813+
{
3814+
"name": "container",
3815+
"description": "The document, page, layer, group, story, page item or text object to iterate the text frames in.",
3816+
"optional": false,
3817+
"type": [
3818+
"Document",
3819+
"Page",
3820+
"Layer",
3821+
"Group",
3822+
"Story",
3823+
"PageItem",
3824+
"TextObject"
3825+
]
3826+
},
3827+
{
3828+
"name": "cb",
3829+
"description": "The callback function to call with each text frame. When this function returns false the loop stops. Passed arguments: `textFrame`, `loopCount`.",
3830+
"optional": true,
3831+
"type": [
3832+
"Function"
3833+
]
3834+
}
3835+
],
3836+
"kind": "function",
3837+
"tags": [
3838+
{
3839+
"title": "summary",
3840+
"description": "Runs a function on a collection of text frames in a container or returns them."
3841+
},
3842+
{
3843+
"title": "description",
3844+
"description": "Returns a collection of all text frames in the given container. The container object can be a Document, Page, Layer, Group, Story, Page Item or Text Object.\nIf a callback function is given, `textFrames()` calls this callback function on each text frame of the given container. When the callback function returns false, the loop stops and the `textFrames()` function returns an array of all text frames up to this point."
3845+
}
3846+
],
3847+
"examples": [],
3848+
"todo": null,
3849+
"summary": "Runs a function on a collection of text frames in a container or returns them.",
3850+
"codetitle": "textFrames(container, [cb])"
3851+
},
37053852
{
37063853
"name": "ungroup",
37073854
"description": "Ungroups an existing group. Returns an array of the items that were within the group before ungroup() was called.",

β€Ž_source/_data/cats-and-subcats.json

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3610,6 +3610,55 @@
36103610
"summary": "Runs a function on all page items of a script label or returns them.",
36113611
"codetitle": "labels(label, [cb])"
36123612
},
3613+
{
3614+
"name": "linkedTextFrames",
3615+
"description": "Returns an array of all linked text frames or text paths in relation to a given Text Frame, Text Path, Story or Text Object.\nIf a callback function is given, `textFrames()` calls this callback function on each text frame of the given container. When the callback function returns false, the loop stops and the `textFrames()` function returns an array of all text frames up to this point.",
3616+
"returns": {
3617+
"name": null,
3618+
"description": "The array of linked text frames or text paths.",
3619+
"type": [
3620+
"Array"
3621+
]
3622+
},
3623+
"category": "Document",
3624+
"subcategory": "Page Items",
3625+
"parameters": [
3626+
{
3627+
"name": "item",
3628+
"description": "The text frame, text path, story or text object of the text frame chain.",
3629+
"optional": false,
3630+
"type": [
3631+
"TextFrame",
3632+
"TextPath",
3633+
"Story",
3634+
"TextObject"
3635+
]
3636+
},
3637+
{
3638+
"name": "cb",
3639+
"description": "The callback function to call with each text frame or text path. When this function returns false the loop stops. Passed arguments: `textFrame`, `loopCount`.",
3640+
"optional": true,
3641+
"type": [
3642+
"Function"
3643+
]
3644+
}
3645+
],
3646+
"kind": "function",
3647+
"tags": [
3648+
{
3649+
"title": "summary",
3650+
"description": "Runs a function on a chain of linked text frames or returns them."
3651+
},
3652+
{
3653+
"title": "description",
3654+
"description": "Returns an array of all linked text frames or text paths in relation to a given Text Frame, Text Path, Story or Text Object.\nIf a callback function is given, `textFrames()` calls this callback function on each text frame of the given container. When the callback function returns false, the loop stops and the `textFrames()` function returns an array of all text frames up to this point."
3655+
}
3656+
],
3657+
"examples": [],
3658+
"todo": null,
3659+
"summary": "Runs a function on a chain of linked text frames or returns them.",
3660+
"codetitle": "linkedTextFrames(item, [cb])"
3661+
},
36133662
{
36143663
"name": "nameOnPage",
36153664
"description": "Returns the first item on the active page that is named by the given name in the Layers pane (`Window -> Layer`).",
@@ -3761,6 +3810,58 @@
37613810
"todo": null,
37623811
"summary": "Runs a function on all selected page items or returns them.",
37633812
"codetitle": "selections([cb])"
3813+
},
3814+
{
3815+
"name": "textFrames",
3816+
"description": "Returns a collection of all text frames in the given container. The container object can be a Document, Page, Layer, Group, Story, Page Item or Text Object.\nIf a callback function is given, `textFrames()` calls this callback function on each text frame of the given container. When the callback function returns false, the loop stops and the `textFrames()` function returns an array of all text frames up to this point.",
3817+
"returns": {
3818+
"name": null,
3819+
"description": "An array of Text Frames.",
3820+
"type": [
3821+
"Array"
3822+
]
3823+
},
3824+
"category": "Document",
3825+
"subcategory": "Page Items",
3826+
"parameters": [
3827+
{
3828+
"name": "container",
3829+
"description": "The document, page, layer, group, story, page item or text object to iterate the text frames in.",
3830+
"optional": false,
3831+
"type": [
3832+
"Document",
3833+
"Page",
3834+
"Layer",
3835+
"Group",
3836+
"Story",
3837+
"PageItem",
3838+
"TextObject"
3839+
]
3840+
},
3841+
{
3842+
"name": "cb",
3843+
"description": "The callback function to call with each text frame. When this function returns false the loop stops. Passed arguments: `textFrame`, `loopCount`.",
3844+
"optional": true,
3845+
"type": [
3846+
"Function"
3847+
]
3848+
}
3849+
],
3850+
"kind": "function",
3851+
"tags": [
3852+
{
3853+
"title": "summary",
3854+
"description": "Runs a function on a collection of text frames in a container or returns them."
3855+
},
3856+
{
3857+
"title": "description",
3858+
"description": "Returns a collection of all text frames in the given container. The container object can be a Document, Page, Layer, Group, Story, Page Item or Text Object.\nIf a callback function is given, `textFrames()` calls this callback function on each text frame of the given container. When the callback function returns false, the loop stops and the `textFrames()` function returns an array of all text frames up to this point."
3859+
}
3860+
],
3861+
"examples": [],
3862+
"todo": null,
3863+
"summary": "Runs a function on a collection of text frames in a container or returns them.",
3864+
"codetitle": "textFrames(container, [cb])"
37643865
}
37653866
],
37663867
"subcat": "Page Items",

β€Ž_source/_data/function-list.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"blendMode":true,"color":true,"colorMode":true,"fill":true,"fillTint":true,"gradient":true,"gradientMode":true,"lerpColor":true,"noFill":true,"noStroke":true,"opacity":true,"stroke":true,"strokeTint":true,"swatch":true,"forEach":true,"binary":true,"hex":true,"unbinary":true,"unhex":true,"CSV":true,"HashList":true,"JSON":true,"contains":true,"endsWith":true,"join":true,"nf":true,"nfc":true,"nfp":true,"nfs":true,"split":true,"splitTokens":true,"startsWith":true,"trim":true,"trimWord":true,"isArray":true,"isInteger":true,"isNumber":true,"isString":true,"isText":true,"isURL":true,"clear":true,"close":true,"doc":true,"layer":true,"referencePoint":true,"remove":true,"revert":true,"units":true,"bleeds":true,"canvasMode":true,"guideX":true,"guideY":true,"margins":true,"pasteboard":true,"addPage":true,"applyMasterPage":true,"masterPage":true,"nextPage":true,"page":true,"pageCount":true,"pageNumber":true,"previousPage":true,"removePage":true,"applyObjectStyle":true,"arrange":true,"bounds":true,"duplicate":true,"graphics":true,"group":true,"items":true,"label":true,"labels":true,"nameOnPage":true,"objectStyle":true,"selection":true,"selections":true,"ungroup":true,"addToStory":true,"characters":true,"lines":true,"linkTextFrames":true,"paragraphs":true,"placeholder":true,"stories":true,"textStyleRanges":true,"words":true,"delay":true,"frameRate":true,"height":true,"width":true,"VERSION":true,"EPSILON":true,"HALF_PI":true,"KAPPA":true,"PI":true,"QUARTER_PI":true,"SINCOS_LENGTH":true,"TWO_PI":true,"LOREM":true,"inspect":true,"printInfo":true,"projectFolder":true,"property":true,"size":true,"stackArray":true,"image":true,"imageMode":true,"shellExecute":true,"download":true,"file":true,"files":true,"folder":true,"loadJSON":true,"loadString":true,"loadStrings":true,"selectFile":true,"selectFiles":true,"selectFolder":true,"day":true,"hour":true,"millis":true,"millisecond":true,"minute":true,"month":true,"second":true,"timestamp":true,"weekday":true,"year":true,"abs":true,"ceil":true,"constrain":true,"dist":true,"exp":true,"floor":true,"lerp":true,"log":true,"mag":true,"map":true,"max":true,"min":true,"norm":true,"pow":true,"round":true,"sq":true,"sqrt":true,"noise":true,"noiseDetail":true,"noiseSeed":true,"random":true,"randomSeed":true,"acos":true,"asin":true,"atan":true,"atan2":true,"cos":true,"degrees":true,"radians":true,"sin":true,"tan":true,"Vector":true,"print":true,"println":true,"saveJSON":true,"savePDF":true,"savePNG":true,"saveString":true,"saveStrings":true,"ellipseMode":true,"rectMode":true,"strokeWeight":true,"arc":true,"ellipse":true,"line":true,"point":true,"quad":true,"rect":true,"triangle":true,"addPath":true,"beginShape":true,"endShape":true,"vertex":true,"mode":true,"noLoop":true,"applyMatrix":true,"popMatrix":true,"printMatrix":true,"pushMatrix":true,"resetMatrix":true,"rotate":true,"scale":true,"transform":true,"translate":true,"text":true,"textAlign":true,"textFont":true,"textKerning":true,"textLeading":true,"textSize":true,"textTracking":true,"typo":true,"applyCharacterStyle":true,"applyParagraphStyle":true,"characterStyle":true,"paragraphStyle":true}
1+
{"blendMode":true,"color":true,"colorMode":true,"fill":true,"fillTint":true,"gradient":true,"gradientMode":true,"lerpColor":true,"noFill":true,"noStroke":true,"opacity":true,"stroke":true,"strokeTint":true,"swatch":true,"forEach":true,"binary":true,"hex":true,"unbinary":true,"unhex":true,"CSV":true,"HashList":true,"JSON":true,"contains":true,"endsWith":true,"join":true,"nf":true,"nfc":true,"nfp":true,"nfs":true,"split":true,"splitTokens":true,"startsWith":true,"trim":true,"trimWord":true,"isArray":true,"isInteger":true,"isNumber":true,"isString":true,"isText":true,"isURL":true,"clear":true,"close":true,"doc":true,"layer":true,"referencePoint":true,"remove":true,"revert":true,"units":true,"bleeds":true,"canvasMode":true,"guideX":true,"guideY":true,"margins":true,"pasteboard":true,"addPage":true,"applyMasterPage":true,"masterPage":true,"nextPage":true,"page":true,"pageCount":true,"pageNumber":true,"previousPage":true,"removePage":true,"applyObjectStyle":true,"arrange":true,"bounds":true,"duplicate":true,"graphics":true,"group":true,"items":true,"label":true,"labels":true,"linkedTextFrames":true,"nameOnPage":true,"objectStyle":true,"selection":true,"selections":true,"textFrames":true,"ungroup":true,"addToStory":true,"characters":true,"lines":true,"linkTextFrames":true,"paragraphs":true,"placeholder":true,"stories":true,"textStyleRanges":true,"words":true,"delay":true,"frameRate":true,"height":true,"width":true,"VERSION":true,"EPSILON":true,"HALF_PI":true,"KAPPA":true,"PI":true,"QUARTER_PI":true,"SINCOS_LENGTH":true,"TWO_PI":true,"LOREM":true,"inspect":true,"printInfo":true,"projectFolder":true,"property":true,"size":true,"stackArray":true,"image":true,"imageMode":true,"shellExecute":true,"download":true,"file":true,"files":true,"folder":true,"loadJSON":true,"loadString":true,"loadStrings":true,"selectFile":true,"selectFiles":true,"selectFolder":true,"day":true,"hour":true,"millis":true,"millisecond":true,"minute":true,"month":true,"second":true,"timestamp":true,"weekday":true,"year":true,"abs":true,"ceil":true,"constrain":true,"dist":true,"exp":true,"floor":true,"lerp":true,"log":true,"mag":true,"map":true,"max":true,"min":true,"norm":true,"pow":true,"round":true,"sq":true,"sqrt":true,"noise":true,"noiseDetail":true,"noiseSeed":true,"random":true,"randomSeed":true,"acos":true,"asin":true,"atan":true,"atan2":true,"cos":true,"degrees":true,"radians":true,"sin":true,"tan":true,"Vector":true,"print":true,"println":true,"saveJSON":true,"savePDF":true,"savePNG":true,"saveString":true,"saveStrings":true,"ellipseMode":true,"rectMode":true,"strokeWeight":true,"arc":true,"ellipse":true,"line":true,"point":true,"quad":true,"rect":true,"triangle":true,"addPath":true,"beginShape":true,"endShape":true,"vertex":true,"mode":true,"noLoop":true,"applyMatrix":true,"popMatrix":true,"printMatrix":true,"pushMatrix":true,"resetMatrix":true,"rotate":true,"scale":true,"transform":true,"translate":true,"text":true,"textAlign":true,"textFont":true,"textKerning":true,"textLeading":true,"textSize":true,"textTracking":true,"typo":true,"applyCharacterStyle":true,"applyParagraphStyle":true,"characterStyle":true,"paragraphStyle":true}

β€Ž_source/download/changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ basil.js x.x.x DAY MONTH YEAR
3737
+ Added property()
3838
sets a property of an object to a given value
3939
+ Added graphics() to loop over graphics in a given container
40+
+ Added textFrames() to loop over text frames in a given container
41+
+ Added linkedTextFrames() to loop over all linked text frames of a text frame chain
4042
+ Added textStyleRanges() to loop over text style ranges in a given container
4143
+ Added swatch()
4244
returns a color or gradient of a given name

0 commit comments

Comments
Β (0)