You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Scribble GYB configuration simplifies boilerplate code generation for ScribbleLabApp projects. By utilizing Python scripting capabilities, GYB provides a flexible approach to reducing repetitive code and improving consistency in Swift, Objective-C, and Objective-C++ projects.
4
+
5
+
## Table of Contents
4
6
5
-
This repository provides a GYB (Generate Your Boilerplate) configuration tailored for ScribbleLabApp projects. GYB is a tool for generating Swift code using templates, which helps in maintaining a consistent and DRY (Don't Repeat Yourself) codebase. This setup automates boilerplate code generation, reducing manual coding effort and minimizing errors.
7
+
1.[Overview](#overview)
8
+
2.[Installation](#installation)
9
+
10
+
2.1 [Add scribble-gyb as git submodule](#option-1-add-scribble-gyb-as-git-submodule)
The Scribble GYB configuration streamlines the generation of boilerplate code for Swift projects. By using this configuration, you can ensure repetitive code patterns are handled efficiently and consistently across your projects.
22
+
## Overview
10
23
11
-
## Getting Started
24
+
GYB (Generate Your Boilerplate) is a tool used to generate source code by mixing Python code with template files. It allows developers to avoid redundancy by dynamically generating patterns across different files or languages. Scribble GYB offers a powerful way to ensure clean, consistent code while minimizing manual coding effort.
12
25
13
-
###Installation
26
+
## Installation
14
27
15
-
To use the Scribble GYB configuration, you can either add it to your project as a submodule or manually copy the necessary files.
28
+
Scribble GYB can be integrated into your project either as a Git submodule or by manually copying files into the project directory.
16
29
17
-
####Option 1: Add scribble-gyb as git submodule
30
+
### Option 1: Add scribble-gyb as git submodule
18
31
19
32
1. Navigate to your project you want to use scribble-gyb in:
20
33
@@ -42,31 +55,29 @@ To use the Scribble GYB configuration, you can either add it to your project as
4. Navigate to your project directory and ensure the files are in place under the utils directory.
58
70
59
-
## Usage
71
+
## Template Syntax
60
72
61
-
The GYB (Generate Your Boilerplate) tool is configured in this repository to allow you to integrate Python scripting with Swift code generation. This setup provides a flexible and powerful way to generate boilerplate code dynamically.
73
+
GYB templates are composed of two primary elements:
62
74
63
-
### Scribble-GYB Syntax
64
-
65
-
In GYB templates, you can mix Python code with Swift code. The syntax allows you to embed Python code within Swift files using special markers and placeholders.
75
+
- **Python code blocks**for logic and control flow.
76
+
- **Code placeholders** that insert Python values into generated code.
66
77
67
78
#### Python Code Blocks
68
79
69
-
To include Python code in your Swift files, use the following markers:
80
+
Python code is either written inside `%{ ... }%` or `${...}$` blocks. These blocks are executed at template processing time, allowing for dynamic code generation based on runtime values or logic.
70
81
71
82
```python
72
83
%{
@@ -77,59 +88,111 @@ To include Python code in your Swift files, use the following markers:
77
88
78
89
#### Variables and Placeholders
79
90
80
-
You can define Python variables and use them as placeholders in your Swift code. Use the `${var}` syntax to insert Python variable values into your Swift code.
91
+
Python variables defined inside a GYB template can be inserted into Swift, Objective-C, or Objective-C++ code using `${var}` syntax.
0 commit comments