Zontroy AI
  • 🖌️Getting started with Zontroy AI
  • INTRODUCTION
    • Zontroy AI
    • Why Choose Zontroy AI?
      • Free AI Models Integration
      • Free for Students
      • Technical Advantages
      • The Developer's Choice
    • Zontroy AI Quick Start
    • Zontroy AI Chat
    • Zontroy AI Collaborator
    • Zontroy AI Peerer
    • Zontroy AI Model Context Protocol (MCP)
  • Zontroy Offline Code Generator
    • Zontroy Offline Code Generator
      • Oprazi .zproject file for MSSQL
      • CrudwithGo .zproject file for MySQL
      • Course-management .zproject file for Entity
      • JavaCodeGenerator .zproject file for PostgreSQL
    • Zontroy AI Offline File Types
      • Zontroy AI Offline Single File
      • Zontroy AI Offline Repeating File
      • Zontroy AI Offline Inner Repeating File
    • Zontroy AI Offline Code Generator Tutorial
      • Zontroy Syntax
      • zg-entity
      • zg-entities
      • zg-if
      • zg-for
      • Data Type Conversion
      • Built-in Functions
  • Zontroy AI Models
    • Supported AI Models
      • OpenAI
      • Anthropic (Claude)
      • DeepSeek
      • Google (Gemini)
      • Qwen
      • xAI
      • Llama
      • OpenRouter
    • Selecting the Optimal Model for Different Tasks
  • Zontroy AI How To
    • Javascript
    • Typescript
    • Java
    • Python
    • CSharp
    • PHP
Powered by GitBook
On this page
  • zsif
  • File Naming Format
  • File Naming Example
  • Code Example
  • Output Example
  • Generate in Zontroy IDE
  1. Zontroy Offline Code Generator
  2. Zontroy AI Offline File Types

Zontroy AI Offline Single File

PreviousZontroy AI Offline File TypesNextZontroy AI Offline Repeating File

Last updated 6 days ago

Zontroy Offline has 3 file types to generate code.

zsif

Zontroy Single File is used to generate lines of code inside a single file. It uses .zsif extension.

File Naming Format

[file_name].[file_extension].zsif

File Naming Example

MyCodeFile.java.zsif

Code Example

A simple usage example of zsif file in React.js.

// PrivateRoutes.tsx.zsif
import {Suspense} from 'react'
import {Route} from 'react-router-dom'

zg-for(((zg-item:::[[[zg-entities]]]))){{{
const [[[zg-item...zg-name]]]Page = lazy(() => import('../modules/zg-lower(((zg-item...zg-name)))/zg-singularize(((zg-item...zg-name)))Page'))   
}}}

zg-for(((zg-item:::[[[zg-entities]]]))){{{
  <Route
    path='crafted/zg-pluralize(((zg-lower(((zg-item...zg-name))))))/zg-lower(((zg-item...zg-name)))/*'
    element={
      <SuspensedView>
        <[[[zg-item...zg-name]]]Page />
      </SuspensedView>
    }
  />
}}}

Output Example

// PrivateRoutes.tsx.zsif
import {Suspense} from 'react'
import {Route} from 'react-router-dom'
    

const cityPage = lazy(() => import('../modules/city/cityPage'))   

const countryPage = lazy(() => import('../modules/country/countryPage'))   

const customerPage = lazy(() => import('../modules/customer/customerPage'))   



  <Route
    path='crafted/cities/city/*'
    element={
      <SuspensedView>
        <cityPage />
      </SuspensedView>
    }
  />

  <Route
    path='crafted/countries/country/*'
    element={
      <SuspensedView>
        <countryPage />
      </SuspensedView>
    }
  />

  <Route
    path='crafted/customers/customer/*'
    element={
      <SuspensedView>
        <customerPage />
      </SuspensedView>
    }
  />

Generate in Zontroy IDE

Create an Empty Zontroy Project using menu File -> New Project -> Create (Empty Zontroy Project).

Add a zsif file into the project

Name the file as PrivateRoutes.tsx.zsif or anything you want and click Add File

Open newly created zsif file, write the code provided above as an example and save it.

Click blue generate button and see the output

Good to know: In daily programming, routing, object mapping, dependency injection and context management are sample concepts which for using a single code file.

Multiple entities to one code file