Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c8ada8f
visualizing meter
recursivepaws May 21, 2026
cb6e86b
more experimentation with chandas
recursivepaws May 21, 2026
0d4906c
unified grid
recursivepaws May 21, 2026
8fd8d3a
update layout for labels and meter
recursivepaws May 21, 2026
4b39143
Merge branch 'main' into vidyut
recursivepaws May 21, 2026
fb402fe
updating tester to show more things vidyut can do
recursivepaws May 23, 2026
ebb6de1
reorganize around chandas in introduction
recursivepaws May 24, 2026
1b4b74b
transform
recursivepaws May 24, 2026
f1bd98a
thing1thing2
recursivepaws May 25, 2026
8fdcbe2
cleaning?
recursivepaws May 25, 2026
e26ce7f
fix gutter
recursivepaws May 25, 2026
a8b09d2
cleanup
recursivepaws May 25, 2026
ed066f3
scale using rectclip
recursivepaws May 25, 2026
e6ef453
duration
recursivepaws May 25, 2026
5f6928c
skrutable
recursivepaws May 25, 2026
a5929fa
meow
recursivepaws May 25, 2026
afda881
reorganize
recursivepaws May 25, 2026
28adf8f
corner trickery
recursivepaws May 25, 2026
0400c16
experimenting
recursivepaws May 25, 2026
46cd6e8
virtual insanity!
recursivepaws May 25, 2026
c104cca
experimenting
recursivepaws May 25, 2026
ef8d055
include embedded fonts
recursivepaws May 25, 2026
cfb75c6
transformableframeclip quadrant demo
recursivepaws May 25, 2026
236617d
fix demo
recursivepaws May 25, 2026
b392d9d
remove vidyut
recursivepaws May 25, 2026
97ee06c
transform clips
recursivepaws May 25, 2026
fa4c2bc
more subtimelines
recursivepaws May 26, 2026
eeaf3a9
simplify logic + add borders
recursivepaws May 26, 2026
bc231c9
visualizing longer chandas
recursivepaws May 27, 2026
085eab0
aliases in flake for direnv
recursivepaws May 28, 2026
74bf0b3
quadrants timeline
recursivepaws May 28, 2026
2bac1c7
explain sloka
recursivepaws May 28, 2026
a9a2065
fix subtle bug in english gloss searching
recursivepaws May 28, 2026
f72978a
birthday.sloka
recursivepaws May 28, 2026
7ec4ecb
make quad reusable
recursivepaws May 28, 2026
f76a02b
add scale arg to quads
recursivepaws May 28, 2026
49da8ac
replace vertical grid with linebreaks
recursivepaws May 28, 2026
12707b6
turn off caching for now
recursivepaws May 28, 2026
2cabeb8
add `first` and `last` fields to quads
recursivepaws May 28, 2026
5d6d007
auto-resizing chandas font for frame width
recursivepaws May 28, 2026
2d5cc16
prevent chandas from overscaling
recursivepaws May 28, 2026
931b05e
removing `scale`
recursivepaws May 28, 2026
2bdecd5
ratios
recursivepaws May 28, 2026
39f3dd8
ratios
recursivepaws May 28, 2026
a818ff7
missing sloka marker in stotram
recursivepaws May 28, 2026
ac1265c
added syntax sugar and sandhi validation
recursivepaws May 29, 2026
d3a4404
validation script
recursivepaws May 29, 2026
230aa92
validating sutra
recursivepaws May 29, 2026
d2dbbd6
experimenting with multiwordsandhichecking
recursivepaws May 29, 2026
271a301
fix alignment fix wrap
recursivepaws May 29, 2026
2e3ee3f
ignore initial `oM` in meter identification
recursivepaws May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ videos
__pycache__
.devenv
.cache
vidyut_data
102 changes: 102 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# from janim.imports import *

from janim.imports import (
BLACK,
RED,
UP,
WHITE,
Axes,
Config,
Create,
Dot,
Group,
ItemUpdater,
Rect,
Timeline,
TransformableFrameClip,
TypstMath,
)
import nirukta.patches # pyright: ignore[reportUnusedImport] # noqa: F401

import math


class GraphDemonstration(Timeline):
def __init__(self, f, x_range, typ_code):
super().__init__()
self.f = f
self.x_range = x_range
self.typ_code = typ_code

def construct(self):
axes = Axes(axis_config=dict(include_numbers=True))
graph = axes.get_graph(self.f, self.x_range, color=RED, stroke_radius=0.05)

typ = TypstMath(
self.typ_code, stroke_color=BLACK, stroke_alpha=1, stroke_background=True
).show()
typ.points.scale(1.6).to_border(UP)

def dots_updater(p):
points = graph.current().points
return Group(
Dot(points.get_start()),
Dot(points.get_end()),
fill_color=BLACK,
stroke_alpha=1,
)

self.forward()
self.play(Create(axes, lag_ratio=0.05))
self.play(
Create(graph),
ItemUpdater(None, dots_updater),
)


class MainTimeline(Timeline):
def construct(self):
params_list = [
(lambda x: x**2, (-1, 1.5), "f(x) = x^2"),
(lambda x: x**3, (-1.5, 1.5), "f(x) = x^3"),
(lambda x: math.sin(x), (-3, 3), "f(x) = sin(x)"),
(lambda x: math.atan(x), (-2, 2), "f(x) = tan^(-1) x"),
]

cols, rows = 2, 2
fw = Config.get.frame_width
fh = Config.get.frame_height
quad_w = fw / cols
quad_h = fh / rows

# clip 1/4 from each side → each quadrant shows the central 1/2 × 1/2
clip_h = 0.5 - 1 / (2 * cols) # 0.25
clip_v = 0.5 - 1 / (2 * rows) # 0.25

for idx, params in enumerate(params_list):
col = idx % cols
row = idx // cols

offset_x = -clip_h + col * (1 / cols) # -0.25 or +0.25
offset_y = clip_v - row * (1 / rows) # 0.25 or -0.25

tl = (
GraphDemonstration(*params).build().to_item(keep_last_frame=True).show()
)
TransformableFrameClip(
tl,
# clip=(clip_h, clip_v, clip_h, clip_v),
offset=(offset_x, offset_y),
scale=0.5,
).show()

center = (
(col + 0.5 - 1.0) * quad_w,
(1.0 - row - 0.5) * quad_h,
0,
)
border = Rect(quad_w, quad_h, color=WHITE, stroke_radius=0.03)
border.points.move_to(center)
border.show()

self.forward(4)
74 changes: 46 additions & 28 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
description = "Dev shell for JAnim + PySide6 on Wayland";
description = "Dev shell for JAnim PySide6 on Wayland";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
Expand All @@ -16,42 +16,60 @@
system:
let
pkgs = import nixpkgs { inherit system; };

# Function to create script
mkScript =
name: text:
let
script = pkgs.writeShellScriptBin name text;
in
script;

# Define your scripts/aliases
scripts = [
(mkScript "janim" ''uv run janim "$@"'')
(mkScript "nirukta" ''janim run main.py "$@"'')
(mkScript "nvim" ''uv run ${pkgs.neovim}/bin/nvim "$@"'')
];
# Packages that need to be included in the runtime path
runtimeLibs = with pkgs; [
python313
runtimeLibs =
with pkgs;
[
python313

zstd
zlib
zstd
zlib

# OpenGL
mesa
libGL
libGLU
glib
fontconfig
# OpenGL
mesa
libGL
libGLU
glib
fontconfig

# Keymap handling
libxkbcommon
# Keymap handling
libxkbcommon

# X11 (still needed even on Wayland for XWayland fallback)
libx11
libxext
libxcb
# X11 (still needed even on Wayland for XWayland fallback)
libx11
libxext
libxcb

# Wayland
wayland
wayland-protocols
# Wayland
wayland
wayland-protocols

# Audio
alsa-lib
# Audio
alsa-lib

# Fonts / display
freetype
# Fonts / display
freetype

# System
dbus
stdenv.cc.cc.lib
];
# System
dbus
stdenv.cc.cc.lib
]
++ scripts;
in
{
devShells.default = pkgs.mkShell {
Expand Down
15 changes: 15 additions & 0 deletions library/birthday.sloka
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
=== sloka ===

--- line ---
amBojam[the day lotus]+iva[like]=amBojamiva
(puzpARAm[among flowers]+amftam[nectar]=puzpARAmamftam)=puzpARAmamftaM
Bojanezu[among foods]+iva[like]=Bojanezviva .
"like the day lotus among flowers,"
"like nectar among foods,"

--- line ---
sUryaH[the sun]=sUryo
jyotir[heavenly bodies]+gaRasya[among all]+iva[like]=jyotirgaRasyeva
taTA[likewise]+eva[indeed]=taTEva te[your] saKitvanam[friendship] ..
"like the sun among all the heavenly bodies,"
"likewise indeed is your friendship."
9 changes: 9 additions & 0 deletions library/external.sloka
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=== sloka ===

--- line ---
(aRu[atomic]+rUpa[form]=aRurUpa)=aRurUpam
"atomic form!"

--- line ---
aRu[atomic]+rUpa[form]=aRurUpa>>aRurUpam>>aRurUpaM
"atomic form!"
18 changes: 18 additions & 0 deletions library/guru_gIta.sloka
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
=== sloka ===


--- line ---
brahmAnandaM[x] paramasuKadaM kevalaM jYAnamUrtiM
"x"

--- line ---
dvandvAtItaM[x] gaganadadfSaM tattvamasyAdilakzyam .
"x"

--- line ---
ekaM[x] nityaM vimalamacalaM sarvaDIsAkziBUtaM
"x"

--- line ---
BAvAtItaM[x] triguRarahitaM sadguruM taM namAmi ..
"x"
Loading