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,parkingAssignees, 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ΒΆ
Edit RST files:
.. task:: Implement feature X :status: to-do :assignee: info@dingx.co :priority: High :duedate: 2025-12-31 Task description here.
Sync with JIRA:
make jira-syncBuild documentation:
make html
Updating Status TransformationsΒΆ
When JIRA status names change or new statuses are added:
Update jade.yml:
transforms: status: "To Do": to-do "In Progress": in-progress "Done": done
Update conf.py:
needs_statuses = [ {"name": "to-do", "description": "...", "color": "#d3d3d3"}, ... ]
Update sync scripts if needed:
dingx_sphinx_docs.tools.jira2needs- normalize_statusdingx_sphinx_docs.tools.jira_sphinx_sync- status_mapping
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 / plannedin-progress- Actively being worked ondone- Completedparking- On hold / blocked
JIRA Mapping:
JIRA βTo Doβ β Sphinx
to-doJIRA βIn Progressβ β Sphinx
in-progressJIRA βDoneβ β Sphinx
doneJIRA β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-123Auto-generated tasks have IDs like
TD_FINA_001
File Editing GuidelinesΒΆ
When updating RST files with task statuses:
Use
replace_all=truefor batch status updatesPreserve 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ΒΆ
Check this file (CLAUDE) first
Review relevant documentation in tools/
Check Sphinx build warnings/errors
Verify environment variables
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ΒΆ
Read JIRA Sphinx Sync for JIRA integration
Review conf.py for Sphinx configuration
Check Makefile for available commands
Study
dingx_sphinx_docs.tools.jira_sphinx_syncfor sync logic
Last updated: 2025-11-08