abathur / ldmud-doc

A temporary repo for working on a revamp of the documentation system for http://github.com/ldmud/ldmud
0 stars 0 forks source link

Linter-enforced plaintext format rules/standards... #19

Open abathur opened 7 years ago

abathur commented 7 years ago

@zesstra and @amotzkau I'm debating what (if any) source-level style/format1 rules (vertical space, indentation/alignment, line wrap) to enforce.

Here are a few things we could catch by linting the raw source:

  1. arbitrary (non-semantic) line breaks in elements (paragraphs, list items, etc.) so that line wrapping can be left to our code editors
  2. nested elements that aren't indented correctly 2
  3. unnecessary blank lines 3

I'm currently inclined to only do the first item above, but I'm open to adding any rules you see as worthwhile--I just don't want to spend much time building rules we don't care about. Will re-negotiate if any given rule proves too hard to implement.

1: Almost all other linting is done later in the Sphinx run, when each doc's DOM is available. 2: i.e., current_indent + INDENT_STEP (2 spaces atm to make longer docs with deeper nesting easier to work with). Since many nested elements can end at once, de-indents can only be validated as some multiple of INDENT_STEP 3: The RST parser requires a blank line after many elements, but it doesn't care if you use more than one.