Skip to content

Commit

Permalink
docs(man): add a page for Terraform parser
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <[email protected]>
  • Loading branch information
masatake committed Apr 1, 2023
1 parent 9a37a64 commit 9a23f87
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/man-pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Man pages
ctags-lang-sql(7) <man/ctags-lang-sql.7.rst>
ctags-lang-systemtap(7) <man/ctags-lang-systemtap.7.rst>
ctags-lang-tcl(7) <man/ctags-lang-tcl.7.rst>
ctags-lang-terraform(7) <man/ctags-lang-terraform.7.rst>
ctags-lang-verilog(7) <man/ctags-lang-verilog.7.rst>

readtags(1) <man/readtags.1.rst>
47 changes: 47 additions & 0 deletions docs/man/ctags-lang-terraform.7.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. _ctags-lang-terraform(7):

==============================================================
ctags-lang-terraform
==============================================================

Random notes about tagging Terraform files with Universal Ctags

:Version: 6.0.0
:Manual group: Universal Ctags
:Manual section: 7

SYNOPSIS
--------
| **ctags** ... --languages=+Terraform ...
| **ctags** ... --language-force=Terraform ...
| **ctags** ... --map-Terraform=+.tf ...
|
| **ctags** ... --extras=+{reference} --languages=+TerraformVariables ...
| **ctags** ... --extras=+{reference} --language-force=TerraformVariables ...
| **ctags** ... --extras=+{reference} --map-Terraform=+.tfvars ...
DESCRIPTION
-----------
This man page gathers random notes about tagging Terraform files.

TIPS
-----------

Extracting variables assigned in Variable definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specify ``--extras=+{reference}`` and ``--languages=+TerraformVariables``
to extract variables assigned in variables definitions (`*.tfvars`).
The TerraformVariables parser extracts variables in `*.tfvars` files
with ``variable`` kind with ``assigned`` role of ``Terraform`` language.

KNOWN BUGS
----------
* The parser doesn't ignore strings inside a block comment (``/* ... */``).

* The parser doesn't extract variables defined with ``locals`` keyword.

SEE ALSO
--------
:ref:`ctags(1) <ctags(1)>`,
`Configuration Syntax <https://developer.hashicorp.com/terraform/language/syntax/configuration>`_ (https://developer.hashicorp.com/terraform/language/syntax/configuration),
`Variable Definitions (.tfvars) Files <https://developer.hashicorp.com/terraform/language/values/variables#variable-definitions-tfvars-files>`_ (https://developer.hashicorp.com/terraform/language/values/variables#variable-definitions-tfvars-files)
1 change: 1 addition & 0 deletions man/GNUmakefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ GEN_IN_MAN_FILES = \
ctags-lang-sql.7 \
ctags-lang-systemtap.7 \
ctags-lang-tcl.7 \
ctags-lang-terraform.7 \
ctags-lang-verilog.7 \
\
readtags.1 \
Expand Down
47 changes: 47 additions & 0 deletions man/ctags-lang-terraform.7.rst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. _ctags-lang-terraform(7):

==============================================================
ctags-lang-terraform
==============================================================
---------------------------------------------------------------------
Random notes about tagging Terraform files with Universal Ctags
---------------------------------------------------------------------
:Version: @VERSION@
:Manual group: Universal Ctags
:Manual section: 7

SYNOPSIS
--------
| **@CTAGS_NAME_EXECUTABLE@** ... --languages=+Terraform ...
| **@CTAGS_NAME_EXECUTABLE@** ... --language-force=Terraform ...
| **@CTAGS_NAME_EXECUTABLE@** ... --map-Terraform=+.tf ...
|
| **@CTAGS_NAME_EXECUTABLE@** ... --extras=+{reference} --languages=+TerraformVariables ...
| **@CTAGS_NAME_EXECUTABLE@** ... --extras=+{reference} --language-force=TerraformVariables ...
| **@CTAGS_NAME_EXECUTABLE@** ... --extras=+{reference} --map-Terraform=+.tfvars ...

DESCRIPTION
-----------
This man page gathers random notes about tagging Terraform files.

TIPS
-----------

Extracting variables assigned in Variable definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specify ``--extras=+{reference}`` and ``--languages=+TerraformVariables``
to extract variables assigned in variables definitions (`*.tfvars`).
The TerraformVariables parser extracts variables in `*.tfvars` files
with ``variable`` kind with ``assigned`` role of ``Terraform`` language.

KNOWN BUGS
----------
* The parser doesn't ignore strings inside a block comment (``/* ... */``).

* The parser doesn't extract variables defined with ``locals`` keyword.

SEE ALSO
--------
ctags(1),
`Configuration Syntax <https://developer.hashicorp.com/terraform/language/syntax/configuration>`_ (https://developer.hashicorp.com/terraform/language/syntax/configuration),
`Variable Definitions (.tfvars) Files <https://developer.hashicorp.com/terraform/language/values/variables#variable-definitions-tfvars-files>`_ (https://developer.hashicorp.com/terraform/language/values/variables#variable-definitions-tfvars-files)

0 comments on commit 9a23f87

Please sign in to comment.