lang
The community/lang
directory contains a collection of subdirectories, each dedicated to providing support for a specific programming language or markup language within Talon. Each subdirectory typically includes a .py
file for the core logic and a .talon
file for defining voice commands.
Here's a breakdown of the most important and interesting subdirectories:
rust
: This directory provides support for the Rust programming language. Therust.py
file defines the core logic, including lists of Rust keywords, types, and macros, as well as actions for inserting code structures, operators, and comments. Therust.talon
file defines the voice commands that trigger these actions. Together, they allow users to write Rust code more easily with voice.lua
: This directory provides support for the Lua programming language. Thelua.talon
file defines the core Talon grammar for Lua, while thelua.py
implements the actions, lists, and settings used by those commands. It also has astylua.talon
file to support the Stylua linter. These files enable voice control for writing Lua code with proper syntax and formatting.terraform
: This directory adds support for Terraform. Theterraform.talon
file contains the Talon commands for working with Terraform code, whileterraform.py
contains the Python implementation of the custom actions and lists used in the Talon file. This allows the user to insert Terraform blocks, properties, and operators using voice commands.r
: This directory provides support for the R programming language. Ther.py
file defines the core functionality for R support in Talon. The file includes lists of common R functions and libraries, and provides actions that are implemented by voice commands defined inr.talon
. The files work together to provide voice control for R development.sql
: This directory contains files to add support for SQL in Talon. Thesql.talon
file defines voice commands for common SQL keywords and syntax, whilesql.py
defines the context for SQL, and adds actions for inserting operators, functions, and null values. This enables the user to write SQL using voice commands.python
: This directory provides comprehensive support for Python development. Thepython.py
file defines lists of common Python functions, keywords, and exceptions, as well as actions for inserting code structures, operators, and comments. Thepython.talon
file provides the voice commands and grammar for using these actions.scala
: This directory contains the Talon files for programming in Scala. Thescala.py
file defines the core functionality, including lists of Scala types and keywords, and actions for inserting code snippets. Thescala.talon
file configures the tags, settings, and phrases used when programming in Scala, and defines some simple voice commands.proto
: This directory adds support for Protocol Buffer language in Talon. Theproto.py
file defines a Talon context and the list of protobuf types. Theproto.talon
file defines the voice commands for interacting with protobuf code, including commands for specifying types.php
: This directory provides support for the PHP programming language. Thephp.py
file defines actions for common PHP constructs like keywords, comments, operators, functions, and variables. Thephp.talon
file defines the Talon grammar and settings for PHP, including tags and formatting options.stata
: This directory contains the files that add Stata language support to Talon. Thestata.py
file defines the core logic for Stata code, while thestata.talon
file defines the voice commands that are used to insert Stata code.csharp
: This directory provides support for the C# programming language. Thecsharp.py
file defines actions for common C# coding tasks, such as inserting operators, keywords, control flow statements, and functions. Thecsharp.talon
file defines tags, settings, and some basic voice commands that activate functionality in the python file.css
: This directory contains the files to add CSS and SCSS support to Talon. Thecss.py
file defines lists of CSS units, at-rules, and global values, as well as some basic actions. Thecss.talon
file defines voice commands for inserting CSS properties, values, rules, and other syntax.tags
: This directory contains files that define tags, actions, and rules for various programming language constructs. The files in this directory are organized by concept, with each concept having a corresponding.py
file that defines the actions and a corresponding.talon
file that defines the voice commands. For example, theoperators_math.py
andoperators_math.talon
files enable the insertion of math operators using voice.html
: This directory provides support for HTML, JavaScript React, and TypeScript React. Thehtml.talon
file defines these three languages, indicating to Talon that files using these languages should be interpreted using the appropriate grammar.java
: This directory adds support for the Java programming language to Talon. Thejava.py
file defines the context, lists of types and modifiers, and actions for inserting code snippets and operators. Thejava.talon
file defines the voice commands for interacting with the code, and imports many tags from other locations.c
: This directory contains files that provide support for the C programming language. Thec.talon
file defines the core grammar for C, while thec.py
file contains the Python code that supports the grammar, including lists of C elements, captures, and actions.batch
: This directory adds support for the Batch scripting language. Thebatch.py
file defines the context, and thebatch.talon
file defines a set of voice commands for working with Batch files, including keywords, and a way to insert arguments.ruby
: This directory contains files that add support for the Ruby programming language. Theruby.talon
file defines the language tag and basic tags, and theruby.py
file implements actions specific to Ruby code.elixir
: This directory provides support for the Elixir programming language. Theelixir.py
file defines the core functionality and actions, while theelixir.talon
file defines the voice commands and language features specific to Elixir.kotlin
: This directory adds support for the Kotlin programming language. Thekotlin.talon
file defines the language tag and formatting rules, andkotlin.py
defines the core functionality of the module with many methods to insert specific code elements and operators.typescript
: This directory contains files that add support for the TypeScript language. Thetypescript.talon
file defines the voice commands for inserting type annotations and other constructs, and thetypescript.py
file defines the context, list of types, and actions.talon
: This directory provides extensions for editing and creating Talon code. It defines actions, lists, tags, and commands that aid in writing both.talon
and.talon-list
files. Thetalon.py
file is the core, defining the logic and actions, while other files liketalon_common.talon
andtalon_context.talon
define voice commands for inserting specific Talon constructs.javascript
: This directory provides support for Javascript and Typescript development. Thejavascript.py
file defines the core logic and actions for Javascript and Typescript, and thejavascript.talon
file provides the voice commands.vimscript
: This directory contains files that add support for the Vimscript language. Thevimscript.py
file defines the context, lists of functions and scopes, and actions for common tasks, while thevimscript.talon
file defines the voice commands.markdown
: This directory provides support for the Markdown language in Talon. Themarkdown.talon
file defines a set of voice commands for common markdown syntax, whilemarkdown.py
defines the context and list of supported languages for code blocks.
These subdirectories showcase a wide range of language support, and a consistent pattern of using a Python file for the logic and a Talon file for voice commands. The tags
directory provides a reusable set of rules that can be included in other language modules, making it easier to extend the functionality of Talon with voice commands for different languages.