Commit graph

133 commits

Author SHA1 Message Date
Ray Zeng
f0b6e6c37d Re-organize metadata documentation and add a usage example 2019-08-16 10:34:30 -07:00
Ray Zeng
63ff16cb47 Add more metadata documentation 2019-08-16 10:34:30 -07:00
Ray Zeng
79f0ebc2a4 Add sphinx docs to metadata modules 2019-08-16 10:34:30 -07:00
jimmylai
611f45e596
[doc] use original_node instead of node for consistency 2019-08-14 14:57:26 -07:00
Benjamin Woodruff
90e4efb348 Add docs for MaybeSentinel and RemovalSentinel
These were referred to by other parts of the documentation, and they
provide core parts of our functionality, so we should have explicit
documentation for them.
2019-08-08 11:04:02 -07:00
Benjamin Woodruff
da7b9435ee Add logo and favicon to sphinx documentation
- The white logo variant shows up on the top of the sidebar.
- The favicon shows up when the page is loaded.
2019-08-07 13:32:31 -07:00
Benjamin Woodruff
ef0ce06e12 Remove unused sphinx plugins
It doesn't look like we need:

- `sphinx.ext.githubpages`
- `sphinx.ext.todo`
- `sphinx.ext.mathjax`

So I removed these and then sorted the list of extensions.
2019-08-06 19:39:43 -07:00
Benjamin Woodruff
647ef53f0e Finish documentation pass over expressions
This commit mostly focuses on f-strings, collections, comprehensions,
and subscripts/slices.

I added intersphinx support to the sphinx config so I could link to
`ast.literal_eval`.

I exported BaseSimpleComp, since I felt it had some documentation value.
2019-08-06 19:39:43 -07:00
Jennifer Taylor
101ff70857 Lots of work on Why LibCST section
Fixed Why LibCST printed example as it was out of date.
Unrolled README example into Why LibCST section to decouple since this page explicitly uses "fn(1, 2)" snippet and the readme is going to change.
Added justification and pros/cons to LibCST.
Added graphviz to render the non-default parts of LibCST tree (identical to how we render non-default parts of the AST).
2019-08-06 16:55:08 -07:00
jimmylai
6138e74542
[document] add jupyter based tutorial page
* [document] add jupyter based tutorial page

* add return type and fix typos
2019-08-06 16:34:03 -07:00
Jennifer Taylor
944f987b1f Better documentation for visitors. 2019-08-05 10:56:33 -07:00
Benjamin Woodruff
593968da65 Add the logo to the docs/source/_static/ directory 2019-08-05 10:44:17 -07:00
Jennifer Taylor
9ca3d39fb6 Rename Ellipses to Ellipsis to match AST and Python stuff. 2019-08-02 17:17:38 -07:00
Benjamin Woodruff
a4af00dd7f Update the expression documentation
I haven't gone through every expression and cleaned it up yet, but I
have completed the `Names and Object Attributes`, `Operations and
Comparisons`, `Control Flow`, and `Lambda and Function Calls` sections,
as well as part of the `Literal Values` section.
2019-08-02 15:50:17 -07:00
Jennifer Taylor
ac1a6fd054 Fix deprecation warning. 2019-08-01 18:28:54 -07:00
Jennifer Taylor
64ff2b1996 Better repr for partial configuration.
This adds a __repr__ to various types in the parser config, so that the
generated documentation for functions using these types renders easier
to read.
2019-08-01 16:14:12 -07:00
Benjamin Woodruff
f2c887604f Group expression documentation into subcategories
Groups the expression nodes into much smaller subcategories for improved
readablility.

Some nodes defined in the expression module were grouped with statements
because they made more sense there (from a documentation perspective).

This also adds a local table of contents to the top of the nodes page
which better reveals all of the subcategories.

It also exports and categorizes
`BaseAssignTargetExpression`/`BaseDelTargetExpression`. These nodes were
referenced in type annotations of other nodes, so they need to be
exported if only for documentation reasons.
2019-08-01 14:54:36 -07:00
Jennifer Taylor
8d000ababc Add a motivation section for LibCST documentation. 2019-08-01 14:51:00 -07:00
jimmylai
aee5ff7857
[document] formatting why_libcst 2019-08-01 14:05:29 -07:00
Jennifer Taylor
374d66d09a Minor formatting nits. 2019-08-01 14:03:51 -07:00
Benjamin Woodruff
aec1e9f2f3
Clean up relative sphinx class/func references
Removes the leading dot in node references (due to a misunderstanding I had), and uses tilde-based prefixes for restructured text references for consistency with the rest of the docs.
2019-08-01 13:40:27 -07:00
jimmylai
88064092af
[document] Use ReadTheDot Theme 2019-08-01 12:09:32 -07:00
Jennifer Taylor
2e20694ff9 Reorder Statement section of node documentation to have better groups. 2019-07-31 17:27:49 -07:00
Jennifer Taylor
29199ca764 Update documentation on base nodes in statement. 2019-07-31 17:27:49 -07:00
Benjamin Woodruff
88cb0cb88e Remove BaseAtom
I added this originally because it's part of Python's grammar, but since
we merged parenthesis and friends into expressions instead of forming
separate nodes, BaseAtom doesn't have much use.

This fixes also a few bugs:
- A decorator requires a `dotted_name`, so it can only take a `Name` or
  an `Attribute` node, not any atom.
- A `Call` node's function can be any expression, not just a fixed list
  of `BaseExpression` subclasses.
2019-07-31 13:34:07 -07:00
Jennifer Taylor
ebb4681258 Separate operators into groups, add basic description to all existing groups. 2019-07-30 17:36:51 -07:00
Benjamin Woodruff
cf2dfa5ee6 Define DictComp node
This defines the node and adds tests for it, but doesn't implement the
parser for it. That will come in a later PR.
2019-07-30 15:53:07 -07:00
Benjamin Woodruff
c0ac3d7049 Switch from automodule to autoclass everywhere
- Now that we're exporting everything from the top-level libcst package,
  automodule makes a mess of things.
- While it does create more boilerplate, using autoclass/autofunction
  instead of automodule gives us a lot more control over the order in
  which nodes are presented, so we can group them by various categories.

This diff also exports BaseParenthesizableWhitespace, because nodes
refer to it by type, and so it's needed for documentation purposes.
2019-07-29 10:51:59 -07:00
jimmylai
0b8422cee2
add copyright header to custom.css 2019-07-24 19:30:21 -07:00
jimmylai
14ee31dc6a [doc] Why libcst?
* reuse README intro section in doc

* [doc] Why LibCST?

* reuse README intro section in doc

* [doc] Why LibCST?
2019-07-24 12:19:00 -07:00
jimmylai
c0764745fa reuse README intro section in doc 2019-07-23 18:57:47 -07:00
Benjamin Woodruff
27e816059b Change autodoc member order to "bysource"
Without this option, autodoc defaults to ordering all members of
modules and classes alphabetically.

While this is normally fine (and probably desirable), the ordering of
fields in dataclasses is significant, so we need to change this behavior
to preserve the original member ordering.
2019-07-23 17:18:32 -07:00
jimmylai
120cfa9229 add sphinx autodoc templates and docs CI job 2019-07-22 20:05:27 -07:00