lektor-markdown-ruby-blocks


Namelektor-markdown-ruby-blocks JSON
Version 0.2.4 PyPI version JSON
download
home_page
SummaryIntroduces a new syntax to Markdown for generating HTML ruby tags
upload_time2023-05-09 08:53:48
maintainer
docs_urlNone
author
requires_python>=3.6
licenseMIT License
keywords html lektor markdown plugin ruby-tag
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # lektor-markdown-ruby-blocks

This is a simple Lektor plugin that adds support for
HTML ruby tags to Markdown.

## Syntax 

To create a ruby tag, use the following **ruby-block** syntax:

```markdown
^^
(歩)[ある]く
^^
```

This will generate the following HTML:
```html
<span class="ruby-line">
  <ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
```

The rendering result:

<p>
<span class="ruby-line">
  <ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
</p>

You can combine adjacent ruby text like this:
```markdown
^^
(自|分)[じ|ぶん]
^^
```

And this will be rendered like this:
```html
<span class="ruby-line">
  <ruby>自<rp>(</rp><rt>じ</rt><rp>)</rp></ruby>
  <ruby>分<rp>(</rp><rt>ぶん</rt><rp>)</rp></ruby>
</span>
```

Rendered output:

<span class="ruby-line">
  <ruby>自<rp>(</rp><rt>じ</rt><rp>)</rp></ruby>
  <ruby>分<rp>(</rp><rt>ぶん</rt><rp>)</rp></ruby>
</span>

### Newline

This plugin will automatically add `<br />` between each line in a ruby-block:
```markdown
^^
(歩)[ある]く
(歩)[ある]く
^^
```
This will output:
```html
<span class="ruby-line">
  <ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
<br />
<span class="ruby-line">
  <ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
```

You can also use `-##-` to create an extra newline in a ruby-block. 
```markdown
^^
(歩)[ある]く
-##-
(歩)[ある]く
^^
```

Output:
```html
<span class="ruby-line">
  <ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
<br />
<br />
<span class="ruby-line">
  <ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
```

### Coloring the text

Additionally, you can add a 6-digit or 8-digit hex RGB code 
after the beginning `^^`, making the rendered content colored 
with specified color.

```markdown
^^#44cc00
(歩)[ある]く
^^
```

This will generate the following HTML pieces:
```html
<span class="ruby-line" style="color: #44cc00">
  <ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
```

### Raw lines
Prepend `% ` &nbsp;to create a raw line. Raw lines are not converted to ruby tags, 
not affected by the color settings, and have a different class.

Example:
```markdown
^^#44cc00
(歩)[ある]く
% (aru)[ku]
^^
```

Output:
```html
<span class="ruby-line" style="color: #44cc00">
  <ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
<br />
<span class="non-ruby-line">
  (aru)[ku]
</span>
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "lektor-markdown-ruby-blocks",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "HTML,Lektor,Markdown,plugin,ruby-tag",
    "author": "",
    "author_email": "25349023 <25349023.qq@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a0/30/b4c37cead313ee288cbe5fc0408a1d2a51834adf4d5f99932e2082938139/lektor_markdown_ruby_blocks-0.2.4.tar.gz",
    "platform": null,
    "description": "# lektor-markdown-ruby-blocks\n\nThis is a simple Lektor plugin that adds support for\nHTML ruby tags to Markdown.\n\n## Syntax \n\nTo create a ruby tag, use the following **ruby-block** syntax:\n\n```markdown\n^^\n(\u6b69)[\u3042\u308b]\u304f\n^^\n```\n\nThis will generate the following HTML:\n```html\n<span class=\"ruby-line\">\n  <ruby>\u6b69<rp>(</rp><rt>\u3042\u308b</rt><rp>)</rp></ruby>\u304f\n</span>\n```\n\nThe rendering result:\n\n<p>\n<span class=\"ruby-line\">\n  <ruby>\u6b69<rp>(</rp><rt>\u3042\u308b</rt><rp>)</rp></ruby>\u304f\n</span>\n</p>\n\nYou can combine adjacent ruby text like this:\n```markdown\n^^\n(\u81ea|\u5206)[\u3058|\u3076\u3093]\n^^\n```\n\nAnd this will be rendered like this:\n```html\n<span class=\"ruby-line\">\n  <ruby>\u81ea<rp>(</rp><rt>\u3058</rt><rp>)</rp></ruby>\n  <ruby>\u5206<rp>(</rp><rt>\u3076\u3093</rt><rp>)</rp></ruby>\n</span>\n```\n\nRendered output:\n\n<span class=\"ruby-line\">\n  <ruby>\u81ea<rp>(</rp><rt>\u3058</rt><rp>)</rp></ruby>\n  <ruby>\u5206<rp>(</rp><rt>\u3076\u3093</rt><rp>)</rp></ruby>\n</span>\n\n### Newline\n\nThis plugin will automatically add `<br />` between each line in a ruby-block:\n```markdown\n^^\n(\u6b69)[\u3042\u308b]\u304f\n(\u6b69)[\u3042\u308b]\u304f\n^^\n```\nThis will output:\n```html\n<span class=\"ruby-line\">\n  <ruby>\u6b69<rp>(</rp><rt>\u3042\u308b</rt><rp>)</rp></ruby>\u304f\n</span>\n<br />\n<span class=\"ruby-line\">\n  <ruby>\u6b69<rp>(</rp><rt>\u3042\u308b</rt><rp>)</rp></ruby>\u304f\n</span>\n```\n\nYou can also use `-##-` to create an extra newline in a ruby-block. \n```markdown\n^^\n(\u6b69)[\u3042\u308b]\u304f\n-##-\n(\u6b69)[\u3042\u308b]\u304f\n^^\n```\n\nOutput:\n```html\n<span class=\"ruby-line\">\n  <ruby>\u6b69<rp>(</rp><rt>\u3042\u308b</rt><rp>)</rp></ruby>\u304f\n</span>\n<br />\n<br />\n<span class=\"ruby-line\">\n  <ruby>\u6b69<rp>(</rp><rt>\u3042\u308b</rt><rp>)</rp></ruby>\u304f\n</span>\n```\n\n### Coloring the text\n\nAdditionally, you can add a 6-digit or 8-digit hex RGB code \nafter the beginning `^^`, making the rendered content colored \nwith specified color.\n\n```markdown\n^^#44cc00\n(\u6b69)[\u3042\u308b]\u304f\n^^\n```\n\nThis will generate the following HTML pieces:\n```html\n<span class=\"ruby-line\" style=\"color: #44cc00\">\n  <ruby>\u6b69<rp>(</rp><rt>\u3042\u308b</rt><rp>)</rp></ruby>\u304f\n</span>\n```\n\n### Raw lines\nPrepend `% ` &nbsp;to create a raw line. Raw lines are not converted to ruby tags, \nnot affected by the color settings, and have a different class.\n\nExample:\n```markdown\n^^#44cc00\n(\u6b69)[\u3042\u308b]\u304f\n% (aru)[ku]\n^^\n```\n\nOutput:\n```html\n<span class=\"ruby-line\" style=\"color: #44cc00\">\n  <ruby>\u6b69<rp>(</rp><rt>\u3042\u308b</rt><rp>)</rp></ruby>\u304f\n</span>\n<br />\n<span class=\"non-ruby-line\">\n  (aru)[ku]\n</span>\n```\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Introduces a new syntax to Markdown for generating HTML ruby tags",
    "version": "0.2.4",
    "project_urls": {
        "Homepage": "https://github.com/25349023/lektor-markdown-ruby-blocks"
    },
    "split_keywords": [
        "html",
        "lektor",
        "markdown",
        "plugin",
        "ruby-tag"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f9d62e21bab0d40e40a237ce3da375a9a78b3abe067f9c03594c7a7f9bd7539",
                "md5": "4466aaa3ae8869b7837deab9bd65c6e1",
                "sha256": "d587a4df1a8039795a8442afddcc51bf4562fdd3e047a90ff746eb17bddb02f8"
            },
            "downloads": -1,
            "filename": "lektor_markdown_ruby_blocks-0.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4466aaa3ae8869b7837deab9bd65c6e1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4289,
            "upload_time": "2023-05-09T08:53:46",
            "upload_time_iso_8601": "2023-05-09T08:53:46.074310Z",
            "url": "https://files.pythonhosted.org/packages/1f/9d/62e21bab0d40e40a237ce3da375a9a78b3abe067f9c03594c7a7f9bd7539/lektor_markdown_ruby_blocks-0.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a030b4c37cead313ee288cbe5fc0408a1d2a51834adf4d5f99932e2082938139",
                "md5": "8ecc612e3645b786e14b596269fa18a9",
                "sha256": "723338b2ca4cf315d54d0659f00234bed9e9323e857359a787eb9a5610814d7e"
            },
            "downloads": -1,
            "filename": "lektor_markdown_ruby_blocks-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "8ecc612e3645b786e14b596269fa18a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3778,
            "upload_time": "2023-05-09T08:53:48",
            "upload_time_iso_8601": "2023-05-09T08:53:48.283167Z",
            "url": "https://files.pythonhosted.org/packages/a0/30/b4c37cead313ee288cbe5fc0408a1d2a51834adf4d5f99932e2082938139/lektor_markdown_ruby_blocks-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-09 08:53:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "25349023",
    "github_project": "lektor-markdown-ruby-blocks",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "lektor-markdown-ruby-blocks"
}
        
Elapsed time: 0.22954s