Skip to content

Commit

Permalink
fix(docs): a small list of housekeeping updates and visual improvemen…
Browse files Browse the repository at this point in the history
…ts (#916)

* fix: work breaks in inline code items in tables

* fix: patch of highlighing from tact-sublime 1.5.1 and 1.5.2 releases

* feat: `description` property in frontmatters for SEO

And fix of Chinese translations for the sidebar separator items
  • Loading branch information
novusnota authored Oct 7, 2024
1 parent 9af35e6 commit 84b62d8
Show file tree
Hide file tree
Showing 80 changed files with 203 additions and 115 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `&&=`, `||=`, `>>=` and `<<=` augmented assignment operators: PR [#853](https://github.com/tact-lang/tact/pull/853)
- New CSpell dictionaries: TVM instructions and adjusted list of Fift words: PR [#881](https://github.com/tact-lang/tact/pull/881)
- Docs: the `description` property to the frontmatter of the each page for better SEO: PR [#916](https://github.com/tact-lang/tact/pull/916)

### Changed

Expand All @@ -19,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Collisions in getter method ids are now handled and reported properly: PR [#875](https://github.com/tact-lang/tact/pull/875)
- Docs: layout of tables, syntax highlighting, Chinese translations of sidebar separators: PR [#916](https://github.com/tact-lang/tact/pull/916)

### Release contributors

Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"funcfiftlib",
"funcid",
"funs",
"frontmatter",
"Georgiy",
"gettest",
"Héctor",
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<img src="public/banner.jpeg">
<img src="public/banner.jpg">

# Welcome to ⚡ Tact Documentation

Expand Down
186 changes: 93 additions & 93 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ export default defineConfig({
starlight({
title: {
en: '⚡ Tact Documentation',
'zh-CN': '⚡ Tact Documentation',
'zh-CN': '⚡ Tact 语言文档',
},
titleDelimiter: '-',
titleDelimiter: undefined,
favicon: '/favicon.png',
logo: {
dark: '/public/logo-dark.svg',
light: '/public/logo-light.svg',
alt: '⚡ Tact Documentation',
replacesTitle: true,
},
// 'head' is auto-populated with SEO-friendly contents
// 'head' is auto-populated with SEO-friendly contents based on the page frontmatters
social: {
github: 'https://github.com/tact-lang/tact',
telegram: 'https://t.me/tactlang',
Expand Down Expand Up @@ -113,7 +113,7 @@ export default defineConfig({
'zh-CN': '图书',
},
items: [
'book',
{ slug: 'book' },
{
label: 'Cheatsheets',
translations: {
Expand All @@ -123,52 +123,52 @@ export default defineConfig({
autogenerate: { directory: 'book/cs' },
},
{
label: 'Fundamentals of Tact',
translations: { 'zn-CN': 'Tact 语言基础' },
link: '#', attrs: { class: 'sidebar-separator' }
label: 'Fundamentals of Tact',
translations: { 'zh-CN': 'Tact 语言基础' },
link: '#', attrs: { class: 'sidebar-separator' }
},
'book/types',
'book/integers',
'book/cells',
'book/maps',
'book/structs-and-messages',
'book/optionals',
'book/contracts',
'book/exit-codes',
{ slug: 'book/types' },
{ slug: 'book/integers' },
{ slug: 'book/cells' },
{ slug: 'book/maps' },
{ slug: 'book/structs-and-messages' },
{ slug: 'book/optionals' },
{ slug: 'book/contracts' },
{ slug: 'book/exit-codes' },
{
label: 'Expressiveness',
translations: { 'zn-CN': '表现力' },
link: '#', attrs: { class: 'sidebar-separator' }
label: 'Expressiveness',
translations: { 'zh-CN': '表现力' },
link: '#', attrs: { class: 'sidebar-separator' }
},
'book/operators',
'book/expressions',
'book/statements',
'book/constants',
'book/functions',
{ slug: 'book/operators' },
{ slug: 'book/expressions' },
{ slug: 'book/statements' },
{ slug: 'book/constants' },
{ slug: 'book/functions' },
{
label: 'Communication',
translations: { 'zn-CN': '交流' },
link: '#', attrs: { class: 'sidebar-separator' }
label: 'Communication',
translations: { 'zh-CN': '交流' },
link: '#', attrs: { class: 'sidebar-separator' }
},
'book/receive',
'book/bounced',
'book/external',
'book/lifecycle',
'book/send',
'book/message-mode',
{ slug: 'book/receive' },
{ slug: 'book/bounced' },
{ slug: 'book/external' },
{ slug: 'book/lifecycle' },
{ slug: 'book/send' },
{ slug: 'book/message-mode' },
{
label: 'Going places',
translations: { 'zn-CN': '前往各地' },
link: '#', attrs: { class: 'sidebar-separator' }
label: 'Going places',
translations: { 'zh-CN': '前往各地' },
link: '#', attrs: { class: 'sidebar-separator' }
},
'book/deploy',
'book/debug',
'book/upgrades',
'book/import',
'book/config',
'book/masterchain',
'book/func',
'book/programmatic',
{ slug: 'book/deploy' },
{ slug: 'book/debug' },
{ slug: 'book/upgrades' },
{ slug: 'book/import' },
{ slug: 'book/config' },
{ slug: 'book/masterchain' },
{ slug: 'book/func' },
{ slug: 'book/programmatic' },
],
},
{
Expand All @@ -177,28 +177,28 @@ export default defineConfig({
'zh-CN': '食谱',
},
items: [
'cookbook',
{ slug: 'cookbook' },
{
label: 'Single contract',
translations: { 'zn-CN': '单一合同' },
link: '#', attrs: { class: 'sidebar-separator' }
label: 'Single contract',
translations: { 'zh-CN': '单一合同' },
link: '#', attrs: { class: 'sidebar-separator' }
},
'cookbook/single-communication',
'cookbook/type-conversion',
'cookbook/data-structures',
'cookbook/algo',
'cookbook/time',
'cookbook/access',
'cookbook/random',
'cookbook/misc',
{ slug: 'cookbook/single-communication' },
{ slug: 'cookbook/type-conversion' },
{ slug: 'cookbook/data-structures' },
{ slug: 'cookbook/algo' },
{ slug: 'cookbook/time' },
{ slug: 'cookbook/access' },
{ slug: 'cookbook/random' },
{ slug: 'cookbook/misc' },
{
label: 'Multiple contracts',
translations: { 'zn-CN': '多重合同' },
link: '#', attrs: { class: 'sidebar-separator' }
label: 'Multiple contracts',
translations: { 'zh-CN': '多重合同' },
link: '#', attrs: { class: 'sidebar-separator' }
},
'cookbook/multi-communication',
'cookbook/jettons',
'cookbook/nfts',
{ slug: 'cookbook/multi-communication' },
{ slug: 'cookbook/jettons' },
{ slug: 'cookbook/nfts' },
{
label: 'Decentralized EXchanges (DEXes)',
translations: {
Expand All @@ -215,8 +215,8 @@ export default defineConfig({
'zh-CN': '参考',
},
items: [
'ref',
'ref/spec',
{ slug: 'ref' },
{ slug: 'ref/spec' },
{
'label': 'Evolution',
translations: {
Expand All @@ -226,31 +226,31 @@ export default defineConfig({
autogenerate: { directory: 'ref/evolution' }
},
{
label: 'Core library',
translations: { 'zn-CN': '核心图书馆' },
link: '#', attrs: { class: 'sidebar-separator' }
label: 'Core library',
translations: { 'zh-CN': '核心图书馆' },
link: '#', attrs: { class: 'sidebar-separator' }
},
'ref/core-base',
'ref/core-common',
'ref/core-comptime',
'ref/core-debug',
'ref/core-random',
'ref/core-math',
'ref/core-strings',
'ref/core-cells',
'ref/core-advanced',
{ slug: 'ref/core-base' },
{ slug: 'ref/core-common' },
{ slug: 'ref/core-comptime' },
{ slug: 'ref/core-debug' },
{ slug: 'ref/core-random' },
{ slug: 'ref/core-math' },
{ slug: 'ref/core-strings' },
{ slug: 'ref/core-cells' },
{ slug: 'ref/core-advanced' },
{
label: 'Standard libraries',
translations: { 'zn-CN': '标准图书馆' },
link: '#', attrs: { class: 'sidebar-separator' }
label: 'Standard libraries',
translations: { 'zh-CN': '标准图书馆' },
link: '#', attrs: { class: 'sidebar-separator' }
},
'ref/standard-libraries',
'ref/stdlib-config',
'ref/stdlib-content',
'ref/stdlib-deploy',
'ref/stdlib-dns',
'ref/stdlib-ownable',
'ref/stdlib-stoppable',
{ slug: 'ref/standard-libraries' },
{ slug: 'ref/stdlib-config' },
{ slug: 'ref/stdlib-content' },
{ slug: 'ref/stdlib-deploy' },
{ slug: 'ref/stdlib-dns' },
{ slug: 'ref/stdlib-ownable' },
{ slug: 'ref/stdlib-stoppable' },
],
},
{
Expand All @@ -259,16 +259,16 @@ export default defineConfig({
'zh-CN': '生态系统',
},
items: [
'ecosystem',
{ slug: 'ecosystem' },
{
label: 'Tools',
translations: { 'zn-CN': '工具' },
link: '#', attrs: { class: 'sidebar-separator' }
label: 'Tools',
translations: { 'zh-CN': '工具' },
link: '#', attrs: { class: 'sidebar-separator' }
},
'ecosystem/typescript',
'ecosystem/vscode',
'ecosystem/jetbrains',
'ecosystem/misti',
{ slug: 'ecosystem/typescript' },
{ slug: 'ecosystem/vscode' },
{ slug: 'ecosystem/jetbrains' },
{ slug: 'ecosystem/misti' },
],
},
{
Expand Down
8 changes: 7 additions & 1 deletion docs/grammars/grammar-tact.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@
"name": "keyword.operator.mapsto.tact"
},
{
"match": "\\b([0-9]*)\\b",
"comment": "Decimal integer WITH leading zero",
"match": "\\b(0[0-9]*)\\b",
"name": "constant.numeric.decimal.tact"
},
{
"comment": "Decimal integer WITHOUT leading zero",
"match": "\\b([1-9](?:_?[0-9])*)\\b",
"name": "constant.numeric.decimal.tact"
}
],
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/book/bounced.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Bounced messages
description: "When a contract sends a message with a flag bounce set to true, then if the message wasn't processed properly, it would bounce back to the sender"
---

When a contract sends a message with a flag `bounce` set to `true{:tact}`, then if the message wasn't processed properly, it would bounce back to the sender. This is useful when you want to make sure that the message was processed properly and if not — revert the changes.
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/book/cells.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Cells, Builders and Slices
description: "Cells, Builders and Slices are low-level primitives of TON Blockchain"
---

[Cells](#cells), [Builders](#builders) and [Slices](#slices) are low-level [primitives][p] of TON Blockchain. The virtual machine of TON Blockchain, [TVM][tvm], uses cells to represent all data structures in persistent storage, and most in memory.
Expand Down
3 changes: 2 additions & 1 deletion docs/src/content/docs/book/config.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: Configuration
description: "The behavior of Tact compiler can be customized using its configuration file"
---

The behavior of Tact compiler can be customized using its configuration file, `tact.config.json` — a JSON file that contains the list of settings according to the specific [schema](#schema).

This page lists all of the configuration options as they're structured in the [schema](#schema). Look for table of contents on the right to easily navigate them.
This page lists all the configuration options as they're structured in the [schema](#schema). Look for table of contents on the right to easily navigate them.

:::note

Expand Down
3 changes: 2 additions & 1 deletion docs/src/content/docs/book/constants.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: Constants
description: "Immutable values that cannot be changed through reassignment"
---

Constants in Tact could be a little bit more advanced than in popular languages: they could be virtual and abstract. Smart contracts often need to implement multiple traits and sometimes you need to configure some of them in compile time. Constructors in traits are prohibited due to their unpredicted behavior. So, we have to use constants and fields instead to pass values to them. It is the job of a main contract to implement values and constants for all traits.
Constants in Tact could be a little bit more advanced than in popular languages: they could be virtual and abstract. Smart contracts often need to implement multiple traits and sometimes you need to configure some of them in compile time. Constructors in traits are prohibited due to their unpredictable behavior. So, we have to use constants and fields instead to pass values to them. It is the job of a main contract to implement values and constants for all traits.

## Simple constant

Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/book/contracts.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Contracts
description: "Contracts in Tact are similar to classes in popular object-oriented languages, except that their instances are deployed on the blockchain and they can't be passed around like Structs and Messages"
---

Contracts in Tact are similar to classes in popular object-oriented languages, except that their instances are deployed on the blockchain and they can't be passed around like [Structs and Messages](/book/structs-and-messages).
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/book/cs/from-func.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Coming from FunC
description: "A cheat sheet to quickly transition from FunC to Tact"
sidebar:
order: 1
---
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/book/cs/from-solidity.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Coming from Solidity
description: "A cheat sheet to quickly transition from Solidity to Tact and from Ethereum to TON Blockchain"
sidebar:
order: 2
---
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/book/debug.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Debugging Tact contracts
description: "Various ways to reveal problems or bugs in Tact code"
---

import { LinkCard, CardGrid, Steps, Tabs, TabItem } from '@astrojs/starlight/components';
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/book/deploy.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Deployment
description: "Common ways to deploy Tact contracts to testnet or mainnet of TON Blockchain"
---

Tact Deployer is a small library that integrates with [TON Verifier](https://verifier.ton.org) that allows you to deploy your contracts safely using your favorite wallet without needing to manage keys or deploy contracts manually. Tact Deployer also automatically verifies your contract's source code and you can be sure that your compiler is not compromised.
Expand Down
3 changes: 2 additions & 1 deletion docs/src/content/docs/book/exit-codes.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Exit Codes
title: Exit codes
description: "An exit code is a 32-bit signed integer, which indicates whether the compute or action phase of the transaction was successful, and if not — signals the code of the exception occurred"
---

:::caution
Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/book/expressions.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Expressions
description: "This page lists all the expressions in Tact"
---

Every operator in Tact forms an expression, but there's much more to uncover as Tact offers a wide range of expressive options to choose from.
Expand Down
Loading

0 comments on commit 84b62d8

Please sign in to comment.