CLAUDEΒΆ

Reference Guide for Claude Code and Developers.

Repository: dingx_sphinx_docs | Local Folder: dingx_sphinx_docs | Technology: Sphinx

πŸ“‹ Project OverviewΒΆ

This project maintains comprehensive technical and business documentation for dingx using Sphinx, with integrated JIRA task management and multiple output formats.

Key Technologies:

  • Sphinx with sphinx-needs extension

  • JIRA Cloud API integration

  • Python 3.12

  • Multiple output formats: HTML, PDF, DOCX, EPUB, MD


πŸš€ Quick StartΒΆ

Building DocumentationΒΆ

# Build HTML (with automatic JIRA sync if credentials set)
make html

# Build without JIRA sync
SKIP_JIRA_SYNC=1 make html

# Build other formats
make latexpdf     # PDF output
make docx         # Word document
make epub         # E-book format
make markdown     # Markdown format

JIRA SynchronizationΒΆ

# Pull tasks from JIRA
make jira-pull

# Push changes to JIRA
make jira-push

# Bidirectional sync
make jira-sync

# Check sync status
make jira-status

πŸ“– Full JIRA Documentation: JIRA Sphinx Sync


πŸ“ Project StructureΒΆ

.
β”œβ”€β”€ CLAUDE.md                   # This file - main reference for AI/developers
β”œβ”€β”€ Makefile                    # Build commands and automation
β”œβ”€β”€ source/                     # Documentation source files
β”‚   β”œβ”€β”€ conf.py                 # Main Sphinx configuration
β”‚   β”œβ”€β”€ index.rst               # Documentation entry point
β”‚   β”œβ”€β”€ business/               # Business documentation
β”‚   β”‚   β”œβ”€β”€ business.rst        # Tasks overview
β”‚   β”‚   β”œβ”€β”€ corporate/          # Company, branding, legal
β”‚   β”‚   β”œβ”€β”€ finance/            # Investors, funding
β”‚   β”‚   β”œβ”€β”€ startup/            # Startup programs, support
β”‚   β”‚   └── pitch/              # Pitch deck
β”‚   β”œβ”€β”€ development/            # Development documentation
β”‚   β”œβ”€β”€ coremodel/              # Core infrastructure
β”‚   β”œβ”€β”€ design/                 # Brand and design
β”‚   └── _static/                # Static assets (logos, images)
β”œβ”€β”€ tools/                      # Utilities and sync scripts
β”‚   β”œβ”€β”€ JIRA_SPHINX_SYNC.md     # JIRA synchronization guide
β”‚   β”œβ”€β”€ vm_deployment_guide.md  # VM deployment and management guide
β”‚   β”œβ”€β”€ deploy_vm.sh            # VM deployment script
β”‚   β”œβ”€β”€ setup_jira_env.sh       # JIRA environment setup script
β”‚   β”œβ”€β”€ jira_sphinx_sync.py     # Main JIRA sync script
β”‚   β”œβ”€β”€ jira2needs.py           # JIRA to sphinx-needs converter
β”‚   β”œβ”€β”€ jade.yml                # JIRA configuration
β”‚   β”œβ”€β”€ sync_state.json         # Sync state tracking (auto-generated)
β”‚   └── convert_todos.py        # Todo to task converter
└── build/                      # Generated documentation (gitignored)

βš™οΈ Configuration FilesΒΆ

Note: For guidance on INI vs YAML configuration formats, see the Configuration File Format Best Practices guide.

conf.pyΒΆ

Main Sphinx configuration with:

  • JIRA integration settings

  • sphinx-needs task configuration

  • Theme settings (Furo)

  • Build customizations

  • Auto-sync hooks

jade.ymlΒΆ

JIRA synchronization configuration:

  • JIRA Cloud URL and authentication

  • JQL queries for task filtering

  • Field mappings (JIRA ↔ Sphinx)

  • Status transformations

MakefileΒΆ

Build automation with targets for:

  • HTML, PDF, DOCX, EPUB, MD builds

  • JIRA sync operations

  • Clean operations

  • Environment setup


🎯 Key Features¢

1. JIRA IntegrationΒΆ

Bidirectional synchronization between JIRA and Sphinx-Needs:

  • Pull tasks from JIRA into documentation

  • Push Sphinx changes back to JIRA

  • Automatic sync during builds

  • Conflict-aware synchronization

πŸ“– Details: JIRA Sphinx Sync

2. Task ManagementΒΆ

Sphinx-Needs for requirements tracking:

  • Task directives with metadata

  • Status tracking: to-do, in-progress, done, parking

  • Assignees, priorities, due dates

  • Automatic task IDs based on file position

3. Multiple Output FormatsΒΆ

Single source, multiple outputs:

  • HTML (Furo theme) - Primary output

  • PDF - Professional documentation

  • DOCX - Editable Word documents

  • EPUB - E-book format

  • MD - For GitHub/wikis

4. Automated BuildsΒΆ

  • Pre-build JIRA sync hooks

  • Auto-generation of documentation

  • Theme customizations per format

  • Warning suppression and filtering


πŸ“ Common WorkflowsΒΆ

Adding/Updating TasksΒΆ

  1. Edit RST files:

    .. task:: Implement feature X
       :status: to-do
       :assignee: info@dingx.co
       :priority: High
       :duedate: 2025-12-31
    
       Task description here.
    
  2. Sync with JIRA:

    make jira-sync
    
  3. Build documentation:

    make html
    

Updating Status TransformationsΒΆ

When JIRA status names change or new statuses are added:

  1. Update jade.yml:

    transforms:
      status:
        "To Do": to-do
        "In Progress": in-progress
        "Done": done
    
  2. Update conf.py:

    needs_statuses = [
        {"name": "to-do", "description": "...", "color": "#d3d3d3"},
        ...
    ]
    
  3. Update sync scripts if needed:

Working with Auto-Generated Task IDsΒΆ

Tasks automatically get IDs based on their position in files:

  • source/business/finance/finance.rst β†’ TD_FINA_001, TD_FINA_002, …

  • source/business/startup/startup.rst β†’ TD_STAR_001, TD_STAR_002, …

  • source/business/corporate/corporate.rst β†’ TD_CORP_001, TD_CORP_002, …

Note: Don’t manually assign IDs to non-JIRA tasks - they’re auto-generated!


πŸ”§ Important Conventions for Claude CodeΒΆ

Status ValuesΒΆ

Always use these exact status values in Sphinx:

  • to-do - Not started / planned

  • in-progress - Actively being worked on

  • done - Completed

  • parking - On hold / blocked

JIRA Mapping:

  • JIRA β€œTo Do” β†’ Sphinx to-do

  • JIRA β€œIn Progress” β†’ Sphinx in-progress

  • JIRA β€œDone” β†’ Sphinx done

  • JIRA β€œPARKING” β†’ Sphinx parking

User MappingΒΆ

  • Sphinx assignee: info@dingx.co (email format)

  • JIRA assignee: Friedrich Moehring (display name)

  • JIRA Account ID: 5f8eeffd14dd46006805afc4

Configured in dingx_sphinx_docs.tools.jira_sphinx_sync

  • _resolve_jira_user() - Sphinx β†’ JIRA

  • _resolve_sphinx_assignee() - JIRA β†’ Sphinx

Task Directive FormatΒΆ

.. task:: Task title here
   :status: to-do
   :assignee: info@dingx.co
   :priority: Medium
   :duedate: YYYY-MM-DD
   :tags: tag1, tag2

   Task description content with proper indentation.

   Multiple paragraphs are fine.

Important:

  • Task directives must NOT be indented (start at column 0)

  • Options are indented with tabs (in RST files)

  • Content is indented with tabs

  • JIRA tasks have IDs like JIRA_BUS-123

  • Auto-generated tasks have IDs like TD_FINA_001

File Editing GuidelinesΒΆ

When updating RST files with task statuses:

  • Use replace_all=true for batch status updates

  • Preserve tab indentation in RST files (not spaces)

  • Don’t modify JIRA-generated task sections manually

  • Check filters in needtable directives match status names


πŸ” Environment SetupΒΆ

JIRA CredentialsΒΆ

# Set up credentials (never commit these!)
export JIRA_USER="info@dingx.co"
export JIRA_API_TOKEN="your_api_token_here"

# Or use the setup script
./tools/setup_jira_env.sh

Get API Token: https://id.atlassian.com/manage-profile/security/api-tokens

Python Virtual EnvironmentΒΆ

# The project uses these virtual environments:
# - django_landing_simple
# - django_webapps_fullstack
# - odoo_xmlrpc_twisted
# - odoo_xmlrpc_twisted
# - ...

# Configured in `source/conf.py` sys.path

πŸ—οΈ Architecture DecisionsΒΆ

Why JIRA Sync?ΒΆ

  • Single source of truth for tasks

  • Business team uses JIRA, docs team uses RST

  • Automated synchronization prevents drift

  • Maintains task history and audit trail

Why Sphinx-Needs?ΒΆ

  • Requirements traceability

  • Task relationships and dependencies

  • Professional rendering in multiple formats

  • Integration with Sphinx ecosystem

Why Multiple Output Formats?ΒΆ

  • HTML: Interactive browsing, search, navigation

  • PDF: Professional documentation, printing, archival

  • DOCX: Editing, collaboration, corporate templates

  • EPUB: Mobile reading, offline access

Why Furo Theme?ΒΆ

  • Clean, modern design

  • Excellent mobile support

  • Fast and lightweight

  • Customizable appearance


πŸ› TroubleshootingΒΆ

JIRA Sync IssuesΒΆ

# Check credentials
make jira-status

# Verify JIRA connection
curl -u "$JIRA_USER:$JIRA_API_TOKEN" \
     https://dingx.atlassian.net/rest/api/3/myself

# Check sync state
cat tools/sync_state.json

# Manual sync with verbose output
python tools/jira_sphinx_sync.py pull

Build IssuesΒΆ

# Clean build directory
make clean

# Rebuild from scratch
make clean html

# Check for missing dependencies
pip install -r requirements.txt

# Check Python paths in conf.py
grep sys.path source/conf.py

Task Detection IssuesΒΆ

  • Ensure task directives start at column 0 (no indentation)

  • Check that task options use consistent indentation (tabs)

  • Verify status values match configured needs_statuses

  • Confirm JIRA task IDs follow pattern: JIRA_PROJECT-###


πŸ“š Additional DocumentationΒΆ

  • JIRA Sync: JIRA Sphinx Sync

  • Sphinx-Needs: https://sphinx-needs.readthedocs.io/

  • Furo Theme: https://pradyunsg.me/furo/

  • reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/


πŸ“ž Support & MaintenanceΒΆ

When Things BreakΒΆ

  1. Check this file (CLAUDE) first

  2. Review relevant documentation in tools/

  3. Check Sphinx build warnings/errors

  4. Verify environment variables

  5. Test JIRA connectivity

Regular MaintenanceΒΆ

  • Update JIRA API token annually

  • Review and update status mappings as needed

  • Clean build directory periodically

  • Keep dependencies updated


πŸŽ“ Learning ResourcesΒΆ

For Claude CodeΒΆ

This file is your primary reference. Key things to remember:

  • Always use β€œto-do” not β€œopen” for status

  • Respect tab indentation in RST files

  • JIRA sync happens automatically during HTML builds

  • User mapping: info@dingx.co ↔ Friedrich Moehring

  • Don’t manually create IDs for non-JIRA tasks

For DevelopersΒΆ


Last updated: 2025-11-08