Skip to content

Commit

Permalink
Add links to problem pages
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnLidbetter committed Jun 9, 2024
1 parent 71220e7 commit bbc6fb3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions crifx/report_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pylatex.package import Package

from crifx.config_parser import Config
from crifx.contest_objects import Judge, Problem, ProblemSet
from crifx.contest_objects import Problem, ProblemSet
from crifx.git_manager import GitManager

MARGIN = "2cm"
Expand Down Expand Up @@ -73,6 +73,13 @@ def _set_preamble(self):
git_short_commit_id = self.git_manager.get_short_commit_id()
self.doc.preamble.append(Command("usepackage", "datetime2"))
self.doc.preamble.append(Command("usepackage", "listings"))
self.doc.preamble.append(
Command(
"usepackage",
("hyperref",),
("colorlinks=true", "urlcolor=blue", "linkcolor=red"),
)
)
self.doc.preamble.append(
Command("definecolor", ("insufficientred", "RGB", "255,100,100"))
)
Expand Down Expand Up @@ -155,7 +162,7 @@ def _write_summary_table(self):
table.add_hline()
for problem in self.problem_set.problems:
row = [
problem.name,
Command("hyperref", (problem.name,), (f"sec:{problem.name}",)),
self._coloured_cell(
problem.independent_ac_count(), requirements.independent_ac
),
Expand Down Expand Up @@ -217,7 +224,9 @@ def _write_manual_reviews_table(self):
)
table.add_hline()
for problem in self.problem_set.problems:
row = [problem.name]
row = [
Command("hyperref", (problem.name,), (f"sec:{problem.name}",))
]
if show_statement_reviews:
row.append(
self._coloured_cell(
Expand Down

0 comments on commit bbc6fb3

Please sign in to comment.