@@ -522,20 +522,20 @@ def get_sorted_contributors(self) -> List[Contributor]:
522
522
contributorsReader = ContributorsFileReader (os .path .join (os .getcwd (), "contributors.yaml" ), gh_client )
523
523
524
524
525
- def declare_variables ( variables , macro ):
526
- @macro
525
+ def define_env ( env ):
526
+ @env . macro
527
527
def since (version ):
528
528
"""Add a button"""
529
529
HTML = """<a href="https://github.com/containerssh/containerssh/releases" target="_blank"><span class="since"><span class="since__hide">(</span><span class="since__text">since</span> <span class="since__value">%s</span><span class="since__hide">)</span></span></a>"""
530
530
return HTML % (version )
531
531
532
- @macro
532
+ @env . macro
533
533
def upcoming (version ):
534
534
"Upcoming version"
535
535
HTML = """<span class="since"><span class="since__hide">(</span><span class="since__text">upcoming in</span> <span class="since__value">%s</span><span class="since__hide">)</span></span>"""
536
536
return HTML % (version )
537
537
538
- @macro
538
+ @env . macro
539
539
def days_ago (date ):
540
540
if not date :
541
541
return ""
@@ -545,66 +545,66 @@ def days_ago(date):
545
545
else :
546
546
return "%d days ago" % delta .days
547
547
548
- @macro
548
+ @env . macro
549
549
def github_repos () -> List [GitHubRepo ]:
550
550
return gh_client .get_repos ()
551
551
552
- @macro
552
+ @env . macro
553
553
def get_milestones ():
554
554
return gh_client .get_milestones ()
555
555
556
- @macro
556
+ @env . macro
557
557
def get_version (repo : GitHubRepo ) -> str :
558
558
if repo is None or repo .last_version is None :
559
559
return ""
560
560
return "[%s](%s/releases/tag/%s)" % (repo .last_version , repo .url , repo .last_version )
561
561
562
- @macro
562
+ @env . macro
563
563
def github_issues () -> List [GitHubIssue ]:
564
564
result = []
565
565
for repo in gh_client .get_repos ():
566
566
for issue in gh_client .get_repo_open_issues (repo .name ):
567
567
result .append (issue )
568
568
return result
569
569
570
- @macro
570
+ @env . macro
571
571
def github_prs () -> List [GitHubPR ]:
572
572
result = []
573
573
for repo in gh_client .get_repos ():
574
574
for pr in gh_client .get_repo_prs (repo .name ):
575
575
result .append (pr )
576
576
return result
577
577
578
- @macro
578
+ @env . macro
579
579
def contributors () -> List [Contributor ]:
580
580
return contributorsReader .get_sorted_contributors ()
581
581
582
- @macro
582
+ @env . macro
583
583
def reference_outdated ():
584
584
return '''
585
585
!!! warning "Old manual"
586
586
You are reading the reference manual of an older release. [Read the current manual »](/reference/)
587
587
'''
588
588
589
- @macro
589
+ @env . macro
590
590
def reference_upcoming ():
591
591
return '''
592
592
!!! warning "Upcoming release"
593
593
You are reading the reference manual of an upcoming release. [Read the current manual »](/reference/)
594
594
'''
595
595
596
- @macro
596
+ @env . macro
597
597
def grid_start (size = 2 ):
598
598
return '<div class="grid grid--{0}">' .format (size )
599
599
600
- @macro
600
+ @env . macro
601
601
def grid_end ():
602
602
return '</div>'
603
603
604
- @macro
604
+ @env . macro
605
605
def grid_item_start ():
606
606
return '<div class="grid__box">'
607
607
608
- @macro
608
+ @env . macro
609
609
def grid_item_end ():
610
610
return '</div>'
0 commit comments