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.pyfile defines the core logic, including lists of Rust keywords, types, and macros, as well as actions for inserting code structures, operators, and comments. Therust.talonfile 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.talonfile defines the core Talon grammar for Lua, while thelua.pyimplements the actions, lists, and settings used by those commands. It also has astylua.talonfile 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.talonfile contains the Talon commands for working with Terraform code, whileterraform.pycontains 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.pyfile 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.talonfile defines voice commands for common SQL keywords and syntax, whilesql.pydefines 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.pyfile defines lists of common Python functions, keywords, and exceptions, as well as actions for inserting code structures, operators, and comments. Thepython.talonfile provides the voice commands and grammar for using these actions.scala: This directory contains the Talon files for programming in Scala. Thescala.pyfile defines the core functionality, including lists of Scala types and keywords, and actions for inserting code snippets. Thescala.talonfile 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.pyfile defines a Talon context and the list of protobuf types. Theproto.talonfile 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.pyfile defines actions for common PHP constructs like keywords, comments, operators, functions, and variables. Thephp.talonfile 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.pyfile defines the core logic for Stata code, while thestata.talonfile defines the voice commands that are used to insert Stata code.csharp: This directory provides support for the C# programming language. Thecsharp.pyfile defines actions for common C# coding tasks, such as inserting operators, keywords, control flow statements, and functions. Thecsharp.talonfile 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.pyfile defines lists of CSS units, at-rules, and global values, as well as some basic actions. Thecss.talonfile 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.pyfile that defines the actions and a corresponding.talonfile that defines the voice commands. For example, theoperators_math.pyandoperators_math.talonfiles enable the insertion of math operators using voice.html: This directory provides support for HTML, JavaScript React, and TypeScript React. Thehtml.talonfile 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.pyfile defines the context, lists of types and modifiers, and actions for inserting code snippets and operators. Thejava.talonfile 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.talonfile defines the core grammar for C, while thec.pyfile 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.pyfile defines the context, and thebatch.talonfile 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.talonfile defines the language tag and basic tags, and theruby.pyfile implements actions specific to Ruby code.elixir: This directory provides support for the Elixir programming language. Theelixir.pyfile defines the core functionality and actions, while theelixir.talonfile defines the voice commands and language features specific to Elixir.kotlin: This directory adds support for the Kotlin programming language. Thekotlin.talonfile defines the language tag and formatting rules, andkotlin.pydefines 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.talonfile defines the voice commands for inserting type annotations and other constructs, and thetypescript.pyfile 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.talonand.talon-listfiles. Thetalon.pyfile is the core, defining the logic and actions, while other files liketalon_common.talonandtalon_context.talondefine voice commands for inserting specific Talon constructs.javascript: This directory provides support for Javascript and Typescript development. Thejavascript.pyfile defines the core logic and actions for Javascript and Typescript, and thejavascript.talonfile provides the voice commands.vimscript: This directory contains files that add support for the Vimscript language. Thevimscript.pyfile defines the context, lists of functions and scopes, and actions for common tasks, while thevimscript.talonfile defines the voice commands.markdown: This directory provides support for the Markdown language in Talon. Themarkdown.talonfile defines a set of voice commands for common markdown syntax, whilemarkdown.pydefines 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.