Skip to content

Commit

Permalink
Don't require IDL directories to start with 'v'
Browse files Browse the repository at this point in the history
For doc generation, don't assume IDL dirs start with 'v'.

They may be "version" directories, or any other way users want to group
their protocol definitions.
  • Loading branch information
ajfabbri committed Dec 5, 2024
1 parent 8581850 commit fc9a605
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions interface_gen/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ def __init__(self, input_path: Path, gen_path: Path):

def _enumerate(self):
self.versions: list[Version] = []
version_dirs = self.root_path.glob("v*")
version_dirs = self.root_path.glob("*")
for vdir in version_dirs:
vname = vdir.name[1:] # strip leading 'v'
avdl_files = vdir.glob("*.avdl")
protos = []
for avdl in avdl_files:
protocol = Protocol.from_avdl(avdl, self.gen_path)
protos.append(protocol)
self.versions.append(Version(vname, vdir, protos))
v = Version(vdir.name, vdir, protos)
self.versions.append(v)

def generate_index(self, output_dir: Path):
index_path = output_dir / "index.md"
Expand Down

0 comments on commit fc9a605

Please sign in to comment.