redpen-cc / redpen

RedPen is an open source proofreading tool to check if your technical documents meet the writing standard. RedPen supports various markup text formats (Markdown, Textile, AsciiDoc, Re:VIEW, reStructuredText and LaTeX).
https://redpen.cc
Apache License 2.0
567 stars 74 forks source link

New configuration file format #182

Open takahi-i opened 10 years ago

takahi-i commented 10 years ago

One idea is to merge the all the validator config files (dv-conf,.xml, validator-conf.xml, character-table.xml) int one. Another idea is remove property block and add the information as the properties of validator component.

<?xml version="1.0"?>
<redpen-conf>
    <validation-list">
       <component name="SentenceLength" "max_length=200"/>
       <component name="InvalidCharacter" />
       <component name="SpaceWithSymbol" />
       <component name="SectionLength" "max_char_num=2000"/>
       <component name="MaxParagraphNumber" />
    </validator-list>
    <character-table>
       <character name="EXCLAMATION_MARK" value="!" invalid-chars="!" after-space="true" />
       <character name="LEFT_QUOTATION_MARK" value="\'"  invalid-chars="“" before-space="true" />
    </character-table>
</redpen-conf>
takahi-i commented 10 years ago

This issue should be try after #144, since the code is refactored with the issue.

takahi-i commented 10 years ago

Another option is use YAML.

validation-list:
  - sentence_length max_length=200"/>
  - invalid_character
  - space_with_symbol
  - section_length 
      - max_char_num=2000
 - max_paragraph_number
character-table:
  - name: EXCLAMATION_MARK
    value: "!" 
    invalid-chars: "!"
    after-space: "true"
  - name: "LEFT_QUOTATION_MARK"
    value: "\'"
    invalid-chars: "“"
    before-space: "true"