alignment fix
This commit is contained in:
parent
8283dd45ea
commit
ae26bb205b
7 changed files with 108 additions and 332 deletions
|
|
@ -6,6 +6,7 @@
|
||||||
|___/\__,_|_|_\___|_||_\__|_\__,_|
|
|___/\__,_|_|_\___|_||_\__|_\__,_|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%h Structa hinc vetitus factum
|
%h Structa hinc vetitus factum
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -37,151 +38,21 @@
|
||||||
%h Tractaque serpens arva quoque
|
%h Tractaque serpens arva quoque
|
||||||
|
|
||||||
|
|
||||||
_ _ _ _ _ _ ___ __
|
<>=======()
|
||||||
| |_ / | | || |___ __ _ __| (_)_ _ __ _ ( _ )__\ \
|
(/\___ /|\\ ()==========<>_
|
||||||
| ' \| | | __ / -_) _` / _` | | ' \/ _` | / _ \___| |
|
\_/ | \\ //|\ ______/ \)
|
||||||
|_||_|_| |_||_\___\__,_\__,_|_|_||_\__, | \___/ | |
|
\_| \\ // | \_/
|
||||||
|___/ /_/
|
\|\/|\_ // /\/
|
||||||
|
(oo)\ \_// /
|
||||||
|
//_/\_\/ / |
|
||||||
%h h2 Heading
|
@@/ |=\ \ |
|
||||||
|
\_=\_ \ |
|
||||||
|
\==\ \|\_ snd
|
||||||
%h h3 Heading
|
__(\===\( )\
|
||||||
|
(((~) __(_/ |
|
||||||
|
(((~) \ /
|
||||||
_ _ _ _ _ _ _
|
______/ /
|
||||||
| |__ | || | | | | | ___ __ _ __| (_)_ __ __ _
|
'------'
|
||||||
| '_ \| || |_ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
|
|
||||||
| | | |__ _| | _ | __/ (_| | (_| | | | | | (_| |
|
|
||||||
|_| |_| |_| |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|
|
||||||
|___/
|
|
||||||
|
|
||||||
|
|
||||||
_ ____ _ _ _ _
|
|
||||||
| |__ | ___| | | | | ___ __ _ __| (_)_ __ __ _
|
|
||||||
| '_ \|___ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
|
|
||||||
| | | |___) | | _ | __/ (_| | (_| | | | | | (_| |
|
|
||||||
|_| |_|____/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|
|
||||||
|___/
|
|
||||||
|
|
||||||
|
|
||||||
_ __ _ _ _ _
|
|
||||||
| |__ / /_ | | | | ___ __ _ __| (_)_ __ __ _
|
|
||||||
| '_ \| '_ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
|
|
||||||
| | | | (_) | | _ | __/ (_| | (_| | | | | | (_| |
|
|
||||||
|_| |_|\___/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|
|
||||||
|___/
|
|
||||||
|
|
||||||
|
|
||||||
%h Horizontal Rules
|
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
%h Emphasis
|
|
||||||
|
|
||||||
|
|
||||||
%!THIS IS BOLD TEXT%t %bTHIS IS BOLD TEXT%t %!This is italic text%t %-
|
|
||||||
bThis is italic text%t Strikethrough
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%h Blockquotes
|
|
||||||
|
|
||||||
|
|
||||||
Blockquotes can also be nested...
|
|
||||||
by using additional greater-than signs right next to each oth-
|
|
||||||
er...
|
|
||||||
or with spaces between arrows.
|
|
||||||
|
|
||||||
|
|
||||||
%h Lists
|
|
||||||
|
|
||||||
|
|
||||||
%h Unordered
|
|
||||||
|
|
||||||
|
|
||||||
+ Create a list by starting a line with `=+`=, `=-`=, or `=*`=
|
|
||||||
- Marker character change forces new list start:
|
|
||||||
* Ac tristique libero volutpat at
|
|
||||||
+ Facilisis in pretium nisl aliquet
|
|
||||||
- Nulla volutpat aliquam velit
|
|
||||||
+ Very easy
|
|
||||||
|
|
||||||
|
|
||||||
%h Ordered
|
|
||||||
|
|
||||||
|
|
||||||
1. Lorem ipsum dolor sit amet
|
|
||||||
2. Consectetur adipiscing elit
|
|
||||||
3. Integer molestie lorem at massa
|
|
||||||
|
|
||||||
|
|
||||||
%h Code
|
|
||||||
|
|
||||||
|
|
||||||
Inline `=code`=
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Indented code
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`=
|
|
||||||
// Some comments
|
|
||||||
line 1 of code
|
|
||||||
line 2 of code
|
|
||||||
line 3 of code
|
|
||||||
`=
|
|
||||||
|
|
||||||
|
|
||||||
Block code "fences"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`=
|
|
||||||
Sample text here...
|
|
||||||
`=
|
|
||||||
|
|
||||||
Syntax highlighting
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`=
|
|
||||||
var foo = function (bar) {
|
|
||||||
return bar++;
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log(foo(5));
|
|
||||||
`=
|
|
||||||
|
|
||||||
|
|
||||||
%h Links
|
|
||||||
|
|
||||||
|
|
||||||
link text (<http://dev.nodeca.com>)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
link with title (<http://nodeca.github.io/pica/demo/ "title text!">)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%h Images
|
|
||||||
|
|
||||||
|
|
||||||
Minion (<https://octodex.github.com/images/minion.png>) Stormtroopocat
|
|
||||||
(<https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroo-
|
|
||||||
pocat">)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Inprudens dum memor alma, casses dedi Sinuessa iam quid adicit `=gate-
|
Inprudens dum memor alma, casses dedi Sinuessa iam quid adicit `=gate-
|
||||||
_truncate_wave`=. Geratur de (<#salientia-iungit-contra-et>), insolida
|
_truncate_wave`=. Geratur de (<#salientia-iungit-contra-et>), insolida
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ populifer adeunt quicquam cum **ales** Ixion angulus placet reddere.
|
||||||
## Tractaque serpens arva quoque
|
## Tractaque serpens arva quoque
|
||||||
{:.center}
|
{:.center}
|
||||||
|
|
||||||
![[markdown.md]]
|
#[dragon :center](dragon.txt)
|
||||||
|
|
||||||
Inprudens dum memor alma, casses dedi Sinuessa iam quid adicit
|
Inprudens dum memor alma, casses dedi Sinuessa iam quid adicit
|
||||||
`gate_truncate_wave`. [Geratur de](#salientia-iungit-contra-et), insolida
|
`gate_truncate_wave`. [Geratur de](#salientia-iungit-contra-et), insolida
|
||||||
|
|
|
||||||
|
|
@ -31,136 +31,21 @@
|
||||||
|
|
||||||
>> Tractaque serpens arva quoque
|
>> Tractaque serpens arva quoque
|
||||||
|
|
||||||
|
<>=======()
|
||||||
_ _ _ _ _ _ ___ __
|
(/\___ /|\\ ()==========<>_
|
||||||
| |_ / | | || |___ __ _ __| (_)_ _ __ _ ( _ )__\ \
|
\_/ | \\ //|\ ______/ \)
|
||||||
| ' \| | | __ / -_) _` / _` | | ' \/ _` | / _ \___| |
|
\_| \\ // | \_/
|
||||||
|_||_|_| |_||_\___\__,_\__,_|_|_||_\__, | \___/ | |
|
\|\/|\_ // /\/
|
||||||
|___/ /_/
|
(oo)\ \_// /
|
||||||
|
//_/\_\/ / |
|
||||||
|
@@/ |=\ \ |
|
||||||
>> h2 Heading
|
\_=\_ \ |
|
||||||
|
\==\ \|\_ snd
|
||||||
|
__(\===\( )\
|
||||||
>>> h3 Heading
|
(((~) __(_/ |
|
||||||
|
(((~) \ /
|
||||||
|
______/ /
|
||||||
_ _ _ _ _ _ _
|
'------'
|
||||||
| |__ | || | | | | | ___ __ _ __| (_)_ __ __ _
|
|
||||||
| '_ \| || |_ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
|
|
||||||
| | | |__ _| | _ | __/ (_| | (_| | | | | | (_| |
|
|
||||||
|_| |_| |_| |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|
|
||||||
|___/
|
|
||||||
|
|
||||||
|
|
||||||
_ ____ _ _ _ _
|
|
||||||
| |__ | ___| | | | | ___ __ _ __| (_)_ __ __ _
|
|
||||||
| '_ \|___ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
|
|
||||||
| | | |___) | | _ | __/ (_| | (_| | | | | | (_| |
|
|
||||||
|_| |_|____/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|
|
||||||
|___/
|
|
||||||
|
|
||||||
|
|
||||||
_ __ _ _ _ _
|
|
||||||
| |__ / /_ | | | | ___ __ _ __| (_)_ __ __ _
|
|
||||||
| '_ \| '_ \ | |_| |/ _ \/ _` |/ _` | | '_ \ / _` |
|
|
||||||
| | | | (_) | | _ | __/ (_| | (_| | | | | | (_| |
|
|
||||||
|_| |_|\___/ |_| |_|\___|\__,_|\__,_|_|_| |_|\__, |
|
|
||||||
|___/
|
|
||||||
|
|
||||||
|
|
||||||
>> Horizontal Rules
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
|
||||||
------------------------------------------------------------------------
|
|
||||||
------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
>> Emphasis
|
|
||||||
|
|
||||||
`!This is bold text`! `!This is bold text`! `*This is italic text`* `*T-
|
|
||||||
his is italic text`* ~~Strikethrough~~
|
|
||||||
|
|
||||||
|
|
||||||
>> Blockquotes
|
|
||||||
|
|
||||||
>>>>Blockquotes can also be nested...
|
|
||||||
|
|
||||||
>>>>>>>>by using additional greater-than signs right next to each oth-
|
|
||||||
>>>>>>>>er...
|
|
||||||
|
|
||||||
>>>>>>>>>>>>or with spaces between arrows.
|
|
||||||
|
|
||||||
|
|
||||||
>> Lists
|
|
||||||
|
|
||||||
|
|
||||||
>>> Unordered
|
|
||||||
|
|
||||||
+ Create a list by starting a line with `=+`=, `=-`=, or `=*`=
|
|
||||||
- Marker character change forces new list start:
|
|
||||||
* Ac tristique libero volutpat at
|
|
||||||
+ Facilisis in pretium nisl aliquet
|
|
||||||
- Nulla volutpat aliquam velit
|
|
||||||
+ Very easy
|
|
||||||
|
|
||||||
|
|
||||||
>>> Ordered
|
|
||||||
|
|
||||||
1. Lorem ipsum dolor sit amet
|
|
||||||
2. Consectetur adipiscing elit
|
|
||||||
3. Integer molestie lorem at massa
|
|
||||||
|
|
||||||
|
|
||||||
>> Code
|
|
||||||
|
|
||||||
Inline `=code`=
|
|
||||||
|
|
||||||
|
|
||||||
Indented code
|
|
||||||
|
|
||||||
|
|
||||||
`=
|
|
||||||
// Some comments
|
|
||||||
line 1 of code
|
|
||||||
line 2 of code
|
|
||||||
line 3 of code
|
|
||||||
`=
|
|
||||||
|
|
||||||
Block code "fences"
|
|
||||||
|
|
||||||
|
|
||||||
`=
|
|
||||||
Sample text here...
|
|
||||||
`=
|
|
||||||
|
|
||||||
Syntax highlighting
|
|
||||||
|
|
||||||
|
|
||||||
`=
|
|
||||||
var foo = function (bar) {
|
|
||||||
return bar++;
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log(foo(5));
|
|
||||||
`=
|
|
||||||
|
|
||||||
|
|
||||||
>> Links
|
|
||||||
|
|
||||||
`[link text`http://dev.nodeca.com]
|
|
||||||
|
|
||||||
|
|
||||||
`[link with title`http://nodeca.github.io/pica/demo/ "title text!"]
|
|
||||||
|
|
||||||
|
|
||||||
>> Images
|
|
||||||
|
|
||||||
`[Minion`https://octodex.github.com/images/minion.png] `[Stormtroopocat-
|
|
||||||
`https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopoc-
|
|
||||||
at"]
|
|
||||||
|
|
||||||
|
|
||||||
Inprudens dum memor alma, casses dedi Sinuessa iam quid adicit `=gate_t-
|
Inprudens dum memor alma, casses dedi Sinuessa iam quid adicit `=gate_t-
|
||||||
runcate_wave`=. `[Geratur de`#salientia-iungit-contra-et], insolida tem-
|
runcate_wave`=. `[Geratur de`#salientia-iungit-contra-et], insolida tem-
|
||||||
ptat `=open`= carentia; genitorem solet, potens. Adit vos ramos mundi c-
|
ptat `=open`= carentia; genitorem solet, potens. Adit vos ramos mundi c-
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,22 @@ class AmaRenderer(TextRenderer):
|
||||||
|
|
||||||
def _render_heading(self, payload: HeadingPayload, style: BlockStyle) -> None:
|
def _render_heading(self, payload: HeadingPayload, style: BlockStyle) -> None:
|
||||||
self._ensure_header_spacing()
|
self._ensure_header_spacing()
|
||||||
figlet = self._render_figlet_heading(payload.level, payload.text, style)
|
def render_fn(target_style: BlockStyle) -> List[str]:
|
||||||
|
figlet = self._render_figlet_heading(payload.level, payload.text, target_style)
|
||||||
if figlet and all(len(line.rstrip()) <= self.width for line in figlet):
|
if figlet and all(len(line.rstrip()) <= self.width for line in figlet):
|
||||||
self._emit_block(figlet, stylable=False)
|
return [*figlet, ""]
|
||||||
return
|
|
||||||
heading = self._process_inline(payload.text)
|
heading = self._process_inline(payload.text)
|
||||||
self._emit_block([f"%h {heading}", ""], stylable=False)
|
wrapped = self._wrap_text(
|
||||||
|
heading,
|
||||||
|
style=target_style,
|
||||||
|
initial_indent="%h ",
|
||||||
|
subsequent_indent="%h ",
|
||||||
|
)
|
||||||
|
if not wrapped or wrapped[-1] != "":
|
||||||
|
wrapped.append("")
|
||||||
|
return wrapped
|
||||||
|
|
||||||
|
self._emit_block(render_fn(style), stylable=True, render_fn=render_fn, style=style)
|
||||||
|
|
||||||
def _render_code_block(self, payload: CodeBlockPayload, style: BlockStyle) -> None:
|
def _render_code_block(self, payload: CodeBlockPayload, style: BlockStyle) -> None:
|
||||||
margin_left, _, _ = self._margins(style)
|
margin_left, _, _ = self._margins(style)
|
||||||
|
|
|
||||||
|
|
@ -42,14 +42,24 @@ class MicronRenderer(TextRenderer):
|
||||||
|
|
||||||
def _render_heading(self, payload: HeadingPayload, style: BlockStyle) -> None:
|
def _render_heading(self, payload: HeadingPayload, style: BlockStyle) -> None:
|
||||||
self._ensure_header_spacing()
|
self._ensure_header_spacing()
|
||||||
figlet = self._render_figlet_heading(payload.level, payload.text, style)
|
def render_fn(target_style: BlockStyle) -> List[str]:
|
||||||
|
figlet = self._render_figlet_heading(payload.level, payload.text, target_style)
|
||||||
if figlet and all(len(line.rstrip()) <= self.width for line in figlet):
|
if figlet and all(len(line.rstrip()) <= self.width for line in figlet):
|
||||||
self._emit_block(figlet, stylable=False)
|
return [*figlet, ""]
|
||||||
return
|
|
||||||
level = max(1, min(3, payload.level))
|
level = max(1, min(3, payload.level))
|
||||||
marker = ">" * level
|
marker = ">" * level
|
||||||
line = f"{marker} {self._process_inline(payload.text)}".rstrip()
|
heading = f"{marker} {self._process_inline(payload.text)}".rstrip()
|
||||||
self._emit_block([line, ""], stylable=False)
|
wrapped = self._wrap_text(
|
||||||
|
heading,
|
||||||
|
style=target_style,
|
||||||
|
initial_indent="",
|
||||||
|
subsequent_indent="",
|
||||||
|
)
|
||||||
|
if not wrapped or wrapped[-1] != "":
|
||||||
|
wrapped.append("")
|
||||||
|
return wrapped
|
||||||
|
|
||||||
|
self._emit_block(render_fn(style), stylable=True, render_fn=render_fn, style=style)
|
||||||
|
|
||||||
def _render_code_block(self, payload: CodeBlockPayload, style: BlockStyle) -> None:
|
def _render_code_block(self, payload: CodeBlockPayload, style: BlockStyle) -> None:
|
||||||
margin_left, _, _ = self._margins(style)
|
margin_left, _, _ = self._margins(style)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue