Skip to content

Commit

Permalink
Merge pull request #58 from vinayak-mehta/remove-italics-support
Browse files Browse the repository at this point in the history
[MRG] Remove italics support
  • Loading branch information
vinayak-mehta authored Aug 31, 2020
2 parents b79ed72 + d72ccaa commit 6ff721d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 28 deletions.
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

0 comments on commit 6ff721d

Please sign in to comment.