-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Cleanup README.rst: #418
Cleanup README.rst: #418
Conversation
NickVolynkin
commented
Apr 28, 2017
•
edited
Loading
edited
- Refactor list items.
- Use autonumbering in lists to prevent errors.
- Indent code inside list items to make it belong to those items.
- Use inline-code style for filenames.
- Update link to a pull request with new repo path.
- Fix a few typos and punctuation.
- Use .. code:: bash for proper highlighting
- Use # for comments in bash
03399e5
to
53c0ca9
Compare
@NickVolynkin, this is reStructuredText, not Markdown. Please review the differences between your version and upstream's (specifically the changes to the note and code directives). Looks good to me, otherwise. 👍 |
53c0ca9
to
89ecc0c
Compare
Hi, @polyzen!
I'm quite well aware of that. :)
If you mean that it doesn't render as a Note block – this didn't change. Looks like GitHub just doesn't support this syntax.
Suddenly, GH is less forgiving to wrong indentation than Shpinx which I used to check the output. Fixed it in code blocks throughout the document. |
The list in "Releasing the Theme" is a step-by-step instruction, so I've changed it to an ordered list. |
89ecc0c
to
8e7ca66
Compare
Oh, the commit message! Yep, that's just a habit. Fixed. :) |
8e7ca66
to
86719bf
Compare
That's a shame. The docs don't specify a blank line here -- probably best to inline it. |
86719bf
to
f776424
Compare
Most directives in this files have a blank line between declaration and content. But if the docs say so, let it be without a blank line. ) |
* Refactor list items. * Use autonumbering in lists to prevent errors. * Indent code inside list items to make it belong to those items. * Use inline-code style for filenames. * Update link to a pull request with new repo path. * Fix a few typos and punctuation. * Use .. code:: bash for proper highlighting * Use # for comments in bash * Use ordered list for step-by-step instuctions.
f776424
to
a1c6887
Compare
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content changes here look 👍 . My only nitpick to these edits is that across our documentation we do use 4 space indentation, as 3 spaces is not a requirement of the reST spec, and it's better our indentation matches our python source.
@agjohnson it seems to me that reST indeed requires indent equal to that of the directive. Look what happens if I use 4 and 8 space indents in the list items: https://github.com/NickVolynkin/sphinx_rtd_theme/tree/four-space-indent#set-up-your-environment. If there's a way to use "normal" 4 space indentation and keep the code formatting, please tell me. It's something that I struggle a lot with. |
I'm quite new to reST and now things seem like this to me. Am I wrong?
|
"List item bodies must be left-aligned and indented relative to the bullet .." 4-space indentation must be for directive contents (possibly just the code directives?). |
For one of my projects, we use 3 space indentation. I do not have a strong opinion but I think 3 is correct. @agjohnson can we merge this? |
3 space indentation isn't wrong, as directives just require >3 spaces. We use 4 everwhere else though. |
@NickVolynkin Your example is mostly correct, and @polyzen describes the pattern we use -- list items require special indentation and we use 4 space indentation on all directives. I can comment on the specific blocks in review. In particular, for a code block nested in a list: 1. Items can be single lines
2. Items can be multiple,
dangling lines, but indentation must match (3 chars)
3. Items can contain
spaces in between lines as long as indentation matches,
this includes directives:
.. code::
# This is 7 character indentation
# 3 for the list item plus 4 for code
print(sys.version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an example of some of the indentation changes for what our normal style would be.
html_theme = "sphinx_rtd_theme" | ||
html_theme_path = ["_themes", ] | ||
html_theme = "sphinx_rtd_theme" | ||
html_theme_path = ["_themes", ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 4 space indent
'collapse_navigation': False, | ||
'display_version': False, | ||
'navigation_depth': 3, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 space indent here
|
||
pip install sphinx | ||
pip install sphinx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code block would be 7 space indent (3 for list item, 4 for code)
|
||
gem install sass | ||
gem install sass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 space indent here
// Now that everything is installed, let's install the theme dependecies. | ||
npm install | ||
# Now that everything is installed, let's install the theme dependencies. | ||
npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 space indent here
@agjohnson thanks for explaining. Will update the MR next week. :) |
Cleanup README.rst * Refactor list items. * Use autonumbering in lists to prevent errors. * Indent code inside list items to make it belong to those items. * Use inline-code style for filenames. * Update link to a pull request with new repo path. * Fix a few typos and punctuation. * Use .. code:: bash for proper highlighting * Use # for comments in bash * Use ordered list for step-by-step instuctions. * Make all code blocks 4 space indents
This pull request became inactive and #418 fixes the indent issue so that was merged instead. Nick Volynkin, please still free to send more PRs in the future. |
* commit '6c2302472fb2c61eec9b4be3a2515117fffbfac3': (253 commits) Add pygments_style to theme.conf Document new theme option Add option to layout.html Update theme.conf Apply clearfix on breadcrumbs Follow-up grunt for readthedocs#472 (readthedocs#476) Only change current if a matching link is found (readthedocs#472) Add a couple of badge icons to readme (readthedocs#471) Add Sphinx Framework for PyPi (readthedocs#470) Fix error in setup entry points (readthedocs#466) Added `.admonition` to the CSS (readthedocs#462) Use explicit UTF8 encoding (readthedocs#452) Add missing pygments css link Convert underscores to dashes. Reflect language in lang attribute. Replace master with v0.2.5 in README.rst Add missing dependency in dev setup: sphinxcontrib-httpdomain (readthedocs#431) Finalized readthedocs#418 (readthedocs#433) Added a link to the Sphinx documentation about setuptools entry points Added setuptools entry point for Sphinx ...