Skip to content

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Oct 2, 2019

Change Summary

Move all docs to mkdocs

fixes #578

Still to do:

  • add an intro to models.md
  • add an intro to types.md
  • fix "TODO: warning about field order"
  • remove "Required Fields and mypy" section in mypy
  • fix benchmarks (should be regenerated for v1 anyway), needs to output an md table not csv

@codecov
Copy link

codecov bot commented Oct 2, 2019

Codecov Report

Merging #856 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #856    +/-   ##
======================================
  Coverage     100%   100%            
======================================
  Files          17     16     -1     
  Lines        3132   2716   -416     
  Branches      610    518    -92     
======================================
- Hits         3132   2716   -416
Impacted Files Coverage Δ
pydantic/env_settings.py 100% <ø> (ø) ⬆️
pydantic/version.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8905e9a...8d33898. Read the comment docs.

@samuelcolvin samuelcolvin mentioned this pull request Oct 3, 2019
11 tasks
@dmontagu
Copy link
Contributor

dmontagu commented Oct 3, 2019

This is gonna be really awesome!

@samuelcolvin samuelcolvin marked this pull request as ready for review October 3, 2019 20:56
@samuelcolvin
Copy link
Member Author

this is ready to review, feedback very welcome.

I see need to fix benchmarks before this can be merged, and there's #862 to do later, but unless there are any major problems this should be merged soon since it's already better than what went before.

@dmontagu
Copy link
Contributor

dmontagu commented Oct 4, 2019

I'm looking at it now -- this is awesome!!

@dmontagu
Copy link
Contributor

dmontagu commented Oct 4, 2019

(Feel free to just mark resolved any suggestions that you disagree with. Also let me know if you don't want me to point out the typos like this.)

```
_(This script is complete, it should run "as is")_

## Custom Data Types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it's worth, I personally think this section, short as it is, merits its own top level page, separate from all the other types.

(It may also be worth expanding that page..)

This is such a useful feature and I think it doesn't get the attention it deserves -- it's a shame for it to be buried way at the bottom of the long list of types pydantic provides.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, personally I think it's right here but we should link to it more and expand it to contain more details and a better example. Certainly the current example is awful.

samuelcolvin and others added 2 commits October 4, 2019 11:21
incorporate @dmontagu's suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>
more missed suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>
@samuelcolvin
Copy link
Member Author

samuelcolvin commented Oct 4, 2019

@dmontagu thank you very much for your review. I know this stuff isn't much fun, but I'm very dyslexic and corrections like this make the docs a lots easier to use and looks a lot more professional.

This was referenced Oct 4, 2019
@haizaar
Copy link
Contributor

haizaar commented Oct 10, 2019

Guys, can you please elaborate why did you decided to switch from rst/sphinx to mkdocs? Any particular advantages in favor the latter?

@dmontagu
Copy link
Contributor

I think the new (hierarchical) organization is a big improvement; it's not just a massive wall of text. I'm not sure that by itself necessitated the move to mkdocs though.


I can't speak for what motivated @samuelcolvin to move to mkdocs, but I personally think it now looks much nicer than the old docs page, and hopefully feels a little more modern for prospective new users.

And at least one person has commented positively (from the fastapi gitter):

btw, just realized pydantic reached 1.0 and had a very nice facelift for their doc!


@haizaar Do you have any issues with new docs format?

@samuelcolvin samuelcolvin deleted the mkdocs branch October 10, 2019 09:50
@haizaar
Copy link
Contributor

haizaar commented Oct 10, 2019

@dmontagu not at all. They are aesthetically pleasing. Though there are nice sphinx templates our there as well. And of course you can create hierarchical docs with sphinx as well. I wonder if material design was the main thing. Or may be Samuel just wanted get some experience with mkdocs :)

Again, I have absolutely no problems/issues with the docs. Just being curious.

@samuelcolvin
Copy link
Member Author

1. Markdown vs. reStructuredText

Many developers find markdown much more intuitive to use than rst. I know rst has many powerful features but it's also extraordinarily convoluted to do simple things e.g. links are

`name <https://www.example.com/>`_

I find this amazingly complex. Even after having written thousands of lines of it, I still have to search for an example of things that are trivial in md.

I hope people will be more willing to help with the docs now they're written in markdown.

2. mkdocs vs. sphinx

mkdocs definitely isn't perfect, there are some design decisions I strongly disagree with. However overall it's a lot more use friendly than sphinx: mkdocs serve alone makes a significant difference to the feedback loop when writing docs. I think there's also a richer ecosystem of themes available for mkdocs.


I wonder if material design was the main thing.

Not really, though I do think it's nice.

Or may be Samuel just wanted get some experience with mkdocs :)

If only, we used a mkdocs site for the help site of the company I run for many years. mkdocs is an old frenemy.


In short:

  1. I enjoy writing the docs. now more than before.
  2. I enjoy reading the docs. now more than before.

@haizaar
Copy link
Contributor

haizaar commented Oct 10, 2019

Thanks for sharing! Appreciate that! I saw mkdocs becoming quite popular in Python world and was very curious to hear experience from someone who designed to switch. Thanks again!

andreshndz pushed a commit to cuenca-mx/pydantic that referenced this pull request Jan 17, 2020
* moving docs to mkdocs

* transfering readme to md and more

* fixing build

* splitting usage.md

* improving schema.md and index.md

* fix make_history.rst

* models intro

* working on data conversation and required fields

* more fixes to models.md

* list all standard types supported

* list of pydantic types

* tweaks

* update links in code

* Apply suggestions from code review

incorporate @dmontagu's suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more missed suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more corrects.

* cleanup

* Field order warning

* fix and regenerate benchmarks

* format examples better, cleanup

* improve schema mapping table

* correct highlighting file types in schema.md

* add redirects in javascript

* add logo
alexdrydew pushed a commit to alexdrydew/pydantic that referenced this pull request Dec 23, 2023
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.

Clarify the purpose of pydantic e.g. not strict validation
3 participants