yamper


Nameyamper JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryA Markdown to HTML converter
upload_time2024-08-13 16:33:41
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # yamper

yamper is a simple Markdown to HTML converter/compiler. It allows users to easily convert Markdown files to HTML, with options for different templates and token output.

## :star2: Features

### Available Features
- Headers
- Paragraphs
- Bold, Italic and strikethrough text
- Links
- Images
- Unordered lists
- Ordered lists
- Blockquotes
- Code blocks
- Inline code
- Horizontal rules
- GitHub emojis :wink:

### :construction: Features in Development
- Tables
- Alerts
- Footnotes
- Nested lists
- Nested quotes

## :package: Installation

You can install yamper using pip:

```bash
pip install yamper
```

## :computer: Usage

### Command Line Interface

yamper provides a command-line interface for easy conversion of Markdown files to HTML.

Basic usage:

```bash
yamper path/to/your/markdown_file.md
```

Options:

- `--out`: Specify the output file name
- `-t, --template`: Choose a template (options: "standard-light", "standard-dark", "plain")
- `--tokens`: Output tokens instead of HTML

Examples:

```bash
# Convert to HTML with default template
yamper ../path/input.md --out output.html

# Convert to HTML with dark template
yamper ../path/input.md --out output.html -t standard-dark

# Output tokens
yamper ../path/input.md --tokens --out tokens.txt
```

### :wrench: Using yamper in Your Python Projects

You can also use yamper in your Python projects by importing its functions:

```python
from yamper import to_html, to_tokens

# Convert Markdown to HTML and output to a new file
to_html('path/to/your/markdown_file.md', 'output.html', 'standard-dark')
or 
# Directly print the HTML content
html_content= to_html('path/to/your/markdown_file.md')
print(html_content)

# Get tokens from Markdown and output to a new file
tokens = to_tokens('path/to/your/markdown_file.md', 'tokens.txt')
or
# Directly print the tokens
to_tokens('path/to/your/markdown_file.md', 'tokens.txt')
print(tokens)
```

## :art: Templates

yamper currently offers three templates:

1. `standard-light` (default): A light theme with built-in styles and code highlighting using [Prism.js](https://prismjs.com/)
2. `standard-dark`: A dark theme with built-in styles and code highlighting using [Prism.js](https://prismjs.com/)
3. `plain`: A basic HTML output without any additional styling or code highlighting

## :gear: API Reference

### `to_html(md_file, output_file=None, template="standard-light")`

Converts a Markdown file to HTML.

- `md_file`: Path to the input Markdown file
- `output_file`: (Optional) Path to the output HTML file
- `template`: (Optional) Template to use for HTML output

Returns the HTML content as a string if `output_file` is not specified.

### `to_tokens(md_file, output_file=None)`

Generates tokens from a Markdown file.

- `md_file`: Path to the input Markdown file
- `output_file`: (Optional) Path to the output token file

Returns the list of tokens if `output_file` is not specified.

## :warning: Disclaimer

The HTML output generated by yamper is **not automatically sanitized**. This means that any potentially harmful or malicious content within the Markdown input will be directly reflected in the resulting HTML file. Users should be cautious when processing untrusted or user-generated content.

## :bulb: Recommendation

If you intend to display the generated HTML on a website or share it publicly, it is strongly advised to manually review and sanitize the content, or use a dedicated HTML sanitizer to mitigate potential security vulnerabilities.


## :handshake: Contributing

Contributions to yamper are welcome! Please feel free to submit a Pull Request.

## :scroll: License

This project is licensed under the GPL-3.0 license.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "yamper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Deepak <hey.usedeep@email.com>",
    "download_url": "https://files.pythonhosted.org/packages/3c/46/f34df69bd484c3018708a56b53d243ea781a33abc6d7c7c9bf57305cb86a/yamper-0.1.0.tar.gz",
    "platform": null,
    "description": "# yamper\n\nyamper is a simple Markdown to HTML converter/compiler. It allows users to easily convert Markdown files to HTML, with options for different templates and token output.\n\n## :star2: Features\n\n### Available Features\n- Headers\n- Paragraphs\n- Bold, Italic and strikethrough text\n- Links\n- Images\n- Unordered lists\n- Ordered lists\n- Blockquotes\n- Code blocks\n- Inline code\n- Horizontal rules\n- GitHub emojis :wink:\n\n### :construction: Features in Development\n- Tables\n- Alerts\n- Footnotes\n- Nested lists\n- Nested quotes\n\n## :package: Installation\n\nYou can install yamper using pip:\n\n```bash\npip install yamper\n```\n\n## :computer: Usage\n\n### Command Line Interface\n\nyamper provides a command-line interface for easy conversion of Markdown files to HTML.\n\nBasic usage:\n\n```bash\nyamper path/to/your/markdown_file.md\n```\n\nOptions:\n\n- `--out`: Specify the output file name\n- `-t, --template`: Choose a template (options: \"standard-light\", \"standard-dark\", \"plain\")\n- `--tokens`: Output tokens instead of HTML\n\nExamples:\n\n```bash\n# Convert to HTML with default template\nyamper ../path/input.md --out output.html\n\n# Convert to HTML with dark template\nyamper ../path/input.md --out output.html -t standard-dark\n\n# Output tokens\nyamper ../path/input.md --tokens --out tokens.txt\n```\n\n### :wrench: Using yamper in Your Python Projects\n\nYou can also use yamper in your Python projects by importing its functions:\n\n```python\nfrom yamper import to_html, to_tokens\n\n# Convert Markdown to HTML and output to a new file\nto_html('path/to/your/markdown_file.md', 'output.html', 'standard-dark')\nor \n# Directly print the HTML content\nhtml_content= to_html('path/to/your/markdown_file.md')\nprint(html_content)\n\n# Get tokens from Markdown and output to a new file\ntokens = to_tokens('path/to/your/markdown_file.md', 'tokens.txt')\nor\n# Directly print the tokens\nto_tokens('path/to/your/markdown_file.md', 'tokens.txt')\nprint(tokens)\n```\n\n## :art: Templates\n\nyamper currently offers three templates:\n\n1. `standard-light` (default): A light theme with built-in styles and code highlighting using [Prism.js](https://prismjs.com/)\n2. `standard-dark`: A dark theme with built-in styles and code highlighting using [Prism.js](https://prismjs.com/)\n3. `plain`: A basic HTML output without any additional styling or code highlighting\n\n## :gear: API Reference\n\n### `to_html(md_file, output_file=None, template=\"standard-light\")`\n\nConverts a Markdown file to HTML.\n\n- `md_file`: Path to the input Markdown file\n- `output_file`: (Optional) Path to the output HTML file\n- `template`: (Optional) Template to use for HTML output\n\nReturns the HTML content as a string if `output_file` is not specified.\n\n### `to_tokens(md_file, output_file=None)`\n\nGenerates tokens from a Markdown file.\n\n- `md_file`: Path to the input Markdown file\n- `output_file`: (Optional) Path to the output token file\n\nReturns the list of tokens if `output_file` is not specified.\n\n## :warning: Disclaimer\n\nThe HTML output generated by yamper is **not automatically sanitized**. This means that any potentially harmful or malicious content within the Markdown input will be directly reflected in the resulting HTML file. Users should be cautious when processing untrusted or user-generated content.\n\n## :bulb: Recommendation\n\nIf you intend to display the generated HTML on a website or share it publicly, it is strongly advised to manually review and sanitize the content, or use a dedicated HTML sanitizer to mitigate potential security vulnerabilities.\n\n\n## :handshake: Contributing\n\nContributions to yamper are welcome! Please feel free to submit a Pull Request.\n\n## :scroll: License\n\nThis project is licensed under the GPL-3.0 license.",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Markdown to HTML converter",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/useDeep/yamper",
        "Issues": "https://github.com/useDeep/yamper/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "13979bb4e770021e5fd98a64831669ec00d4d2eda488a75e36541780d2a4743b",
                "md5": "9c2a1217b6def337b4d4b65ea129b681",
                "sha256": "129fd15603e68db690d288b16b691040a4f20e07c79c4167fdbc7cba726b85cc"
            },
            "downloads": -1,
            "filename": "yamper-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9c2a1217b6def337b4d4b65ea129b681",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 42784,
            "upload_time": "2024-08-13T16:33:38",
            "upload_time_iso_8601": "2024-08-13T16:33:38.616909Z",
            "url": "https://files.pythonhosted.org/packages/13/97/9bb4e770021e5fd98a64831669ec00d4d2eda488a75e36541780d2a4743b/yamper-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c46f34df69bd484c3018708a56b53d243ea781a33abc6d7c7c9bf57305cb86a",
                "md5": "8c88c5a31dc8504380b647d5038aa927",
                "sha256": "4494da4613b90315c8e3d73e81419d93ba7aa3cc0fd2dceeb1b4cea55e31b0b0"
            },
            "downloads": -1,
            "filename": "yamper-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8c88c5a31dc8504380b647d5038aa927",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 43287,
            "upload_time": "2024-08-13T16:33:41",
            "upload_time_iso_8601": "2024-08-13T16:33:41.269658Z",
            "url": "https://files.pythonhosted.org/packages/3c/46/f34df69bd484c3018708a56b53d243ea781a33abc6d7c7c9bf57305cb86a/yamper-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-13 16:33:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "useDeep",
    "github_project": "yamper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "yamper"
}
        
Elapsed time: 0.41847s