Commit Graph

67 Commits

Author SHA1 Message Date
Bharat Raghunathan
e4c55b4887
Fix grammatical typos in black_primer and blackd (#1504) 2020-06-16 11:57:33 -07:00
Richard Si
7403d95862
Refactor docs / Maintenance of docs (#1456)
* Split code style and components documentation

Splits 'the_black_code_style', 'pragmatism', 'blackd',and 'black_primer'
into their own files. The exception being 'the_black_code_style' and
'pragmatism'. They have been merged into one 'the_black_code_style_and_pragmatism'
file.

These changes are being made because the README is becoming very long. And
a README isn't great if it dissuades its reader because of its length.

* Update the doc generation logic and configuration

With the moving of several sections in the README and the renaming of a
few files, 'conf.py' needs to be able to support custom sections.

This commit introduces DocSection which can be used to specify custom
sections of documentation. The information stored in DocSection will be
used by the process_sections function to read, process, and write the section
to CURRENT_DIR.

A large change has been made to the how the docs are prepared to be built.
Instead of just generating the files needed by reading the README, this
has a full chain of operations so custom sections are supported. First,
it reads the README and spits out a list of DocSection objects representing
the sections to be generated by process_sections. This is done since most
of the docs still live in README. Then along with the defined custom_sections
, the process_sections will be begin to process the DocSection objects.
It reads the information it needs to generate the section. Then fetches
the section's contents, calls processors required by the section to process
the section's contents, and finally writes the section to CURRENT_DIR.

This large change is so processing of the documentation can be done just
for the versions hosted on ReadTheDocs.org. An example processor using this
feature is a 'replace_links' processor. It will replace documentation
links that point to the docs hosted on GitHub with links that point to the
version hosted on ReadTheDocs.org. (I won't be coding that ATM)

This also means that files will be overwritten or created once the docs
have been built. It is annoying, since you have to 'git reset --hard'
and 'git clean -f -d' after each build, but there's nothing better. The old
system had the same side effects, so yeah :(

* Update filenames and delete unnecessary files

Update the filenames since 'the_black_code_style' and 'pragmatism' were
merged and 'contributing' was deleted in favor of 'contributing_to_black'.

All symlinks were deleted since their home (_build/generated) is no longer
used.

* Fix broken links and a few redirections

* Merge master into refactor_docs (manually done)

* Add my and most of @hugovk suggestions

Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>

* Add logging and improve configurability

Just some cleaning up up of the DocSection dataclass and added logging
support so you know what's going on.

* Rename a section and please the grammar gods of Black

Thanks @hugovk for the suggestion!

* Fix Markdown comments

* Add myself as an author :P

Seems like the right time.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-05-24 09:37:46 -07:00
Richard Si
0196437f8e
Scrollable sidebar (#1457)
* Make the sidebar navigation scrollable

This is necessary since we have so many documentation sections that even
on a desktop screen, the navigation can sometimes be clipped. The only
annoyance is that on Firefox, the scrollbar can't be hidden :(

* allow the docs to build
2020-05-23 11:56:50 -07:00
Kevin Kirsche
f3599b22d4
Fix typos (#1442) 2020-05-21 06:44:43 -07:00
Cooper Lees
b0f3798aab
Add black-primer docs (#1427)
* Add `black-primer` docs

- Document the idea, CLI args, config and a example run for `black-primer` in README.md
- Add to docs/index.rst

* Add @hugovk suggestions - Thanks.
2020-05-18 07:25:40 -07:00
Paul Meinhardt
45c98cf150
Fix Boolean values in pyproject.toml config (#1410)
Boolean values use lowercase identifiers in TOML.
https://github.com/toml-lang/toml#user-content-boolean
2020-05-13 12:51:04 -07:00
Giacomo Tagliabue
89c87d22e7
add --force-exclude argument (#1032)
Co-authored-by: Peter Yu <2057325+yukw777@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2020-05-08 07:47:26 -07:00
Richard Si
8c3c190f99
Add Black compatible configurations in documentation (#1366 & #1205) (#1371)
* Add Black compatible configs in docs ( #1366 & #1205)

When users of Black are starting a new project or are adding Black to their
existing projects, they will usually have to config their existing tools like
flake8 to be compatible with Black. Usually, these configs are the same across
different projects. Yet, there isn't any consolidated infomation on what configs
are compatible. Leaving users of Black to dig out any infomation they can find
in README.md.

* Fix a bad max-line-length value

* Clean up pylint's configs

* Add explanations for each configurations

Copying and pasting code without understanding it is a bad idea. This goes the same
for users copying and pasting configurations.

* Capitalize Pylint

* Link from the README

* Fix the isort configuration

I referenced the wrong source. I used a pesonal configuration, not a pure Black-
compatible configuration.

* Improve the config explanations

The explanation for the isort configuration was pretty bad. After having fixed the
configuration (see commit 01c55d1), improving the its explanation was necessary to
make it more user-friendly and understandable. Also added fenced code blocks of the
raw configuration options so the explanations make sense.

* Improve README wording slightly

* Add @hugovk, @JelleZijlstra + my suggestions

Co-authored-by: Cooper Lees <cooper@fb.com>
2020-05-08 07:26:29 -07:00
Autophagy
ede23ae7ff Add docstrings to fmt checking functions, add to docs
Follow up from #1325

Adds docstrings to the fmt checking functions.
Renames fmt_on to is_fmt_on.
Adds the functions to the autodocs.
2020-05-08 15:47:18 +02:00
Zsolt Dollenstein
9ed2542e93
Omit commit hash and date stamp from doc version (#1322)
This also removes the dependency on setuptools-scm while building the
docs.

Fixes #1104.
2020-03-28 19:06:00 -07:00
Zsolt Dollenstein
a33823e859
Fix readthedocs build (#1321)
* migrate to new rtd config format and pip

* no type field anymore

* use builtin re for docs
2020-03-27 11:43:41 +01:00
Łukasz Langa
5b552fab9d
Update the name of Mode in the reference docs, too 2020-03-04 23:19:21 +01:00
Łukasz Langa
e253f1260d
Introduce a section of docs about exceptions 2020-03-04 22:26:45 +01:00
Denis Laxalde
fb1ac69812 Simple docs cleanup (#1168)
* Remove reference to format_int_string in docs

The function got dropped in 250ba7f04b.

* Remove reference to is_python36 in docs

The function got removed in 36d3c516d3.
2019-11-22 20:38:46 -08:00
Yngve Høiseth
a6d866990e Automatic markdown and YAML formatting with Prettier (#874) 2019-10-21 11:42:46 +02:00
Andrey
6aef6c9d45 #455 Fix bug with tricky unicode symbols (#1047)
* add test for special unicode symbol which usual re can not process correctly
add regex lib which supports unicode 12.1.0 standard
replace re usage in project in favor to regex

* #455 fix dependency
2019-10-13 10:21:15 -07:00
Zsolt Dollenstein
0acad54c02 fix environment for readthedocs 2019-09-18 14:08:03 +01:00
Zsolt Dollenstein
47861a6a3b fix doc generation 2019-09-18 14:00:18 +01:00
Zsolt Dollenstein
c9689b80fb
fix doc generation 2019-08-21 16:41:11 +02:00
Zsolt Dollenstein
77b6ed1b70 Hello github.com/psf! 2019-07-22 21:41:45 +01:00
Hugo
4a953b7241 ambv/black -> python/black (#819) 2019-05-02 20:19:52 +01:00
Łukasz Langa
1610fd6bc5
Add trailing comma for single as imports, too 2018-09-26 08:26:35 -07:00
Łukasz Langa
41368138bb
Fix documentation build 2018-09-18 12:04:30 -07:00
Zsolt Dollenstein
a82f186787 blackd: a HTTP server for blackening (#460) 2018-09-17 10:02:25 -07:00
Jon Dufresne
6027cca10d Prefer https:// links where available (#485) 2018-08-28 13:00:05 +01:00
José Padilla
1e56d02cad Add playground link (#437) 2018-08-17 16:36:57 +01:00
Mariatta
257f7193fa Add travis badge and GitHub Fork banner to docs (#365) 2018-06-18 20:12:49 -07:00
Łukasz Langa
489d00ed8f Support pyproject.toml
Fixes #65
2018-06-06 17:02:10 -07:00
Łukasz Langa
affc0ec3f9 Update beta link in docs 2018-06-06 15:46:30 -07:00
Łukasz Langa
041ec995e5 Nits 2018-06-04 16:57:27 -07:00
Zsolt Dollenstein
00a302560b Preserve line endings when formatting a file in place (#288) 2018-06-04 15:52:06 -07:00
Łukasz Langa
dbe26161fa Reformat docs/conf.py, too. 2018-06-04 12:29:14 -07:00
Łukasz Langa
2ff05f2584 Fix dangling file in documentation 2018-05-28 23:19:40 -07:00
Łukasz Langa
dd4477b701 Always explode data structure literals
Fixes #152
2018-05-17 17:32:43 -07:00
Łukasz Langa
8b64e916f6 Simplify is_trivial_* methods 2018-05-15 13:25:00 -07:00
Łukasz Langa
3eea3aad86 Don't explode trailers that fit in a single line 2018-05-15 01:05:39 -07:00
Łukasz Langa
cfb003f51c Make parentheses invisible recursively in atoms
This fixes non-deterministic formatting when multiple pairs of removable
parentheses are used.

Fixes #183
2018-05-07 11:13:55 -07:00
David Szotten
e84dee52d9 Should this be "_cede_ control" (#187) 2018-05-02 20:25:23 -07:00
Łukasz Langa
b62bd4de75 Add explode_split to documentation 2018-04-24 14:27:21 -07:00
Łukasz Langa
2446941824 Remove dead code 2018-04-19 00:09:13 -07:00
Łukasz Langa
0a340e1f22 Update documentation
* Add "Ignore non-modified files" from the README
* Add missing functions to the reference
2018-04-18 18:19:04 -07:00
Łukasz Langa
a764f1bb3b Generalize star expression handling
Fixes #132
2018-04-16 01:34:15 -07:00
Zsolt Dollenstein
2104b7cdcb Handle unnecessarily escaped strings (#128) 2018-04-13 11:31:23 -07:00
Łukasz Langa
cb5aadad74 Automatic parentheses management
Fixes #4
2018-04-11 01:36:18 -07:00
Łukasz Langa
c4a477bc69 Link VCS integration in documentation 2018-04-05 13:45:16 -07:00
Zsolt Dollenstein
a42aef7806 Describe how string literals are handled (#96) 2018-03-31 14:42:48 -07:00
Mika⠙
3455389e48 Lines now break before all delimiters (#94)
The default behaviour is that now all lines break *before* delimiters,
instead of afterwards. The special cases for this are commas and
behaviour around args.

Resolves #73
2018-03-31 11:52:11 -07:00
Carol Willing
3c62b9cada float python in doc build 2018-03-30 06:17:44 -04:00
Carol Willing
d2f29f86f4 use conda for rtd 2018-03-29 20:31:02 -04:00
Łukasz Langa
b901d75deb Show __str__ in UnformattedLines 2018-03-28 19:31:40 -07:00