How noamgoren/confluence-markdown works
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.