Skip to content

Commit ec9408c

Browse files
committed
docs: imrpve faq page
1 parent 63faa6f commit ec9408c

2 files changed

Lines changed: 38 additions & 32 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Project Overview
44

5-
VitePress documentation site for Textwire.
5+
VitePress documentation site for Textwire templating engine for Go programming language.
66

77
## Directory Structure
88

@@ -16,4 +16,8 @@ VitePress documentation site for Textwire.
1616
## Development
1717

1818
- No tests needed
19-
- Build: `npm run build`
19+
- Build: `npm run build` (only if you really need it because it's a slow process)
20+
21+
## Important
22+
23+
If you write inline code examples with `{{` and `}}` braces that Textwire uses, wrap them in <code v-pre></code> HTML tags instead. Intead of `{{ x = 5}}` Textwire example, you should write <code v-pre>{{ x = 5 }}</code>. It's because if you write it with backtics, Vue will execute them since `{{ }}` braces are also used in Vue.js.

docs/versions/v3/faq.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,58 @@
11
---
22
title: FAQ - v3
3-
description: Find answers to common questions and helpful tips in our FAQ section. Get quick solutions to common issues and learn more about our services
3+
description: Find answers to common questions about Textwire, a templating engine for Go
44
---
55

6-
# Frequently Asked Questions (FAQ)
6+
# Frequently Asked Questions
77

8-
Welcome to our FAQ page, where we address the most common questions and concerns about using Textwire. Whether you’re new to **Textwire** or a seasoned user, the FAQ is designed to provide quick and helpful answers to your most pressing queries.
8+
Find answers to common questions about Textwire. If you don't find what you're looking for, feel free to [open an issue on GitHub](https://github.com/textwire/textwire.github.io/issues/new).
99

10-
Here, you’ll find explanations, solutions to common problems, and best practices to make the most of your experience. If you don’t find the answer you’re looking for, feel free to reach out to us by creating an [issue on GitHub](https://github.com/textwire/textwire.github.io/issues/new) and we’ll be happy to help and update the FAQ with your question to help others.
10+
## What is Textwire?
1111

12-
## What Exactly is Textwire?
12+
Textwire is a templating engine for Go. You implement your business logic in Go and pass data to Textwire templates to generate dynamic content. It is designed to be fast, efficient, and easy to use.
1313

14-
Textwire is a templating engine for Go programming language. You do all of your business logic in Go and pass data to Textwire templates to generate dynamic content. It is designed to be fast, efficient, and easy to use.
15-
16-
- ✅ We're committed to performance optimization and better error handling
17-
- ✅ Our priority is keeping the language core solid and reliable
18-
- ❌ We steer clear of shiny features that would only add bloat
14+
- Committed to performance optimization and solid error handling
15+
- Focused on keeping the language core reliable
16+
- Avoids features that add unnecessary complexity
1917

2018
## How Does Textwire Parse Files?
2119

22-
Textwire has its own unique chain of turning your text files into final output. We do it in 4 steps:
20+
Textwire processes templates in four stages:
2321

24-
1. **Tokenizing** your Textwire template into tokens.
25-
2. **Parsing** turns tokens into [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) nodes.
26-
3. **Linking** connects related AST nodes to each other.
27-
4. **Evaluating** turns connected AST nodes into final text output.
22+
1. **Tokenizing** - Breaks the template into tokens
23+
2. **Parsing** - Converts tokens into [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) nodes
24+
3. **Linking** - Connects related AST nodes
25+
4. **Evaluating** - Generates the final text output
2826

29-
All non-Textwire-specific parts of the text file are treated as plain text and are not parsed as HTML, XML, or any other format. They remain unmodified in the final output, including whitespace preservation. Only Textwire-specific parts are processed:
27+
Non-Textwire content is treated as plain text and passes through unchanged, including whitespace. Only Textwire-specific syntax is processed:
3028

3129
```textwire
32-
<h1>Textwire seems cool</h1>
30+
<h1>Welcome</h1>
3331
{{ "Hello, World!".upper() }}
34-
<p>I would use it in production<p>
32+
<p>Ready for production</p>
3533
```
3634

37-
In the example above, only <code v-pre>{{ "Hello, World!".upper() }}</code> part will be evaluated. That's why Textwire is fast, as it only parses the parts that are necessary and leaves the rest as is.
35+
In the example above, only <code v-pre>{{ "Hello, World!".upper() }}</code> is evaluated. This selective parsing is what makes Textwire fast compared to other templating engines.
3836

39-
## Prevent Visitors from Seeing Error
37+
## Why Hide Error Output from Visitors?
4038

41-
When an error occurs in your function, the output may be incorrect or misleading. Displaying faulty output to users can result in confusing information, broken layouts, or unintentional exposure of sensitive data.
39+
When a function error occurs, the output may be incorrect or misleading. Displaying faulty output to users can result in:
4240

43-
Hiding incorrect output when errors occur ensures that visitors only see validated, correct content, maintaining both data integrity and user trust while preventing potential security risks.
41+
- Confusing information or broken layouts
42+
- Unintentional exposure of sensitive data
43+
- Security vulnerabilities
4444

45-
## The Difference Between Directives and Statements
45+
For example, a function might return partial or incorrect data due to a logic error or invalid input. Displaying this to visitors negatively impacts user experience and may reveal internal system details.
4646

47-
Directives and statements are the core of Textwire language. They are used to define the structure and behavior of your text files. However, there are some key differences between them:
47+
By hiding incorrect output when errors occur, you ensure visitors only see validated, correct content. This maintains data integrity, user trust, and prevents potential security risks.
4848

49-
- All directives are statements, but not all statements are directives
50-
- Directives start with the `@` symbol, while statements are a general term for parts of code that perform an action and do not return a value
49+
## Directives vs Statements
5150

52-
:::info Read More
53-
You can read about statements in the [Statements](/v3/language-elements/directives) section of the documentation.
54-
:::
51+
Directives and statements are fundamental elements of the Textwire language. Both define the structure and behavior of your templates, but they differ in form:
5552

56-
For example, `{{ x = 5 }}` is a statement that assigns the value `5` to the variable `x`. On the other hand, `@use('~main')` is a directive and a statement at the same time, as it includes the layout `main` in the current file and doesn't return a value.
53+
- **Directives** start with the `@` symbol (e.g., `@use`, `@if`, `@for`)
54+
- **Statements** are expressions that perform an action but don't return a value (e.g., <code v-pre>{{ x = 5 }}</code>)
55+
56+
:::info Learn More
57+
See the [Directives](/v3/language-elements/directives) section for a complete reference.
58+
:::

0 commit comments

Comments
 (0)