{"id":22469000,"url":"https://github.com/impresscms-dev/flattern-markdown-folder-structure-action","last_synced_at":"2025-08-02T08:33:04.684Z","repository":{"id":39892472,"uuid":"505178791","full_name":"impresscms-dev/flattern-markdown-folder-structure-action","owner":"impresscms-dev","description":"GitHub action to flatten file structure with markdown data","archived":false,"fork":false,"pushed_at":"2024-11-01T18:30:35.000Z","size":609,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-04T14:06:12.312Z","etag":null,"topics":["github-actions","hacktoberfest","markdown"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/impresscms-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-19T17:41:20.000Z","updated_at":"2024-08-01T18:54:52.000Z","dependencies_parsed_at":"2023-01-11T17:21:48.564Z","dependency_job_id":"965627f0-9d83-40b1-9b9a-898eee639420","html_url":"https://github.com/impresscms-dev/flattern-markdown-folder-structure-action","commit_stats":{"total_commits":84,"total_committers":3,"mean_commits":28.0,"dds":"0.27380952380952384","last_synced_commit":"7f8c40e69cacddb2dc6737a17d12681f42e8e374"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/impresscms-dev%2Fflattern-markdown-folder-structure-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/impresscms-dev%2Fflattern-markdown-folder-structure-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/impresscms-dev%2Fflattern-markdown-folder-structure-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/impresscms-dev%2Fflattern-markdown-folder-structure-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/impresscms-dev","download_url":"https://codeload.github.com/impresscms-dev/flattern-markdown-folder-structure-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228124558,"owners_count":17873170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","hacktoberfest","markdown"],"created_at":"2024-12-06T11:24:56.530Z","updated_at":"2025-08-02T08:33:04.671Z","avatar_url":"https://github.com/impresscms-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/impresscms-dev/flattern-markdown-folder-structure-action.svg)](LICENSE)\n[![GitHub release](https://img.shields.io/github/release/impresscms-dev/flattern-markdown-folder-structure-action.svg)](https://github.com/impresscms-dev/flattern-markdown-folder-structure-action/releases)\n\n# Flattern Markdown Folder Structure\n\nA GitHub Action that flattens a directory structure containing Markdown files while preserving and updating internal links between documents.\n\n## What This Action Does\n\nThis action:\n\n1. Takes a directory containing Markdown files in a nested folder structure\n2. Moves all files to the root of that directory\n3. Renames files to avoid naming conflicts (adding folder path in parentheses when needed)\n4. Updates all internal links between documents to maintain proper references\n\nThis is particularly useful for documentation generation workflows where you want a flat structure for publishing or deployment.\n\n## Usage\n\nTo use this action in your project, create a workflow in your GitHub repository similar to this example (customize as needed):\n```yaml\nname: Generate and Flatten Documentation\n\non:\n  push:\n    branches: [main, master]\n\njobs:\n  flatten_docs:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      # Generate documentation (example using PHP docs generator)\n      - name: Generate documentation\n        uses: impresscms-dev/generate-phpdocs-with-clean-phpdoc-md-action@v0.1.4\n        with:\n          class_root_namespace: YourNamespace\\\n          included_classes: YourNamespace\\**\n          output_path: ./docs/\n\n      # Flatten the documentation structure\n      - name: Flatten documentation structure\n        uses: impresscms-dev/flattern-markdown-folder-structure-action@v2\n        with:\n          path: ./docs/\n\n      # Optional: Upload the flattened docs as an artifact\n      - name: Upload documentation\n        uses: actions/upload-artifact@v4\n        with:\n          name: documentation\n          path: ./docs/\n```\n\n## Arguments\n\nThis action supports the following arguments (used with the `with` keyword):\n\n| Argument | Required | Default value | Description |\n|----------|----------|---------------|-------------|\n| path     | Yes      | -             | Path to the folder containing Markdown files that should be flattened |\n\n## How File Renaming Works\n\nWhen flattening the directory structure, the action:\n\n1. Moves all files to the root directory\n2. If filename conflicts occur, the action renames files by adding the original folder path in parentheses\n   - Example: `subfolder/document.md` becomes `document (subfolder).md`\n3. Updates all internal Markdown links to maintain proper references between documents\n\n## Examples\n\n### Before Flattening\n```\ndocs/\n├── README.md\n├── getting-started.md\n├── api/\n│   ├── endpoints.md\n│   └── authentication.md\n└── guides/\n    ├── installation.md\n    └── configuration.md\n```\n\n### After Flattening\n```\ndocs/\n├── README.md\n├── getting-started.md\n├── endpoints (api).md\n├── authentication (api).md\n├── installation (guides).md\n└── configuration (guides).md\n```\n\n## How to Contribute\n\nIf you want to add functionality or fix bugs, you can fork the repository, make your changes, and create a pull request. If you're not sure how this works, check out GitHub's [fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo) and [creating a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) guides.\n\nIf you find a bug or have questions, please use the [issues tab](https://github.com/impresscms-dev/flattern-markdown-folder-structure-action/issues) to report them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimpresscms-dev%2Fflattern-markdown-folder-structure-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimpresscms-dev%2Fflattern-markdown-folder-structure-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimpresscms-dev%2Fflattern-markdown-folder-structure-action/lists"}