-
Notifications
You must be signed in to change notification settings - Fork 35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I don't understand this code to the %100, I read http://www.sphinx-doc.org/en/stable/extdev/domainapi.html to have a little more of context p:
Is the example the full output of https://github.com/rtfd/readthedocs.org/blob/master/docs/api/v2.rst?
@@ -148,6 +150,25 @@ def rtd_render(self, template, render_context): | |||
app.builder.templates) | |||
|
|||
|
|||
def geneate_search_objects(app, env): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little typo geneate
-> generate
@@ -148,6 +150,25 @@ def rtd_render(self, template, render_context): | |||
app.builder.templates) | |||
|
|||
|
|||
def geneate_search_objects(app, env): | |||
domain_objects = {} | |||
for domainname, domain in sorted(app.env.domains.items()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason to sort the data before? At the end, we save all this in a not-sorted dict
I have build documents of readthedocs using the built in JSONHTMLBuilder. It seems like the "objects":{
"":{
"/api/v1/user/{id}/":[
7,
0,
1,
"get--api-v1-user-id-"
]
}""
} https://gist.github.com/safwanrahman/b7151e8fe47ceab145c700995e075cf6 |
So I have type of data by reading the source code . Its in following order we already get this file in our build. I think we can parse the information from there and build our index. what do you think @ericholscher ? |
@safwanrahman We can perhaps just use the existing |
Closing this, as I think all the data we need is already in |
This will let us index more interesting data about Sphinx domains in our search.
This will output something like this in the JSON: