{"id":31792871,"url":"https://github.com/christianblos/markdown2html","last_synced_at":"2025-10-10T17:29:16.787Z","repository":{"id":56952488,"uuid":"78369405","full_name":"christianblos/markdown2html","owner":"christianblos","description":"Converts markdown files to static html pages","archived":false,"fork":false,"pushed_at":"2020-10-13T16:51:56.000Z","size":735,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T13:57:23.069Z","etag":null,"topics":["hacktoberfest","markdown2html"],"latest_commit_sha":null,"homepage":"","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/christianblos.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":"2017-01-08T20:44:05.000Z","updated_at":"2020-10-13T16:49:12.000Z","dependencies_parsed_at":"2022-08-21T09:20:22.027Z","dependency_job_id":null,"html_url":"https://github.com/christianblos/markdown2html","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/christianblos/markdown2html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianblos%2Fmarkdown2html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianblos%2Fmarkdown2html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianblos%2Fmarkdown2html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianblos%2Fmarkdown2html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christianblos","download_url":"https://codeload.github.com/christianblos/markdown2html/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianblos%2Fmarkdown2html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004833,"owners_count":26083784,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hacktoberfest","markdown2html"],"created_at":"2025-10-10T17:29:14.721Z","updated_at":"2025-10-10T17:29:16.778Z","avatar_url":"https://github.com/christianblos.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markdown2html\n\nConverts markdown files to static html pages.\n[See demo](http://christianblos.github.io/codedocs) (I used it to document another project of mine).\n\n\n## Installation\n\nUse composer to install the latest version: `composer require --dev christianblos/markdown2html`\n\n\n## Create html via command line\n\nFirst, you must configure markdown2html by adding a **markdown2html.config.php** file to the root folder\nof your repository:\n\n```php\n\u003c?php\n$theme        = new Markdown2Html\\Theme\\DefaultTheme();\n$theme-\u003etitle = 'My Project';\n\n$config = new \\Markdown2Html\\Config();\n\n$config-\u003esrc   = '/path/to/markdown-files';\n$config-\u003edest  = '/path/to/destination-folder'; \n$config-\u003etheme = $theme;\n\nreturn $config;\n```\n\nNow you can execute `vendor/bin/markdown2html` to create the html files in your destination folder\n\n\u003e Note: If your config file is not in the root folder of your project, you can pass it as first argument:\n\u003e `vendor/bin/markdown2html /path/to/config.php`\n\n\n## Create html via code\n\nMaybe you have your own command line tool and you want to use PHP code directly to generate the html files.\nThis is no problem:\n\n```php\n\u003c?php\n$src   = '/path/to/markdown-files';\n$dest  = '/path/to/destination-folder'; \n\n$theme        = new Markdown2Html\\Theme\\DefaultTheme();\n$theme-\u003etitle = 'My Project';\n\n$builder = new Markdown2Html\\Builder();\n$builder-\u003ebuild($src, $dest, $theme);\n```\n\n\n## Structure of Markdown files\n\nThe navigation in the generated html is based on your folder structure.\nLet's assume you have the following file structure:\n\n```txt\nmarkdown\n   |- 00.Installation.md\n   |- 01.Configuration.md\n   |- 02.Usage.md\n   |- 02.Usage\n   |     |- 00.Via-command--line.md\n   |     |- 01.Via-PHP.md\n   |\n   |- index.md\n```\n\nThe **number prefix** (like \"01.\") indicates the order of navigation items. You can omit it if the order doesn't matter.\n\nAll dashes are replaced with spaces (\"Via-PHP\" → \"Via PHP\").\nIf you want to have dashes in the navigation, use 2 or 3 dashes:\n\n- \"00.Via-command--line.md\" → \"Via command-line\" \n- \"00.Via-command---line.md\" → \"Via command - line\"\n\nIf there is a file **having the same name** as a folder (like 02.Usage and 02.Usage.md), it will be the index page\nof this folder. If you don't have the file, the index will be created automatically and contain a sub navigation.\n\nThe content of **index.md** contains the text of the html index page.\n\nIn the example above the generated navigation will look like this:\n\n```txt\nInstallation\nConfiguration\nUsage\n   Via command-line\n   Via PHP\n```\n\n\n## Default Theme\n\nThe DefaultTheme has some additional configurations you can use:\n\n```php\n\u003c?php\n$theme                = new Markdown2Html\\Theme\\DefaultTheme();\n\n// Add additional links to the navigation\n$theme-\u003enaviLinks = [\n    'Github' =\u003e 'https://github.com/christianblos'\n];\n\n// overwrite styles\n$theme-\u003eadditionalCss = 'a#header {background-color:red}';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianblos%2Fmarkdown2html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristianblos%2Fmarkdown2html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianblos%2Fmarkdown2html/lists"}