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

autogenerate docs #19

Open
efiop opened this issue May 25, 2022 · 20 comments
Open

autogenerate docs #19

efiop opened this issue May 25, 2022 · 20 comments

Comments

@efiop
Copy link
Contributor

efiop commented May 25, 2022

Seems like sphinx is the standard (Kudos @pmrowla for the suggestion), but dvc-task and dvc-render use mkdocs. Need to choose.

@efiop efiop changed the title docs: use sphinx to generate docs? autogenerate docs May 25, 2022
@efiop
Copy link
Contributor Author

efiop commented May 25, 2022

@daavoo Were there any particular reasons for choosing mkdocs over the other options?

@daavoo
Copy link
Contributor

daavoo commented May 25, 2022

@daavoo Were there any particular reasons for choosing mkdocs over the other options?

Note my points are not really sphinx vs mkdocs but more sphinx vs (mkdocs + ecosystem) .

Mainly chose mkdocs because:

  • Used by doc pages I like (FastAPI, Pydantic, httpx)
  • Complexity of our dvc-X docs doesn't require 90% of sphinx features (and features is the most commonly used point in favor of sphinx).
  • Markdown. (IMO) mkdocs has simpler syntax. Consistency with doc pages (although sphinx can be extended with a custom parser for markdown)
  • Easier deploy to gh pages
  • Love the default appearance and features of mkdocs-material / kinda hate most sphinx themes

@daavoo
Copy link
Contributor

daavoo commented May 25, 2022

Also:

  • First thing I tried and worked. Tbh I don't see much value of in-depth debate/research about docs tooling, at least given our current needs.

@shcheklein
Copy link
Member

shcheklein commented May 25, 2022

@casperdcl has introduced some tooling in the shtab and PyDrive2 recently and there was a discussion I believe around it. Unless there is a really strong reason, I would try to keep it unified if possible.

@casperdcl
Copy link
Contributor

casperdcl commented May 25, 2022

@skshetry
Copy link
Member

skshetry commented May 26, 2022

This is a discussion to have in https://github.com/iterative/py-template. Right now, using markdown in docs is inconsistent with the rest of the cookie-cutter template. Also, we don't need to force docs in all the generated repositories, it should be conditional.

I usually just use sphinx, coupled with the furo theme, which is nice and used in lots of Python libraries. There's also myst-parser that allows you to use markdown with Python and sphinx (which I find to be useful when including readme contents in the docs but use sphinx's autogeneration features.

@casperdcl
Copy link
Contributor

using markdown in docs is inconsistent with the rest of the cookie-cutter template

https://github.com/iterative/py-template/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/docs/index.md looks like markdown to me?

@skshetry
Copy link
Member

using markdown in docs is inconsistent with the rest of the cookie-cutter template

https://github.com/iterative/py-template/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/docs/index.md looks like markdown to me?

template has README.rst, CONTRIBUTING.rst and CODE_OF_CONDUCT.rst.

@shcheklein
Copy link
Member

So, let's try to make it a bit more constructive please? What are the pros and cons of each? I only see some good arguments from @daavoo (thanks, David 🙏 ), everything else so far is not very constructive.

From the top of my head. We mush use MD (so we'll have to introduce additional processing? custom things? - not sure how complicated it is)?

@casperdcl what was your experience with sphinx was a pain ? could you elaborate a bit?

@skshetry what are the cons of using mkdocs?

can we compare the implementation complexity of some examples that we like ?

@casperdcl
Copy link
Contributor

casperdcl commented May 27, 2022

my understanding:

  • both sphinx & mkdocs are mature with nearly identical feature matrices, and we're not considering any other options. However, primary intended use is different:
    • sphinx is rst-first & config via a py file
    • mkdocs is md-first & config via a yml file
  • IMO because md is more widely adopted outside the Python world and is less html-code-like (i.e. ironically more Pythonically zen), it's more actively developed.
    • I switched projects I maintain from sphinx to mkdocs due to nicer themes, extensions & less boilerplate code
    • Also note PyPI Topic :: Documentation :: Sphinx has 465 entries, while Topic :: Documentation has 2051 (implying circa 3x more non-sphinx Python docs projects).

Compare:

mkdocs

sphinx

@daavoo

This comment was marked as resolved.

@0x2b3bfa0
Copy link
Member

(My personal preference1 is for Sphinx with Furo — like @skshetry in #19 — plus Napoleon and Google-style documentation strings for the sake of quasiliterate programming)

Projects using Sphinx

Projects using MkDocs

Projects using other systems

Footnotes

  1. Shameless plug

  2. Written in Markdown instead of reStructuredText; doesn't have any API reference, just user guides

@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented May 27, 2022

Disclaimer: my real-world experience with MkDocs is close to zero. 🤷🏼‍♂️

While reStructuredText and Sphynx are “the canonical choice” and have lots of specific syntax to represent Python concepts, they're also a bit niche and overcomplicated. I wonder if MkDocs will end up being the “hypermodern” replacement for them.

I've rescued some links from an old direct message conversation with @casperdcl:

@shcheklein

This comment was marked as resolved.

@efiop efiop transferred this issue from iterative/dvc-objects May 28, 2022
@efiop

This comment was marked as resolved.

@0x2b3bfa0
Copy link
Member

36% of Python programmers use documentation tools. The most popular one is Sphinx.1 #pythondevsurvey https://lp.jetbrains.com/python-developers-survey-2021

Footnotes

  1. Sphinx (61%) 🥇 followed by MKDocs (22%) 🥈

@jorgeorpinel
Copy link

In case it's useful, we have a page that lists docs-related repos (and what they use) as of now:

https://www.notion.so/iterative/Docs-related-repositories-list-c23f24dca6154dc49026923ff67d20f4

@casperdcl
Copy link
Contributor

casperdcl commented Jul 18, 2022

I would prefer all docs-related repos have a topic documentation added to them to show up in https://github.com/iterative/?q=topic%3Adocumentation#org-repositories (similar to how we do for topic:example)

@jorgeorpinel
Copy link

jorgeorpinel commented Jul 18, 2022

Agree. But that doesn't give us details on what engines they use, unless we start including that metadoc in the README or CONTRIBUTE files of every repo.

@casperdcl
Copy link
Contributor

give us details on what engines they use

oh is that the intention? Why?

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

No branches or pull requests

7 participants