# noamgoren/confluence-markdown architecture

> Architecture diagram of the GitHub repository noamgoren/confluence-markdown, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/noamgoren/confluence-markdown
- Repository: https://github.com/noamgoren/confluence-markdown

## Overview

##### Main Components
- Confluence Export Input – This represents the set of HTML files (after following the export steps outlined in the README) that serve as input to the conversion process.
- Markdown Conversion Module – Represented by the script “markdown.py”. This component reads the Confluence export folder and converts the content from HTML/wiki markup format into Markdown files.
- File Renaming Module – Represented by the script “rename_file.py”. This is used to adjust file names in the Markdown output directory, ensuring compatibility with GitHub wiki naming conventions.
- Dependencies & Environment Setup – Include components like the Python virtual environment and the required packages (as detailed in “requirements.txt”), which enable the two main conversion features.
- User/Command-Line Interface – The commands and instructions provided in the README indicate that the system is meant for use via command-line execution, so it’s useful to include an element that represents the user issuing commands.

##### Relationships and Data Flow
- The user starts by preparing a Confluence export (input). This input is then passed to the Markdown Conversion Module by executing “python markdown.py path/to/confluence/export”.
- The Markdown Conversion Module processes the input folder, performs the conversion logic, and outputs a set of Markdown-formatted files (or a Markdown-converted folder).
- Optionally, the user can invoke the File Renaming Module (“rename_file.py”) to rename specific Markdown files based on the path provided, ensuring that file names work with GitHub wiki standards.
- The dependency layer (Python virtual environment with installed packages) underpins the main functionality of both scripts.

##### Architectural Patterns and Design Principles
- Modular Design – Each Python script encapsulates a clearly defined function (conversion vs. renaming). This separation of concerns is key in the architecture.
- Command-Line Driven Flow – The design is optimized for sequential execution from the command line rather than an interactive or web-based UI.
- Lightweight Processing – The tool centers on file I/O operations and text processing, which are executed in a simple linear flow, without a complex middleware or backend server.

##### Relevant Technologies
- Python – The primary language used.
- Virtual Environment Tools – To manage Python dependencies.

##### Elements

- Then, indicate an optional process where “rename_file.py” takes the Markdown files and applies renaming rules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    U["User/Command-Line Interface"]:::user
    IE["Confluence Export (HTML)"]:::input
    M["markdown.py (Conversion Module)"]:::module
    O["Markdown Files (Output)"]:::output
    R["rename_file.py (File Renaming Module)"]:::module
    ENV["Python Virtual Env & Dependencies"]:::env

    U -->|"initiates"| IE
    IE -->|"provides_input"| M
    M -->|"generates"| O
    O -.->|"optional_renaming"| R
    ENV --- M
    ENV --- R

    click U "https://github.com/noamgoren/confluence-markdown/blob/master/README.md"
    click M "https://github.com/noamgoren/confluence-markdown/blob/master/markdown.py"
    click R "https://github.com/noamgoren/confluence-markdown/blob/master/rename_file.py"
    click ENV "https://github.com/noamgoren/confluence-markdown/blob/master/requirements.txt"

    classDef user fill:#FFCCCB,stroke:#333,stroke-width:2px;
    classDef input fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef module fill:#d5f5e3,stroke:#333,stroke-width:2px;
    classDef output fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef env fill:#e8daef,stroke:#333,stroke-width:2px;
```
