Skip to content

Commit

Permalink
Add API docs of Histogram after the generation step
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh-cpp committed Jan 18, 2024
1 parent 59467b9 commit d2eb812
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
import shutil
from pathlib import Path

import nox

Expand Down Expand Up @@ -99,6 +100,20 @@ def build_api_docs(session: nox.Session) -> None:
"../src/boost_histogram",
)

# add API docs of boost_histogram._internal.hist.Histogram after
# the generation step
with Path("api/boost_histogram.rst").open("r+") as f:
lines = f.readlines()
for i in range(len(lines)):
if lines[i] == ".. automodule:: boost_histogram\n":
lines[i] = ".. automodule:: boost_histogram._internal.hist\n"
lines[i + 1] = " :members: Histogram\n"
break

f.truncate(0)
f.seek(0)
f.writelines(lines)


@nox.session
def lint(session: nox.Session) -> None:
Expand Down

0 comments on commit d2eb812

Please sign in to comment.