Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmueller committed Nov 27, 2024
1 parent 4c845f9 commit 517f030
Show file tree
Hide file tree
Showing 3 changed files with 408 additions and 51 deletions.
116 changes: 102 additions & 14 deletions docs/manual/development.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[source,bash]
----
git clone https://github.com/yourusername/asciidoc-linter.git
git clone https://github.com/docToolchain/asciidoc-linter.git
cd asciidoc-linter
----

Expand All @@ -28,17 +28,45 @@ asciidoc-linter/
├── asciidoc_linter/ # Main package
│ ├── __init__.py
│ ├── cli.py # Command line interface
│ ├── rules.py # Base rule classes
│ ├── heading_rules.py # Heading-specific rules
│ ├── rules/ # Rule implementations
│ │ ├── __init__.py
│ │ ├── base.py # Base classes for rules
│ │ ├── heading_rules.py
│ │ ├── block_rules.py
│ │ ├── whitespace_rules.py
│ │ └── image_rules.py
│ ├── parser.py # AsciiDoc parser
│ └── reporter.py # Output formatters
├── tests/ # Test files
│ └── rules/
│ └── test_heading_rules.py
│ └── rules/ # Rule-specific tests
├── docs/ # Documentation
└── README.adoc
----

== Current Implementation Status

=== Implemented Features

* Core rule engine with base classes
* Rule implementations:
** Heading rules (hierarchy, format, multiple top-level)
** Block rules (termination, spacing)
** Whitespace rules (spacing, formatting)
** Image rules (attributes, file verification)
* Basic command line interface
* Multiple output formats (console, JSON, HTML)
* Comprehensive test suite

=== Planned Features

* Configuration system (YAML/JSON)
** Rule enabling/disabling
** Severity customization
** Custom rule parameters
* Additional rule types
* IDE integration
* Git hooks

== Adding New Rules

=== Rule Implementation Steps
Expand All @@ -47,12 +75,17 @@ asciidoc-linter/
+
[source,python]
----
from .rules import Rule, Finding, Severity, Position
from .base import Rule, Finding, Severity, Position
class MyNewRule(Rule):
"""
RULE_ID: Short description.
Detailed explanation of what the rule checks.
"""
def __init__(self):
super().__init__()
self.id = "NEW001"
self.id = "RULE_ID"
@property
def description(self) -> str:
Expand All @@ -64,7 +97,26 @@ class MyNewRule(Rule):
return findings
----

2. Add tests for the rule
2. Add tests for the rule:
+
[source,python]
----
class TestMyNewRule(unittest.TestCase):
def setUp(self):
self.rule = MyNewRule()
def test_valid_case(self):
content = "Valid content"
findings = self.rule.check(content)
self.assertEqual(len(findings), 0)
def test_invalid_case(self):
content = "Invalid content"
findings = self.rule.check(content)
self.assertEqual(len(findings), 1)
self.assertEqual(findings[0].rule_id, "RULE_ID")
----

3. Register the rule in the linter
4. Update documentation

Expand All @@ -74,36 +126,72 @@ class MyNewRule(Rule):
* Meaningful error messages
* Proper severity levels
* Contextual information in findings
* Comprehensive test cases
* Documentation with examples

== Code Style

=== Python Guidelines

* Follow PEP 8
* Use type hints
* Write docstrings
* Keep functions focused
* Write docstrings (Google style)
* Keep functions focused and testable
* Maximum line length: 100 characters
* Use meaningful variable names

=== Documentation Guidelines

* Use AsciiDoc format
* Include examples
* Include examples for all features
* Explain error messages
* Document configuration options
* Keep README.adoc up to date

== Testing

=== Running Tests

[source,bash]
----
# Run all tests
python run_tests.py
# Run specific test file
python -m unittest tests/rules/test_heading_rules.py
# Run specific test case
python -m unittest tests.rules.test_heading_rules.TestHeadingHierarchyRule
----

=== Test Guidelines

* Write tests for all new features
* Include both positive and negative test cases
* Test edge cases
* Maintain high test coverage
* Use meaningful test names

== Pull Request Process

1. Create feature branch
2. Implement changes
3. Add/update tests
4. Update documentation
5. Submit PR
5. Run full test suite
6. Submit PR

== Release Process

1. Update version number
1. Update version number in __init__.py
2. Update changelog
3. Run full test suite
4. Create release notes
5. Tag release
6. Build and publish
6. Build and publish

== Getting Help

* GitHub Issues: https://github.com/docToolchain/asciidoc-linter/issues
* Project Wiki: https://github.com/docToolchain/asciidoc-linter/wiki
* docToolchain Community: https://doctoolchain.org/community
80 changes: 64 additions & 16 deletions docs/manual/introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,34 @@

AsciiDoc Linter is a Python-based tool designed to help maintain high-quality AsciiDoc documentation. It checks your AsciiDoc files for common issues and style violations, helping teams maintain consistent documentation standards.

As part of the docToolchain project (https://doctoolchain.org), it integrates well with existing documentation workflows.

== Key Features

* Heading structure validation
* Format checking
* Style consistency enforcement
* Multiple output formats
* Configurable rules
** Proper hierarchy (no skipped levels)
** Consistent formatting
** Single top-level heading
* Block validation
** Proper block termination
** Consistent spacing
* Whitespace consistency
** Line spacing
** List formatting
** Tab detection
* Image validation
** Attribute checking
** File existence verification
* Multiple output formats (console, JSON, HTML)

== Project Goals

* Improve documentation quality
* Enforce consistent styling
* Reduce review effort
* Catch common mistakes early
* Support documentation as code
* Improve documentation quality through automated checks
* Enforce consistent styling across documentation
* Reduce manual review effort
* Catch common mistakes early in the documentation process
* Support documentation as code practices
* Integrate with existing documentation toolchains

== Technical Overview

Expand All @@ -46,19 +59,54 @@ AsciiDoc Linter is a Python-based tool designed to help maintain high-quality As
=== Prerequisites

* Python 3.8 or higher
* pip (Python package manager)
* Git (for development)
* Git (for installation)

=== Installation

=== Quick Start
[NOTE]
====
Direct installation via pip is planned for future releases. Currently, installation is done via git clone.
====

[source,bash]
----
# Clone the repository
git clone https://github.com/docToolchain/asciidoc-linter.git
# Navigate to the project directory
cd asciidoc-linter
# Install the package
pip install asciidoc-linter
pip install .
----

=== Basic Usage

# Run a basic check
asciidoc-lint your-document.adoc
[source,bash]
----
# Check a single file
asciidoc-lint document.adoc
# Check multiple files
asciidoc-lint doc1.adoc doc2.adoc
# Get help
asciidoc-lint --help
----
----

== Current Status

=== Implemented Features

* Core linting engine
* Basic rule set (headings, blocks, whitespace, images)
* Command-line interface
* Multiple output formats

=== Planned Features

* Configuration system (YAML/JSON)
* Additional rule sets (tables, links, cross-references)
* Direct installation via pip
* IDE integration
* Git pre-commit hooks
Loading

0 comments on commit 517f030

Please sign in to comment.