ghmd


Nameghmd JSON
Version 0.2.0 PyPI version JSON
download
home_page
SummaryA simple CLI to convert markdown files to HTML using GitHub API using the GitHub Markdown style.
upload_time2024-01-27 09:17:17
maintainer
docs_urlNone
author
requires_python>=3.6
license
keywords markdown github cli html converter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ghmd

ghmd (GitHub Markdown) is an extremely light-weight and simple command line tool to convert GitHub Flavored Markdown (or [plain Markdown](#no-gfm)) to HTML.

It does so by using the [GitHub Markdown API](https://docs.github.com/en/free-pro-team@latest/rest/reference/markdown) in combination with [GitHub Markdown CSS](https://github.com/sindresorhus/github-markdown-css).

## Installation

```bash
pip install ghmd
```

## Usage

Simply run `ghmd` with the path to the markdown file(s) you want to convert. An HTML file will be created in the same directory as the markdown file with the same filename.

```bash
ghmd README.md
# or
ghmd README.md CONTRIBUTING.md
```

> [!NOTE]
> If you don't have the `ghmd` command available after installing, you may need to add the Python scripts directory to your PATH environment variable.
>
> Otherwise you, can use `python -m ghmd` instead of `ghmd`.

## Options

### `--embed-css`

By default, ghmd will add the remote CSS as a `<link>` tag in the HTML file. If you want to embed the CSS directly into the HTML file so that, for example, you can send the HTML file to someone else and they can view it without an internet connection, you can use the `--embed-css` option.

```bash
ghmd README.md --embed-css
```

### `--light` and `--dark`

The default CSS styles adapt to the system's dark mode setting of the reader. If you want to force the CSS to be light or dark, you can use the `--light` or `--dark` options.

```bash
ghmd README.md --light
# or
ghmd README.md --dark
```

Both `--light` and `--dark` can be used in combination with `--embed-css`.

> [!NOTE]
> Using the `--embed-css` option will result in a ~25 KB larger HTML file size (~18 KB when using `--light` or `--dark`).

### `--no-gfm`

The tool offers two modes: GitHub Flavored Markdown (gfm, default) and plain Markdown. To use the later, the `--no-gfm` option can be used:

```bash
ghmd README.md --no-gfm
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ghmd",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "markdown,github,cli,html,converter",
    "author": "",
    "author_email": "Rom\u00e1n Via-Dufrese Saus <roman910dev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ca/de/b2a396f9618c8636ae7e7682acea3737fc4a264cc69e65503157adb9aa3a/ghmd-0.2.0.tar.gz",
    "platform": null,
    "description": "# ghmd\r\n\r\nghmd (GitHub Markdown) is an extremely light-weight and simple command line tool to convert GitHub Flavored Markdown (or [plain Markdown](#no-gfm)) to HTML.\r\n\r\nIt does so by using the [GitHub Markdown API](https://docs.github.com/en/free-pro-team@latest/rest/reference/markdown) in combination with [GitHub Markdown CSS](https://github.com/sindresorhus/github-markdown-css).\r\n\r\n## Installation\r\n\r\n```bash\r\npip install ghmd\r\n```\r\n\r\n## Usage\r\n\r\nSimply run `ghmd` with the path to the markdown file(s) you want to convert. An HTML file will be created in the same directory as the markdown file with the same filename.\r\n\r\n```bash\r\nghmd README.md\r\n# or\r\nghmd README.md CONTRIBUTING.md\r\n```\r\n\r\n> [!NOTE]\r\n> If you don't have the `ghmd` command available after installing, you may need to add the Python scripts directory to your PATH environment variable.\r\n>\r\n> Otherwise you, can use `python -m ghmd` instead of `ghmd`.\r\n\r\n## Options\r\n\r\n### `--embed-css`\r\n\r\nBy default, ghmd will add the remote CSS as a `<link>` tag in the HTML file. If you want to embed the CSS directly into the HTML file so that, for example, you can send the HTML file to someone else and they can view it without an internet connection, you can use the `--embed-css` option.\r\n\r\n```bash\r\nghmd README.md --embed-css\r\n```\r\n\r\n### `--light` and `--dark`\r\n\r\nThe default CSS styles adapt to the system's dark mode setting of the reader. If you want to force the CSS to be light or dark, you can use the `--light` or `--dark` options.\r\n\r\n```bash\r\nghmd README.md --light\r\n# or\r\nghmd README.md --dark\r\n```\r\n\r\nBoth `--light` and `--dark` can be used in combination with `--embed-css`.\r\n\r\n> [!NOTE]\r\n> Using the `--embed-css` option will result in a ~25 KB larger HTML file size (~18 KB when using `--light` or `--dark`).\r\n\r\n### `--no-gfm`\r\n\r\nThe tool offers two modes: GitHub Flavored Markdown (gfm, default) and plain Markdown. To use the later, the `--no-gfm` option can be used:\r\n\r\n```bash\r\nghmd README.md --no-gfm\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A simple CLI to convert markdown files to HTML using GitHub API using the GitHub Markdown style.",
    "version": "0.2.0",
    "project_urls": {
        "Changelog": "https://github.com/roman910dev/ghmd/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/roman910dev/ghmd",
        "Repository": "https://github.com/roman910dev/ghmd.git"
    },
    "split_keywords": [
        "markdown",
        "github",
        "cli",
        "html",
        "converter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09b63d2b5d9c7088ea4150abb8786ccee358d5eeb8fcf1549b4fcbbc2d9a385b",
                "md5": "03bcd18e7fb8c1b6931a4a9619707043",
                "sha256": "a7e9aa9b3a0f3b1bc7d51516b7bf65c5dd4f9025cc1e4956665079c729f8a530"
            },
            "downloads": -1,
            "filename": "ghmd-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "03bcd18e7fb8c1b6931a4a9619707043",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4168,
            "upload_time": "2024-01-27T09:17:14",
            "upload_time_iso_8601": "2024-01-27T09:17:14.382256Z",
            "url": "https://files.pythonhosted.org/packages/09/b6/3d2b5d9c7088ea4150abb8786ccee358d5eeb8fcf1549b4fcbbc2d9a385b/ghmd-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cadeb2a396f9618c8636ae7e7682acea3737fc4a264cc69e65503157adb9aa3a",
                "md5": "89ccce30bdcb64cdb24d7f9141177b8d",
                "sha256": "4c5b179036c17c466f14b5772b1d7ab037d41f462a2615d018b728d2cf71ffbb"
            },
            "downloads": -1,
            "filename": "ghmd-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "89ccce30bdcb64cdb24d7f9141177b8d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3941,
            "upload_time": "2024-01-27T09:17:17",
            "upload_time_iso_8601": "2024-01-27T09:17:17.138785Z",
            "url": "https://files.pythonhosted.org/packages/ca/de/b2a396f9618c8636ae7e7682acea3737fc4a264cc69e65503157adb9aa3a/ghmd-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-27 09:17:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "roman910dev",
    "github_project": "ghmd",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ghmd"
}
        
Elapsed time: 0.17662s