{"id":22799174,"url":"https://github.com/mhackfly/markdown2html","last_synced_at":"2025-09-15T02:09:47.609Z","repository":{"id":247227838,"uuid":"823138835","full_name":"mhackfly/markdown2html","owner":"mhackfly","description":"markdown2html is a Python script that converts a Markdown file to HTML, transforms \u003ch3\u003e tags into \u003ca href\u003e tags to create an index, and identifies special tags to highlight code.","archived":false,"fork":false,"pushed_at":"2024-08-07T14:23:12.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T19:15:05.724Z","etag":null,"topics":["convert","html-css","markdown","markdown2html","pygmentize","pygments","python"],"latest_commit_sha":null,"homepage":"https://www.micro66.fr/projets/markdown2html/article.html","language":"HTML","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/mhackfly.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":"2024-07-02T13:24:20.000Z","updated_at":"2024-09-06T19:47:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"eaa6e59b-06b0-4a28-814b-e895f2b0672a","html_url":"https://github.com/mhackfly/markdown2html","commit_stats":null,"previous_names":["mhackfly/markdown2html"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mhackfly/markdown2html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhackfly%2Fmarkdown2html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhackfly%2Fmarkdown2html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhackfly%2Fmarkdown2html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhackfly%2Fmarkdown2html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhackfly","download_url":"https://codeload.github.com/mhackfly/markdown2html/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhackfly%2Fmarkdown2html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275194018,"owners_count":25421441,"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-09-15T02:00:09.272Z","response_time":75,"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":["convert","html-css","markdown","markdown2html","pygmentize","pygments","python"],"created_at":"2024-12-12T07:08:13.294Z","updated_at":"2025-09-15T02:09:47.572Z","avatar_url":"https://github.com/mhackfly.png","language":"HTML","readme":"## markdown2html\n\n**Description**\n\n`markdown2html.py` is a Python script that converts a Markdown file to HTML. It performs the following tasks:\n\n1. It transforms `\u003ch3\u003e` tags into `\u003ca href\u003e` tags, creating sections with unique identifiers.\n2. These anchors are added to a `sections.html` file.\n3. In the `index` file, you can add links to other files by inserting a hyphen (`-`)\nbefore the file name (e.g., `[-my PDF](document.pdf)`).\n4. The script identifies special code blocks delimited by `\u003c!--program\u003e` and `\u003cprogram--\u003e`.\nThese blocks define code display areas with attributes and highlight the code using Pygments,\na syntax highlighting tool.\n5. It creates the HTML file by integrating the `markdown2html.css` and `markdown.css` files.\n6. `markdown2html.css` defines the style for the HTML page, while `markdown.css` styles the Markdown file.\n\n**Usage**\n\n1. Create a directory with the files `markdown2html.py`, `markdown2html.css`, and `markdown.css`.\n2. Execute the Python script with your Markdown file:\n   ```\n   python3 markdown2html.py my_file.md\n   ```\n3. A directory named `my_file` will be created, containing three files:\n   - `article.html`: the main HTML file.\n   - `article.md`: a copy of the Markdown file.\n   - `sections.html`: an index of links created using `###` and `[-...]()` tags.\n\n**Dependency**\n\n- Pygments: Download and install it or use `pip install Pygments`.\n  Example usage: `pygmentize -S paraiso-dark -f html -a .codehilite`\n\n**Program Tags**\n\n- Attributes must be placed between `\u003c!-- program\u003e ... \u003cprogram --\u003e`.\n- The first series of attributes (`number-...`) customizes line numbers.\n- The `box-...` series relates to the box and code appearance.\n- The last attributes in the list (`language` and `theme`) correspond to Pygments options.\n- In the \"tags\" section, when specifying the `code` attribute, you can provide either an\nexisting file name or if you want to write the code directly, you can do so as follows:\n\n```\n\u003c!-- program\u003e\n...\nlanguage: python\ntheme: fruity\ncode:\nprint(\"Hello\")\nprint(\"World!\")\n\u003cprogram --\u003e\n```\n\nWith the existing file:\n\n```\n\u003c!-- program\u003e\n...\nlanguage: js\ntheme: github-dark\ncode: script.js\n\u003cprogram --\u003e\n```\n\n**Examples**\n\n[micro66](https://www.micro66.fr/github/markdown2html/example/article.html)\n\n```\n\u003c!-- program\u003e\nnumber: 0\nnumber-color:\nnumber-background-color:\nnumber-border:\nnumber-border-radius:\nnumber-padding-left-right:\nnumber-margin-left:\nnumber-margin-right:\nnumber-font-weight:\nbox-background: #171932;\nbox-border:\nbox-border-radius: 10px\nbox-shadow: inset 10px 10px 10px rgba(0,0,0,.7);\nbox-font-size: 10px\nbox-font-family: Source Code Pro\nbox-line-height: 120%\nbox-width: 80%\nbox-height: 300px\nbox-margin-top: 10px\nbox-margin-bottom: 10px\nbox-margin-left: 10px\nbox-margin-right: 10px\nlanguage: python\ntheme: fruity\ncode: code_example_1.py\n\u003cprogram --\u003e\n```\n\nIn the \"Examples\" section, many attributes are listed without values.\nThese attributes are optional and are used to customize the appearance of the code block.\nIf an attribute is not specified, the program will use default values.\nYou can experiment with different values to achieve the desired look for your code block.\n\nFeel free to experiment with different values for your code block appearance! 😊\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhackfly%2Fmarkdown2html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhackfly%2Fmarkdown2html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhackfly%2Fmarkdown2html/lists"}