Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Remove italics support #58

Merged
merged 2 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Release History
master
------

0.5.1 (2020-08-31)
------------------

**Bugfixes**

* [#48](https://github.com/vinayak-mehta/present/issues/48), [#54](https://github.com/vinayak-mehta/present/issues/54), [#52](https://github.com/vinayak-mehta/present/issues/52) Remove italics support temporarily. [#58](https://github.com/vinayak-mehta/present/pull/58) by Vinayak Mehta.
* [#55](https://github.com/vinayak-mehta/present/issues/55) Yank versions older than `0.5.0` from PyPI because they didn't have `python_requires>=3.7`.

0.5.0 (2020-08-30)
------------------

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ This is normal text

This is **bold text**

This is *italic text*

This is `inline code`

This is a [link](www.google.com)
Expand Down
2 changes: 1 addition & 1 deletion docs/codio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ You can add colors and styles to your output like this:
color: green
bold: true

Currently, these colors are supported: ``black``, ``red``, ``green``, ``yellow``, ``blue``, ``magenta``, ``cyan``, ``white``. In terms of styles, ``bold`` and ``underline`` are supported. (``italics`` coming soon!)
Currently, these colors are supported: ``black``, ``red``, ``green``, ``yellow``, ``blue``, ``magenta``, ``cyan``, ``white``. And these styles are supported: ``bold`` and ``underline``. (``italics`` coming soon!)

You can add progress bars too. To add one, just set ``progress`` to ``true`` and add a progress character for your progress bar using ``progressChar``. The default ``progressChar`` is ``█``.

Expand Down
2 changes: 0 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ Text

This is **bold text**

This is *italic text*

This is `inline code`

This is a [link](www.google.com)
Expand Down
2 changes: 0 additions & 2 deletions examples/sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ This is normal text

This is **bold text**

This is *italic text*

This is `inline code`

This is a [link](www.google.com)
Expand Down
2 changes: 1 addition & 1 deletion present/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

VERSION = (0, 5, 0)
VERSION = (0, 5, 1)
PRERELEASE = None # alpha, beta or rc
REVISION = None

Expand Down
5 changes: 0 additions & 5 deletions present/effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

from random import randint, choice

import asciimatics.renderers

asciimatics.renderers.ATTRIBUTES["5"] = 5

from asciimatics.effects import Print
from asciimatics.screen import Screen
from asciimatics.effects import Stars, Matrix
Expand All @@ -20,7 +16,6 @@


ATTRS = {
"italic": 5,
"bold": Screen.A_BOLD,
"normal": Screen.A_NORMAL,
"reverse": Screen.A_REVERSE,
Expand Down
9 changes: 3 additions & 6 deletions present/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class Emphasis(object):
type: str = "emphasis"
obj: dict = None
fg: int = 0
attr: int = 5 # Screen.A_ITALIC
attr: int = 2 # Screen.A_NORMAL
normal: int = 2 # Screen.A_NORMAL
bg: int = 7

Expand All @@ -328,11 +328,8 @@ def size(self):
raise NotImplementedError

def render(self):
return (
f"${{{self.fg},{self.attr},{self.bg}}}"
+ self.obj["children"][0]["text"]
+ f"${{{self.fg},{self.normal},{self.bg}}}"
)
# TODO: add italic support
return self.obj["children"][0]["text"]


@dataclass
Expand Down
10 changes: 1 addition & 9 deletions present/slideshow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import time

from asciimatics.scene import Scene
from asciimatics.screen import Screen
from asciimatics.effects import Print
from asciimatics.event import KeyboardEvent
from asciimatics.screen import Screen, _CursesScreen
from asciimatics.exceptions import ResizeScreenError, StopApplication

from .effects import (
Expand Down Expand Up @@ -88,14 +88,6 @@ def __init__(self, slides):

def __enter__(self):
self.screen = Screen.open()

if isinstance(self.screen, _CursesScreen):
import curses

self.screen.A_ITALIC = 5
self.screen._a_italic = curses.tigetstr("sitm").decode("utf-8")
self.screen._ATTRIBUTES[self.screen.A_ITALIC] = self.screen._a_italic

return self

def __exit__(self, type, value, traceback):
Expand Down