Code Monkey home page Code Monkey logo

documentation-style-guide-sphinx's Introduction

documentation-style-guide-sphinx's People

Contributors

benoitbryon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

documentation-style-guide-sphinx's Issues

Test README build

Add test which checks that README is built without warnings or errors.

Initialize project

Create project structure:

  • README
  • sphinx installation
  • empty documentation for now

Produce clear guidelines about indentation

Issues with 2 spaces:

  1. It's a pain to have several indentation levels in a same RST document while editing it, because the TAB shorcut gives wrong results.
    As an example toctree directive doesn't work with 2 spaces but seems to work with 3 or 4 spaces.
  2. in code-blocks, it's a pain to deal with mixed indentation.
    As an example:
The following block is indented with 2 spaces.
.. code-block:: python

  def some_intendation():
      """This comment is indented with 4 spaces."""

Python convention is to use 4 spaces. Since most Sphinx projects are about Python projects, Python code-blocks are a really common use case. So 4 space indentation may be useful for many users (most of them?).

Another common use case for code-blocks is sh or bash... 4 spaces doesn't hurt in that case.

Write a "style checker" extension for sphinx

Feature: validate documentation style
  In order to validate documentation against style guide conventions
  As a documentation writer
  I want to run scripts that give me feedback about style conventions

  Scenario: Get feedback on documentation build
    Given a Sphinx documentation
    And style_guide extension is installed and enabled
    When I run sphinx-build
    Then I get errors, warnings and notices related to style conventions.

Github and .rst files

In the style guide, it says:

  • Some programs parse .rst with rst2html_, which cannot interpret some
    Sphinx's directives such as code-block. So readers using such programs
    actually lose some content.

    As an example, well known Github_ platform uses rst2html
    to render .rst files in its repository browser. Not only you lose
    content, you also lose features like links to lines.

This doesn't appear to be the case (any longer). I uploaded a test here:
https://github.com/ardalis/Docs/blob/master/docs/github-test.rst

And it renders just fine (images are broken, but that's because I didn't copy them - code blocks render just fine, and no content is lost). When editing the file, it opens in a plain text editor, showing all RST markup, so again there doesn't appear to be any risk of loss of content when using .rst extension files and Github.

Can you comment and/or update the style guide?

Thanks!
Steve

A command to "beautify" RST files

Proof of concept implementation could be:

Feature: script which applies style guide recommendations on existing RST files
  In order to apply style guide conventions on existing RST files
  As a documentation writer
  I want to run a script which does most of the work automatically

  Scenario: apply style guide recommendations on an existing RST file
    Given a file named `example.txt`
    And this file contains valid RST content
    And the title of the document doesn't use `#` (sharp) character with overline
    And other titles don't use `#` (sharp) character
    When I run some `rst-beautify` script with `example.txt` as argument
    Then the file is modified in place and the title of the document uses  `#` (sharp) character with overline.

Sphinx-based projects can reuse documentation tests

See #17 and #18: these tests are for this "documentation-style-guide-sphinx" project.
But they would be useful for any Sphinx-based documentation project.

Is it possible to distribute these tests? May require to create a separate package (in another repository).

Check PEP 12

There are some RST conventions in PEP 12.
Adopt some of them? or ask the PEP author to adoptt the conventions here?

Add a license

  • Currently, this is not software but content... add a license like Creative commons?
  • If #5 is implemented, add a license like BSD or something.

Merge README in docs

README contains important information such as:

  • about
  • contribution guidelines
  • vision...

Merge it in documentation, so that it appears on static builds (i.e. on ReadTheDocs service).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.