xref: /Universal-ctags/man/ctags-lang-iPythonCell.7.rst.in (revision e59379f6b8637683f232ef9c0f062fc4c671a87b)
168e000ffSMasatake YAMATO.. _ctags-lang-iPythonCell(7):
268e000ffSMasatake YAMATO
368e000ffSMasatake YAMATO==============================================================
468e000ffSMasatake YAMATOctags-lang-iPythonCell
568e000ffSMasatake YAMATO==============================================================
668e000ffSMasatake YAMATO-------------------------------------------------------------------
75f787c0bSMasatake YAMATOThe man page of the iPythonCell parser for Universal Ctags
868e000ffSMasatake YAMATO-------------------------------------------------------------------
968e000ffSMasatake YAMATO:Version: @VERSION@
1068e000ffSMasatake YAMATO:Manual group: Universal Ctags
1168e000ffSMasatake YAMATO:Manual section: 7
1268e000ffSMasatake YAMATO
1368e000ffSMasatake YAMATOSYNOPSIS
1468e000ffSMasatake YAMATO--------
15*e59379f6SMasatake YAMATO|	**@CTAGS_NAME_EXECUTABLE@** ... --extras=+{subparser} --languages=+iPythonCell,Python \\
1668e000ffSMasatake YAMATO|                     [--extras-IPythonCell=+{doubleSharps}] \\
1768e000ffSMasatake YAMATO|                     [--regex-IPythonCell=/<PATTERN>/\\n/c/] ...
1868e000ffSMasatake YAMATO
1968e000ffSMasatake YAMATODESCRIPTION
2068e000ffSMasatake YAMATO-----------
21*e59379f6SMasatake YAMATOiPythonCell parser is a subparser stacked on top of the Python parser.
2268e000ffSMasatake YAMATOIt works when:
2368e000ffSMasatake YAMATO
24*e59379f6SMasatake YAMATO* the Python parser is enabled,
25b51e7b0cSK.Takata* the ``subparser`` extra is enabled, and
265f787c0bSMasatake YAMATO* the iPythonCell parser itself is enabled.
2768e000ffSMasatake YAMATO
28*e59379f6SMasatake YAMATOThe iPythonCell parser extracts cells explained as in vim-ipython-cell
2968e000ffSMasatake YAMATO(https://github.com/hanschen/vim-ipython-cell/blob/master/README.md).
3068e000ffSMasatake YAMATO
3168e000ffSMasatake YAMATOKIND(S)
3268e000ffSMasatake YAMATO-------
335f787c0bSMasatake YAMATOThe iPythonCell parser defines only a ``cell`` kind.
3468e000ffSMasatake YAMATO
3568e000ffSMasatake YAMATOEXTRA(S)
3668e000ffSMasatake YAMATO--------
3768e000ffSMasatake YAMATO
3868e000ffSMasatake YAMATOTagging cells staring with ``##...`` is disabled by default because
395f787c0bSMasatake YAMATOthe pattern is too generic; with that pattern unwanted tags can be extracted.
4068e000ffSMasatake YAMATO
4168e000ffSMasatake YAMATOEnable ``doubleSharps`` language specific extra for tagging cells
4268e000ffSMasatake YAMATOstaring with ``##...``.
4368e000ffSMasatake YAMATO
4468e000ffSMasatake YAMATOCUSTOMIZING
4568e000ffSMasatake YAMATO-----------
465f787c0bSMasatake YAMATOIf your favorite cell pattern is not supported in the parser, you can
4768e000ffSMasatake YAMATOdefine the pattern in your ``.ctagd.d/your.ctags`` or command lines.
4868e000ffSMasatake YAMATOHere is an example how to support "``# CTAGS: ...``":
4968e000ffSMasatake YAMATO
5068e000ffSMasatake YAMATO"input.py"
5168e000ffSMasatake YAMATO
5268e000ffSMasatake YAMATO.. code-block:: Python
5368e000ffSMasatake YAMATO
5468e000ffSMasatake YAMATO	x=1
5568e000ffSMasatake YAMATO	# CTAGS: DEFINE F
5668e000ffSMasatake YAMATO	def F():
5768e000ffSMasatake YAMATO		# CTAGS: DO NOTING
5868e000ffSMasatake YAMATO		pass
5968e000ffSMasatake YAMATO
6068e000ffSMasatake YAMATO"output.tags"
6168e000ffSMasatake YAMATOwith "--options=NONE --sort=no --extras=+{subparser} --regex-IPythonCell=/[ \t]*# CTAGS:[ ]?(.*)$/\1/c/ -o - input.py"
6268e000ffSMasatake YAMATO
6368e000ffSMasatake YAMATO.. code-block:: tags
6468e000ffSMasatake YAMATO
6568e000ffSMasatake YAMATO   x	input.py	/^x=1$/;"	v
6668e000ffSMasatake YAMATO   DEFINE F	input.py	/^# CTAGS: DEFINE F$/;"	c
6768e000ffSMasatake YAMATO   F	input.py	/^def F():$/;"	f
6868e000ffSMasatake YAMATO   DO NOTING	input.py	/^	# CTAGS: DO NOTING$/;"	c
6968e000ffSMasatake YAMATO
705f787c0bSMasatake YAMATOYou can put "``--regex-IPythonCell=/[ \t]*# CTAGS:[ ]?(.*)$/\1/c/``" in ``your.ctags``
715f787c0bSMasatake YAMATOto avoid specifying the pattern repeatedly.
7268e000ffSMasatake YAMATO
7368e000ffSMasatake YAMATOSEE ALSO
7468e000ffSMasatake YAMATO--------
7568e000ffSMasatake YAMATOctags(1), ctags-client-tools(7), ctags-lang-python(7)
76