Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use sphinx to build our API document #1738

Closed
wants to merge 1 commit into from

Conversation

yufansong
Copy link
Collaborator

@yufansong yufansong commented May 12, 2024

Because our codebase become larger and larger. I find it is inefficiency to see every line code to catch up our latest progress. I prefer to build a API doc for us to do quick browser.

Solution for building API doc:

  1. Pydocs
    It is build-in module in python. But find it canot satisfied my requirement, and operation is tedious, I even need to manually generate every sub module by myself.
  2. Sphinx (Prefer)
    Sphinx [github] [doc] is a popular open source project to create intelligent and beautiful documentation. After some investigation, I think the final website is better than pydocs. So I choose it.
  3. Others
    Not sure whether there exist better open source solution. Sphinx already solve my problem. But welcome any other suggestions.

What this PR do:

  1. It will show all modules and their sub module architecture.
  2. It will show the function signature and class defnition.
  3. You can search function/class in website.

I only add the source directory, and ignore the build directory. In this way, we can keep commit clear and small. But when your want to browser the doc, you need to build it manually. I will add some cmd for building in the future PR.

How to run:
Go to sphinx directory run make clean & make html, then html file will generate in sphinx/build directory. Open index.html in your browser.

How to update:
Go to sphinx directory, run sphinx-apidoc -o source ../opendevin -f , then do make clean & make html.

Website example:

image image image

@yufansong yufansong requested a review from li-boxuan May 12, 2024 15:11
Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@8bfae84). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1738   +/-   ##
=======================================
  Coverage        ?   63.77%           
=======================================
  Files           ?       99           
  Lines           ?     4058           
  Branches        ?        0           
=======================================
  Hits            ?     2588           
  Misses          ?     1470           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yimothysu
Copy link
Collaborator

@yufansong we're currently using #1372 for docs, which generates Python docs using pydoc-markdown. do you think this is sufficient?

cc @Sparkier

also see #1374

@yufansong
Copy link
Collaborator Author

@yufansong we're currently using #1372 for docs, which generates Python docs using pydoc-markdown. do you think this is sufficient?

cc @Sparkier

also see #1374

Didn't notice you already have tried sphinx before. Let me check it first. :)

@yufansong
Copy link
Collaborator Author

@yimothysu Thanks for you remind. I check the related pr and the previous discussion in slark.
I think docusaurus is more beautiful than Sphinx. But sphinx can preovide search methods which docusaurus not. Wondering whether we can add search methods into current doc.

But anyway, I will close this PR first.

@yufansong yufansong closed this May 12, 2024
@Sparkier
Copy link
Collaborator

Adding search would definitely be nice. Docusaurus also has some support for search: https://docusaurus.io/docs/search

@Shimada666
Copy link
Contributor

@Sparkier @yufansong
Yes, I think the search function is very important. I believe we can start by using a local search plugin because it's simple. I have enabled this feature in vitepress(a similar docs website like Docusaurus, but based on vue). We can integrate Algolia search later when we have more content. 😁

@Shimada666
Copy link
Contributor

I prefer Docusaurus over Sphinx. More people are familiar with Markdown than with reStructuredText, and the interface is more beautiful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants