Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Denis Salem
VenC
Commits
5efa99b6
Commit
5efa99b6
authored
Aug 22, 2019
by
Denis Salem
Browse files
Update Tessellation with new utest, add DisableMarkup pattern
parent
828bb32c
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/share/themes/tessellation/assets/style.css
View file @
5efa99b6
...
...
@@ -23,14 +23,15 @@ hr
background-color
:
grey
;
height
:
1px
;}
pre
{
overflow
:
hidden
;
overflow-x
:
auto
;}
.__VENC_PYGMENTIZE_WRAPPER__
{
clear
:
both
;
width
:
100%
;}
.__VENC_PYGMENTIZE_WRAPPER__
pre
{
overflow
:
hidden
;
overflow-x
:
auto
;}
.__VENC_PYGMENTIZE_WRAPPER__
table
{
width
:
100%
;
display
:
block
;
clear
:
both
;}
.__VENC_PYGMENTIZE_WRAPPER__
table
tr
{
width
:
100%
;
display
:
block
;}
.__VENC_PYGMENTIZE_WRAPPER__
table
tbody
{
width
:
100%
;
display
:
block
;}
.__VENC_PYGMENTIZE_WRAPPER__
table
.linenos
{
width
:
4%
;
display
:
inline-block
;
vertical-align
:
top
;}
.__VENC_PYGMENTIZE_WRAPPER__
table
.code
{
width
:
94%
;
display
:
inline-block
;
vertical-align
:
top
;}
.__VENC_PYGMENTIZE_WRAPPER__
table
td
pre
{
vertical-align
:
top
;
overflow
:
hidden
;
overflow-x
:
auto
;
margin
:
0px
;}
.__VENC_PYGMENTIZE_WRAPPER__
table
td
pre
{
vertical-align
:
top
;
margin
:
0px
;}
.__VENC_TABLE__
{
width
:
100%
;
...
...
@@ -81,10 +82,9 @@ header li a
math
{
display
:
block
;}
#__VENC_THREAD__
{
max-width
:
800px
;
text-align
:
center
;
margin
:
auto
;}
/*************/
/* E N T R Y */
/*************/
.entry
{
font-size
:
0.7em
;
...
...
@@ -92,6 +92,9 @@ math
transition
:
1s
ease
all
;
overflow
:
hidden
;}
.entry
h1
{
text-align
:
center
;}
.entry
img
{
max-width
:
100%
;
display
:
inline-block
;
...
...
@@ -105,6 +108,10 @@ math
text-align
:
center
;
font-size
:
1em
;}
/***************/
/* F O O T E R */
/***************/
footer
{
padding
:
1em
;
font-size
:
1.25em
;
...
...
@@ -123,6 +130,15 @@ footer a
footer
#pagesList
li
,
#previous
,
#next
{
display
:
inline-block
;}
/***************/
/* L A Y O U T */
/***************/
#__VENC_THREAD__
{
max-width
:
800px
;
text-align
:
center
;
margin
:
auto
;}
@media
(
max-width
:
480px
)
{
header
li
{
display
:
block
;}
...
...
src/share/themes/tessellation/chunks/entry.html
View file @
5efa99b6
<div
class=
"entry .:GetEntryMetadataIfExists::style:."
id=
"entry.:GetEntryID:."
data-venc-tags=
".:ForEntryTags::{value}::,:."
>
<a
class=
"permalink"
href=
".:GetEntryURL:."
>
#.:GetEntryID:.
</a>
.:IfInThread::
.:GetEntryMetadataIfExists::display_title_in_threads::
<h1>
.:GetEntryTitle:.
</h1>
:.
::
.:GetEntryMetadataIfExists::display_title_in_entry::
<h1>
.:GetEntryTitle:.
</h1>
:.
:.
.:GetEntryContent:.
</div>
src/venc2/patterns/non_contextual.py
View file @
5efa99b6
...
...
@@ -35,6 +35,9 @@ class MissingKeyDict(dict):
def
__missing__
(
self
,
key
):
return
key
.
join
(
"{}"
)
def
disable_markup
(
argv
):
return
''
.
join
(
argv
)
def
try_oembed
(
providers
,
url
):
try
:
key
=
[
key
for
key
in
providers
[
"oembed"
].
keys
()
if
url
.
netloc
in
key
][
0
]
...
...
src/venc2/patterns/patterns_map.py
View file @
5efa99b6
...
...
@@ -19,7 +19,7 @@
from
venc2.patterns.contextual
import
get_random_number
from
venc2.patterns.latex2mathml
import
Latex2MathML
from
venc2.patterns.non_contextual
import
get_venc_version
,
include_file
,
set_color
,
set_style
,
table
from
venc2.patterns.non_contextual
import
get_venc_version
,
include_file
,
set_color
,
set_style
,
table
,
disable_markup
class
PatternsMap
():
def
__init__
(
self
,
datastore
,
code_highlight
,
theme
):
...
...
@@ -74,6 +74,7 @@ class PatternsMap():
"IncludeFile"
:
include_file
,
"SetColor"
:
set_color
,
"SetStyle"
:
set_style
,
"DisableMarkup"
:
disable_markup
,
"Video"
:
theme
.
get_video
,
"Audio"
:
theme
.
get_audio
,
"Table"
:
table
...
...
@@ -114,5 +115,6 @@ class PatternsMap():
"Audio"
,
"Video"
,
"GetEmbedContent"
,
"Table"
"Table"
,
"DisableMarkup"
]
test/themes/tested/entries/5__08-22-2019-07-36__Display_title_in_thread_test
0 → 100644
View file @
5efa99b6
authors: 'Denis Salem'
categories: 'Templates > Layout Tricks'
tags: ''
title: Display title in thread test
display_title_in_threads: ''
---VENC-BEGIN-PREVIEW---
---VENC-END-PREVIEW---
With Tessellation you can tell VenC if it must display entry title or not.
By default, entry title are disabled.
On the user side, to display the entry title in blog thread, one have to set up the above metadata "__.:DisableMarkup::display_title_in_threads:.__".
By looking the source of the Tessellation theme, in _entry.html_ you'll see that we are calling the following patterns to achieve the trick.
.:Escape::
<pre>.:GetEntryMetadataIfExists::display_title_in_threads::<h1>.:GetEntryTitle:.</h1>:.</pre>
::EndEscape:.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment