ghmd


Nameghmd JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryA simple CLI to convert markdown files to HTML using GitHub API using the GitHub Markdown style.
upload_time2025-01-10 10:33:34
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseNone
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

### GitHub API Token

By default, ghmd uses unauthenticated requests to the GitHub API, which has a rate limit of 60 requests per hour. To increase this limit to 5000 requests per hour, you can set the `GITHUB_TOKEN` environment variable with a GitHub personal access token:

```bash
export GITHUB_TOKEN=your_github_token_here
ghmd README.md
```

To create a personal access token, visit your [GitHub Settings > Developer Settings > Personal access tokens](https://github.com/settings/tokens) and create a new token (no specific scopes are required).

### `--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": null,
    "name": "ghmd",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "markdown, github, cli, html, converter",
    "author": null,
    "author_email": "Rom\u00e1n Via-Dufrese Saus <roman910dev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ad/87/bdb38fac147e32bb36a78b10196f31cb4ee8b0fd36f443f0250b0c455309/ghmd-0.3.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### GitHub API Token\r\n\r\nBy default, ghmd uses unauthenticated requests to the GitHub API, which has a rate limit of 60 requests per hour. To increase this limit to 5000 requests per hour, you can set the `GITHUB_TOKEN` environment variable with a GitHub personal access token:\r\n\r\n```bash\r\nexport GITHUB_TOKEN=your_github_token_here\r\nghmd README.md\r\n```\r\n\r\nTo create a personal access token, visit your [GitHub Settings > Developer Settings > Personal access tokens](https://github.com/settings/tokens) and create a new token (no specific scopes are required).\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": null,
    "summary": "A simple CLI to convert markdown files to HTML using GitHub API using the GitHub Markdown style.",
    "version": "0.3.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": "7fc70f623fe988ea04fd59fa7d4e616373c27e72b5f2de71e3d139ab1f764db9",
                "md5": "a1652d18ae90041983079d4e87c5c621",
                "sha256": "40cd68cd011f879a6afbc6f0d0813d888e2be55dd3865458442412bce2f9468a"
            },
            "downloads": -1,
            "filename": "ghmd-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a1652d18ae90041983079d4e87c5c621",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4495,
            "upload_time": "2025-01-10T10:33:29",
            "upload_time_iso_8601": "2025-01-10T10:33:29.900030Z",
            "url": "https://files.pythonhosted.org/packages/7f/c7/0f623fe988ea04fd59fa7d4e616373c27e72b5f2de71e3d139ab1f764db9/ghmd-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad87bdb38fac147e32bb36a78b10196f31cb4ee8b0fd36f443f0250b0c455309",
                "md5": "e31121dc6687905ccde004c66a01214d",
                "sha256": "68110b77ac101efcef740e11ce672e42020b42d1fd785b58c9ca664316676c4b"
            },
            "downloads": -1,
            "filename": "ghmd-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e31121dc6687905ccde004c66a01214d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4263,
            "upload_time": "2025-01-10T10:33:34",
            "upload_time_iso_8601": "2025-01-10T10:33:34.362505Z",
            "url": "https://files.pythonhosted.org/packages/ad/87/bdb38fac147e32bb36a78b10196f31cb4ee8b0fd36f443f0250b0c455309/ghmd-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-10 10:33:34",
    "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.44257s