@@ -41,90 +41,6 @@ def is_commentable(node):
41
41
42
42
return False
43
43
44
- kong_comments = """
45
- {
46
- "count": 2,
47
- "next": null,
48
- "previous": null,
49
- "results": [
50
- {
51
- "date": "2015-02-24T19:03:53.992703",
52
- "user": 1,
53
- "text": "simple comment",
54
- "node": {
55
- "id": 619,
56
- "version": {
57
- "id": 104,
58
- "project": {
59
- "id": 2,
60
- "name": "Kong",
61
- "slug": "woot-kong",
62
- "description": "",
63
- "language": "en",
64
- "repo": "http://github.com/ericholscher/django-kong",
65
- "repo_type": "git",
66
- "default_version": "latest",
67
- "default_branch": null,
68
- "documentation_type": "sphinx",
69
- "users": [
70
- 1
71
- ]
72
- },
73
- "slug": "latest",
74
- "identifier": "master",
75
- "verbose_name": "latest",
76
- "active": true,
77
- "built": true,
78
- "downloads": "{'htmlzip': '//localhost:8000/projects/woot-kong/downloads/htmlzip/latest/', 'epub': '//localhost:8000/projects/woot-kong/downloads/epub/latest/'}"
79
- },
80
- "current_hash": "nil-45fcb0188968b1be015a13a44508377b140a1639d872fcc7ee09639e7eb5eb71",
81
- "last_commit": "fac9e2868d8fe86c2e7fcc3d4f02a43fe015f9b3",
82
- "snapshots_count": "1",
83
- "page": "index",
84
- "project": 2
85
- }
86
- },
87
- {
88
- "date": "2015-02-24T19:04:00.174457",
89
- "user": 1,
90
- "text": "Another coment",
91
- "node": {
92
- "id": 620,
93
- "version": {
94
- "id": 104,
95
- "project": {
96
- "id": 2,
97
- "name": "Kong",
98
- "slug": "woot-kong",
99
- "description": "",
100
- "language": "en",
101
- "repo": "http://github.com/ericholscher/django-kong",
102
- "repo_type": "git",
103
- "default_version": "latest",
104
- "default_branch": null,
105
- "documentation_type": "sphinx",
106
- "users": [
107
- 1
108
- ]
109
- },
110
- "slug": "latest",
111
- "identifier": "master",
112
- "verbose_name": "latest",
113
- "active": true,
114
- "built": true,
115
- "downloads": "{'htmlzip': '//localhost:8000/projects/woot-kong/downloads/htmlzip/latest/', 'epub': '//localhost:8000/projects/woot-kong/downloads/epub/latest/'}"
116
- },
117
- "current_hash": "nil-1a8ea4600ed6309a4a13a8b18380606b81485927d07247544270cecaec34c509",
118
- "last_commit": "fac9e2868d8fe86c2e7fcc3d4f02a43fe015f9b3",
119
- "snapshots_count": "1",
120
- "page": "index",
121
- "project": 2
122
- }
123
- }
124
- ]
125
- }
126
- """
127
-
128
44
class UUIDTranslator (HTMLTranslator ):
129
45
130
46
"""
@@ -135,7 +51,7 @@ class UUIDTranslator(HTMLTranslator):
135
51
def __init__ (self , builder , * args , ** kwargs ):
136
52
HTMLTranslator .__init__ (self , builder , * args , ** kwargs )
137
53
self .comment_class = 'sphinx-has-comment'
138
- self .metadata = json . loads ( kong_comments )['results' ]
54
+ self .metadata = builder . storage . get_project_metadata ( builder . config . html_context [ 'slug' ] )['results' ]
139
55
140
56
def dispatch_visit (self , node ):
141
57
if is_commentable (node ):
0 commit comments