CTAGS-LANG-IPYTHONCELL(7)

πŸ“¦
version 6.2.1 Β· 6 versions
, in alpine 3.24, fedora 43, fedora 44

πŸŽ€ NAME πŸŽ€

ctags-lang-iPythonCell β€” the man page of the iPythonCell parser for Universal Ctags. Yep bestie, you're reading CTAGS-LANG-IPYTHONCELL(7), section 7, and it's literally all about teaching ctags to see your Jupyter-style cells. πŸ’…


✨ SYNOPSIS ✨

ctags ... --extras=+{subparser} --languages=+iPythonCell,Python \
  [--extras-IPythonCell=+{doubleSharps}] \
  [--regex-IPythonCell=/<PATTERN>/\n/c/] ...

🌸 DESCRIPTION 🌸

The iPythonCell parser is a subparser β€” like, it doesn't stand on its own, it's stacked on top of the Python parser. Main character supporting role, yk? It only does its thing when all three of these are true:

  • the Python parser is enabled,
  • the subparser extra is enabled, and
  • the iPythonCell parser itself is enabled.

Once that vibe check passes, the iPythonCell parser extracts cells, explained the way vim-ipython-cell explains them (https://github.com/hanschen/vim-ipython-cell/blob/master/README.md). Obsessed. πŸ¦‹


πŸ‘‘ KIND(S) πŸ‘‘

The iPythonCell parser defines only a cell kind. That's it. One kind. Simple, elegant, no notes. ✨


πŸ’– EXTRA(S) πŸ’–

Tagging cells that start with ##... is disabled by default β€” not because it's bad, but because that pattern is too generic, and with a pattern that loose you can end up extracting unwanted tags. πŸ™ˆ

So if you want it, enable the doubleSharps language specific extra to tag cells starting with ##.... You opt in, it doesn't opt you in. Periodt.


🧚 CUSTOMIZING 🧚

If your favorite cell pattern isn't supported by the parser, no worries bestie β€” you can define the pattern yourself in your .ctagd.d/your.ctags or right on the command lines. Here's an example of how to support # CTAGS: ...:

"input.py"

x=1
# CTAGS: DEFINE F
def F():
    # CTAGS: DO NOTING
    pass

"output.tags" with "--options=NONE --sort=no --extras=+{subparser} --regex-IPythonCell=/[ t]*# CTAGS:[ ]?(.*)$/1/c/ -o - input.py"

x    input.py        /^x=1$/;"       v
DEFINE F     input.py        /^# CTAGS: DEFINE F$/;" c
F    input.py        /^def F():$/;"  f
DO NOTING    input.py        /^      # CTAGS: DO NOTING$/;"  c

And if you're tired of typing that pattern over and over (relatable), you can just put "--regex-IPythonCell=/[ \t]*# CTAGS:[ ]?(.*)$/\1/c/" in your.ctags and never think about it again. πŸ’…


🌈 SEE ALSO 🌈

ctags(1), ctags-client-tools(7), ctags-lang-python(7)


okay that's the whole page, you ate that 🫢 this was CTAGS-LANG-IPYTHONCELL(7) from Universal Ctags, version 6.2.1 β€” go tag some cells, bestie, you've got this πŸ’–βœ¨

πŸ“¦ where this page comes from