Added new constants for document insert feature

This commit is contained in:
Veronica K. B. Olsen
2020-06-19 17:34:41 +02:00
parent 3bfe214682
commit 61856cec5b
3 changed files with 42 additions and 6 deletions
+23 -4
View File
@@ -25,7 +25,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from nw.constants.enum import nwItemClass, nwItemLayout, nwOutline
from nw.constants.enum import nwItemClass, nwItemLayout, nwOutline, nwDocInsert
class nwConst():
@@ -197,7 +197,7 @@ class nwQuotes():
# END Class nwQuotes
class nwUnicode:
"""Suppoted unicode character constants and translation maps for HTML.
"""Supported unicode character constants and translation maps for HTML.
"""
# Unicode Constants
@@ -229,10 +229,12 @@ class nwUnicode:
U_EMDASH = "\u2014" # Long dash
U_HELLIP = "\u2026" # Ellipsis
## Other
## Spaces
U_NBSP = "\u00a0" # Non-breaking space
U_THNSP = "\u2009" # Thin space
U_THNBSP = "\u202f" # Thin non-breaking space
## Symbols
U_CHECK = "\u2714" # Heavy check mark
U_MULT = "\u2715" # Multiplication x
@@ -275,10 +277,12 @@ class nwUnicode:
H_EMDASH = "&mdash;"
H_HELLIP = "&hellip;"
## Other
## Spaces
H_NBSP = "&nbsp;"
H_THNSP = "&thinsp;"
H_THNBSP = "&#8239;"
## Symbols
H_CHECK = "&#10004;"
H_MULT = "&#10005;"
@@ -293,3 +297,18 @@ class nwUnicode:
H_LTRIS = "&#9666;"
# END Class nwUnicode
class nwInsertSymbols():
SYMBOLS = {
nwDocInsert.NO_INSERT : "",
nwDocInsert.HARD_BREAK : " \n",
nwDocInsert.NB_SPACE : nwUnicode.U_NBSP,
nwDocInsert.THIN_SPACE : nwUnicode.U_THNSP,
nwDocInsert.THIN_NB_SPACE : nwUnicode.U_THNBSP,
nwDocInsert.SHORT_DASH : nwUnicode.U_ENDASH,
nwDocInsert.LONG_DASH : nwUnicode.U_EMDASH,
nwDocInsert.ELLIPSIS : nwUnicode.U_HELLIP,
}
# END Enum nwDocInsert