mirror of
https://github.com/SebastianObi/Any2MicronConverter.git
synced 2025-12-22 08:27:14 +00:00
Rendering improved
This commit is contained in:
@@ -41,15 +41,6 @@ class SimpleStyleBetweenTags(ABC):
|
||||
return result
|
||||
|
||||
|
||||
@Converter.register
|
||||
class InlineHtml:
|
||||
def __init__(self):
|
||||
self.mode = os.path.basename((os.path.dirname(__file__)))
|
||||
|
||||
def convert(self, text, config={}):
|
||||
return text.replace("<html>", "").replace("</html>", "")
|
||||
|
||||
|
||||
@Converter.register
|
||||
class LineBreak(SimpleStyleBetweenTags):
|
||||
def __init__(self):
|
||||
@@ -96,3 +87,31 @@ class Superscript(SimpleStyleBetweenTags):
|
||||
class InlineCode(SimpleStyleBetweenTags):
|
||||
def __init__(self):
|
||||
super().__init__("", "''", "''")
|
||||
|
||||
|
||||
@Converter.register
|
||||
class InlineHtml:
|
||||
def __init__(self):
|
||||
self.mode = os.path.basename((os.path.dirname(__file__)))
|
||||
|
||||
def convert(self, text, config={}):
|
||||
return text.replace("<html>", "").replace("</html>", "")
|
||||
|
||||
|
||||
@Converter.register
|
||||
class Color:
|
||||
pattern = compile("(<color\s+#([a-fA-F0-9]{6})>([^<]+)<\/color>)")
|
||||
|
||||
def __init__(self):
|
||||
self.mode = os.path.basename((os.path.dirname(__file__)))
|
||||
|
||||
def convert(self, text, config={}):
|
||||
result = text
|
||||
for regex_color in Color.pattern.findall(text):
|
||||
orig_color = regex_color[0]
|
||||
color = regex_color[1]
|
||||
if len(color) == 6:
|
||||
color = str(color[1:2])+str(color[2:3])+str(color[4:5])
|
||||
new_color = "`F" + color + regex_color[2] + "`"
|
||||
result = result.replace(orig_color, new_color)
|
||||
return result
|
||||
|
||||
@@ -39,7 +39,7 @@ import shutil
|
||||
|
||||
if sys.platform.startswith("win"):
|
||||
#### Version ####
|
||||
from _version import __version__, __version_variant__, __copyright_short__, __title__, __description__, __config__
|
||||
from _version import __version__, __version_variant__, __copyright_short__, __title__, __description__, __package_name__, __config__
|
||||
|
||||
#### Converter ####
|
||||
from converter import Converter
|
||||
@@ -57,7 +57,7 @@ if sys.platform.startswith("win"):
|
||||
from dokuwiki.z_cleanup import *
|
||||
else:
|
||||
#### Version ####
|
||||
from ._version import __version__, __version_variant__, __copyright_short__, __title__, __description__, __config__
|
||||
from ._version import __version__, __version_variant__, __copyright_short__, __title__, __description__, __package_name__, __config__
|
||||
|
||||
#### Converter ####
|
||||
from .converter import Converter
|
||||
@@ -79,7 +79,7 @@ else:
|
||||
# Globals
|
||||
|
||||
|
||||
PATH = os.path.expanduser("~") + "/." + os.path.splitext(os.path.basename(__file__))[0]
|
||||
PATH = os.path.expanduser("~") + "/." + __package_name__
|
||||
|
||||
|
||||
##############################################################################################################
|
||||
|
||||
24
build_git.sh
24
build_git.sh
@@ -19,11 +19,20 @@ COMMENT_INIT="Initial commit"
|
||||
|
||||
|
||||
_prompt() {
|
||||
echo -e "Origin: ${ORIGIN}"
|
||||
echo -e "Branch: ${BRANCH}"
|
||||
echo -e ""
|
||||
echo -e ""
|
||||
echo -e "Select an option:"
|
||||
options=("Commit/Push" "Clear History" "Init" "Init (Pull only)" "Init (Push only)" "Exit")
|
||||
options=("Diff" "Pull" "Commit/Push" "Clear History" "Init" "Init (Pull only)" "Init (Push only)" "Exit")
|
||||
select opt in "${options[@]}"; do
|
||||
case $opt in
|
||||
"Diff"*)
|
||||
_diff
|
||||
break;;
|
||||
"Pull"*)
|
||||
_pull
|
||||
break;;
|
||||
"Commit/Push"*)
|
||||
_commit
|
||||
break;;
|
||||
@@ -62,6 +71,19 @@ _define_files() {
|
||||
}
|
||||
|
||||
|
||||
_diff() {
|
||||
git diff --numstat
|
||||
}
|
||||
|
||||
|
||||
_pull() {
|
||||
echo -e ""
|
||||
echo -e "Pull"
|
||||
|
||||
git pull origin "${BRANCH}"
|
||||
}
|
||||
|
||||
|
||||
_commit() {
|
||||
_define_files
|
||||
|
||||
|
||||
Reference in New Issue
Block a user