{"id":15080922,"url":"https://github.com/gigadrive/markdownwikibundle","last_synced_at":"2025-10-05T13:30:37.277Z","repository":{"id":43150571,"uuid":"427233580","full_name":"Gigadrive/MarkdownWikiBundle","owner":"Gigadrive","description":"Symfony 5 bundle to easily create dynamic subpages with Markdown. Useful for help sections and wikis.","archived":true,"fork":false,"pushed_at":"2023-11-12T16:15:46.000Z","size":114,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-30T17:23:27.704Z","etag":null,"topics":["bundle","cms","markdown","page","php","symfony","symfony-bundle","wiki"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/gigadrive/markdown-wiki-bundle","language":"PHP","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/Gigadrive.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}},"created_at":"2021-11-12T04:39:05.000Z","updated_at":"2024-03-11T01:59:07.000Z","dependencies_parsed_at":"2022-09-06T18:50:40.952Z","dependency_job_id":null,"html_url":"https://github.com/Gigadrive/MarkdownWikiBundle","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gigadrive%2FMarkdownWikiBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gigadrive%2FMarkdownWikiBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gigadrive%2FMarkdownWikiBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gigadrive%2FMarkdownWikiBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gigadrive","download_url":"https://codeload.github.com/Gigadrive/MarkdownWikiBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235399012,"owners_count":18983814,"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":["bundle","cms","markdown","page","php","symfony","symfony-bundle","wiki"],"created_at":"2024-09-25T05:33:17.462Z","updated_at":"2025-10-05T13:30:31.968Z","avatar_url":"https://github.com/Gigadrive.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MarkdownWikiBundle\n\nThis bundle allows you to create rich subpages in a Symfony project using Markdown. Pages are stored in a file cache and sourced from an external directory, for example a Git submodule.\n\nYou can use this bundle to create help sections, information wikis or any other type of sub page, that is not supposed to be hardcoded into your Symfony codebase.\n\n## Features\n\n* Pages sourced from Markdown files\n* Page meta stored in separate YAML files\n* Multi-language support without constraints for locale codes\n* Custom implementations for parsing, storing and fetching pages\n\n## Requirements\n\n* Symfony 5.3+\n* PHP 8\n\n## Installation\n\n```bash\ncomposer require gigadrive/markdown-wiki-bundle\n```\n\n## Configuration\n\nThis bundle is configured using standard Symfony bundle configuration.\n\n```yaml\n# config/packages/markdown_wiki_bundle.yaml\nmarkdown_wiki_bundle:\n    source_directory: \"%kernel.project_dir%/example-wiki/pages/\"\n```\n\n* `source_directory` defines a path to the directory holding your source files. These are the files that make up the content and data of your wiki. For best practice, use a Git submodule.\n\n## Usage\n\nOnce you have installed and configured the bundle, you need to create a file structure for your Markdown files. You can find an example wiki for help [here](https://github.com/Gigadrive/mcskinhistory-wiki).\n\nThe file structure within your wiki directory is held simple.\n\n* Every folder represents a level of your page's path.\n* Every folder for a page needs to contain two files, one called `meta.yaml` and one called `content.md`. If you wish to support multiple languages, name these files depending on your language code. For example for an English page, call them `en.md` and `en.yaml`\n* `meta.yaml` files need to contain the following keys:\n    `title` The page's title\n    `description` The page's description\n    Any other keys will be passed on as \"custom attributes\". If you need any other data for a page, save it here.\n\n**Example:** If you want to create a page with the path `/account/creation`, you would need a folder with the path `/account/creation`. In that folder, you would create a file named `meta.yaml` and a file named `content.md`. The first contains meta data about your page, the second contains your actual page content.\n\n### Serving pages\n\nYou can find an example Controller to serve pages [here](https://github.com/Gigadrive/MarkdownWikiBundle/blob/master/src/Controller/MarkdownWikiController.php).\n\n### Customizing the parser\n\nMarkdownWikiBundle is built using [Parsedown](https://github.com/erusev/parsedown), a free and open-source library to parse Markdown with PHP. This bundle registers Parsedown as a service ([`MarkdownWikiParser`](https://github.com/Gigadrive/MarkdownWikiBundle/blob/master/src/Service/MarkdownWikiParser.php)) and uses it for parsing. To overwrite parsing behavior, do the following:\n\nFirst, create your own implementation of the parser:\n\n```php\nnamespace App\\Service;\n\nuse Gigadrive\\Bundle\\MarkdownWikiBundle\\Service\\MarkdownWikiParser;\n\nclass ExampleParser extends MarkdownWikiParser {\n    // TODO: Extend Parsedown\n}\n```\n\nNow you have a class that extends Parsedown. Refer to [Parsedown's documentation to extend parsing behavior](https://github.com/erusev/parsedown/wiki/Tutorial:-Create-Extensions) in this new service. Once you are done, register your new parser by overwriting it in the Symfony container:\n\n```yaml\n# config/services.yaml\nservices:\n    app.parser:\n        class: App\\Service\\ExampleParser\n\n    markdownwiki.parser:\n        alias: app.parser\n```\n\n### Customizing the storage\n\nBy default, pages are cached in the Symfony file cache. This behavior can be overwritten using the [`MarkdownWikiStorageInterface`](https://github.com/Gigadrive/MarkdownWikiBundle/blob/master/src/Service/Storage/MarkdownWikiStorageInterface.php). With this interface, you can create your own storage behavior and save cached pages in Redis, Doctrine or wherever you need.\n\nTo ensure that the bundle uses your storage and not the default one, the `markdownwiki.storage` container key needs to be overwritten:\n\n```yaml\n# config/services.yaml\nservices:\n    markdownwiki.storage.example:\n        class: App\\Service\\YourStorageImplementation\n\n    markdownwiki.storage:\n        alias: markdownwiki.storage.example\n```\n\n### Example Wiki\n\nThis bundle was created for the MCSkinHistory help section. You can find the source of it [here](https://github.com/Gigadrive/mcskinhistory-wiki) to help you understand the intended structure for a wiki like this.\n\n### Rebuilding the caches\n\nWhenever there is an update to the wiki pages, the internal caches of the bundle need to be rebuilt. This can be done by running the following console command, which comes with this bundle:\n\n```bash\nphp bin/console wiki:rebuild-storage-cache\n```\n\nCaches can also be rebuilt programatically through the `MarkdownWikiStorageService`:\n\n```php\nuse Gigadrive\\Bundle\\MarkdownWikiBundle\\Service\\MarkdownWikiStorageService;\n\nclass ExampleService {\n    public function __construct(\n        protected MarkdownWikiStorageService $storageService\n    ) {\n    }\n\n    public function rebuildCaches() {\n        $this-\u003estorageService-\u003erebuildStorageCache();\n    }\n}\n```\n\n## Testing\n\nThis bundle uses PHPUnit as a testing framework.\n\nWhen developing for this bundle, use the following commands to test its functionality:\n\n```\ngit submodule update --init --recursive\ncomposer install\nphp ./vendor/bin/phpunit\n```\n\n## Copyright and License\n\nThis program was developed by [Mehdi Baaboura](https://github.com/Zeryther) and published by [Gigadrive UG](https://gigadrivegroup.com) under the MIT License. For more information click [here](https://github.com/Gigadrive/MarkdownWikiBundle/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgigadrive%2Fmarkdownwikibundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgigadrive%2Fmarkdownwikibundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgigadrive%2Fmarkdownwikibundle/lists"}