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
3ddd013b
Commit
3ddd013b
authored
Oct 06, 2018
by
Denis Salem
Browse files
fix some stuff, wip on code highlight
parent
ef50f63d
Changes
22
Hide whitespace changes
Inline
Side-by-side
VenC-site/blogConfiguration.yaml
View file @
3ddd013b
...
...
@@ -21,3 +21,4 @@ path:
reverseThreadOrder
:
false
rssThreadLenght
:
5
textEditor
:
gvim
banner
:
'
https://download.tuxfamily.org/dsalem/img/2017_-_Denis_Salem_-_CC_By_SA_-_VenC-logo.svg'
VenC-site/entries/1__9-6-2017-10-26__Features
View file @
3ddd013b
...
...
@@ -4,9 +4,4 @@ tags: ''
title:
style: features
---
## V __en__ C is super easy to use and learn!
.:IncludeHTML::Lolilool:.
.:IncludeHTML:: ../../../../../../../etc/shadow :.
VenC-site/theme/assets/style.css
View file @
3ddd013b
body
{
font-family
:
sans
;
font-weight
:
lighter
;}
/***************/
/* G L O B A L */
/***************/
body
,
html
{
margin
:
0px
;
font-family
:
sans
;
font-weight
:
lighter
;
background-color
:
white
;}
strong
{
font-weight
:
bold
;}
a
{
outline
:
none
;
color
:
black
;
text-decoration
:
none
;}
h1
{
font-family
:
sans
;
font-size
:
3em
;
letter-spacing
:
10px
;
text-transform
:
uppercase
;
font-weight
:
lighter
;}
/***************/
/* H E A D E R */
/***************/
#banner
{
width
:
90%
;}
header
h2
{
font-size
:
0.8em
;
font-weight
:
lighter
;
margin
:
0px
;
opacity
:
0.5
;}
header
{
text-align
:
center
;
background-image
:
url('concrete.png')
;
background-attachment
:
fixed
;
position
:
fixed
;
top
:
0px
;
left
:
0px
;
width
:
100%
;
height
:
100%
;
display
:
block
;}
header
h1
,
header
h2
{
color
:
white
;}
header
h1
img
{
width
:
33%
;}
#char0
{
position
:
fixed
;
height
:
65%
;
bottom
:
0px
;}
#__VENC_THREAD__
{
position
:
absolute
;
top
:
100%
;
left
:
0px
;
background-image
:
url('concrete.png')
;
box-shadow
:
0px
0px
32px
black
;
border-top
:
1px
solid
rgba
(
255
,
255
,
255
,
0.3
);
z-index
:
2
;
width
:
100%
;
display
:
block
;}
{
text-align
:
center
;
color
:
black
;
text-align
:
center
;}
header
ul
{
margin
:
0px
;
display
:
inline-block
;
list-style-type
:
none
;
padding
:
0px
;}
header
li
{
margin
:
1em
;
font-size
:
1.25em
;
display
:
inline-block
;}
header
a
{
opacity
:
0.8
;
color
:
black
;
transition
:
0.5s
ease
all
;}
header
a
:hover
{
opacity
:
1.0
;}
#archives
li
{
margin
:
0.5em
;
font-size
:
0.8em
;}
/*************/
/* E N T R Y */
/*************/
.entry
{
font-size
:
1em
;
width
:
700px
;
margin
:
auto
;
text-align
:
justify
;
transition
:
1s
ease
all
;
overflow
:
hidden
;}
.entry
img
{
max-width
:
100%
;
display
:
block
;
margin
:
auto
;
margin-top
:
1em
;
margin-bottom
:
1em
;}
.entry
a
{
text-decoration
:
underline
;
}
.entry
em
{
color
:
grey
;
}
.permalink
a
{
color
:
black
;
font-size
:
1em
;
text-decoration
:
none
;}
.permalink
{
margin
:
0px
;
margin-top
:
1em
;
margin-bottom
:
1em
;
text-align
:
center
;}
.permalink
p
{
font-size
:
1em
;
letter-spacing
:
5px
;
opacity
:
0.5
;}
.entry
pre
{
overflow
:
scroll
;}
/***************/
/* F O O T E R */
/***************/
footer
{
padding
:
1em
;
font-size
:
2em
;
text-align
:
center
;}
footer
#pagesList
{
list-style-type
:
none
;
display
:
inline-block
;
text-align
:
center
;
margin
:
0px
;
padding-left
:
3px
;}
footer
a
{
color
:
black
;}
footer
#pagesList
li
,
#previous
,
#next
{
display
:
inline-block
;}
@media
(
max-width
:
360px
)
{
header
li
{
display
:
block
;}
#archivesHeader
{
display
:
none
;}
#archives
{
display
:
none
;}
.entry
{
width
:
95%
;
margin-left
:
2.5%
;}
.permalink
a
{
font-size
:
0.66em
;
letter-spacing
:
0px
;}
footer
{
font-size
:
1.25em
;}
}
VenC-site/theme/chunks/entry.html
View file @
3ddd013b
<div
class=
"entry"
id=
"entry.:GetEntryID:."
data-venc-keywords=
".:ForEntryTags::{0[tag]}::,:."
data-venc-authors=
".:ForEntryAuthors::{0[author]}::,:."
>
<h3>
#
<a
href=
".:GetRelativeOrigin:..:GetEntryURL:."
>
.:GetEntryID:.
</a>
.:GetEntryTitle:.
</h3>
<h4>
.:ForEntryAuthors::{0[author]}::, :. -
<a
href=
".:GetRelativeOrigin:..:GetEntryDateURL:."
>
.:GetEntryDate:.
</a></h4>
.:GetEntryContent:.
<ul>
.:ForEntryCategoriesLeaves::
<li><a
href=
"{0[relativeOrigin]}{0[categoryLeafPath]}"
>
{0[categoryLeaf]}
</a></li>
:: :.
</ul>
</div>
<div
class=
"entry .:GetEntryMetadataIfExists::CSS:."
id=
"entry.:GetEntryID:."
data-venc-tags=
".:ForEntryTags::{0[tag]}:: :."
>
<div
class=
"permalink"
>
<h1><a
href=
".:GetRelativeOrigin:.entry.:GetEntryID:..html"
>
.:GetEntryTitle:.
</a></h1>
<p>
.:GetEntryDate:.
</p>
</div>
.:GetEntryContent:.
</div>
VenC-site/theme/chunks/footer.html
View file @
3ddd013b
</div>
<!-- __VENC_THREAD__ -->
<footer>
.:GetPreviousPage::
<a
href=
"{0[destinationPageUrl]}"
>
Précédent
</a>
:.
<ul>
.:For
Pages::5::
<li><a
href=
"{0[pageUrl]}"
>
{0[pageNumber]}
</a></li>
:: :.
</ul>
.:GetNextPage::
<a
href=
"{0[destinationPageUrl]}"
>
Suivant
</a>
:.
</footer>
</div>
<footer
id=
"__VENC_NAVIGATION__"
>
.:GetPreviousPage::
<a
id=
"previous"
href=
"{0[destinationPageUrl]}
"
>
←
</a>
:.
<ul
id=
"pagesList"
>
.:
Pages
List
::5::
<li><a
href=
"{0[pageUrl]}"
>
{0[pageNumber]}
</a></li>
::
.
:.
</ul>
.:GetNextPage::
<a
id=
"next"
href=
"{0[destinationPageUrl]}
"
>
→
</a>
:.
</footer>
</body>
</html>
VenC-site/theme/chunks/header.html
View file @
3ddd013b
<!DOCTYPE html>
<html>
<html
lang=
".:GetBlogLanguage:."
>
<head>
<meta
generator=
"VenC"
/>
<meta
charset=
"utf-8"
/>
<meta
keywords=
".:GetBlogKeywords:."
/>
<meta
description=
".:GetBlogDescription:."
/>
<title>
.:GetBlogName:.
</title>
<link
rel=
"stylesheet"
href=
".:GetRelativeOrigin:.style.css"
type=
"text/css"
>
<link
rel=
"alternate"
type=
"application/rss+xml"
title=
".:GetBlogName:."
href=
"./feed.xml"
/>
.:IfInThread::
<link
rel=
"stylesheet"
href=
"./styleThread.css"
type=
"text/css"
>
:: :.
<meta
name=
"generator"
content=
"VenC"
/>
<meta
name=
"keywords"
content=
".:GetBlogKeywords:."
/>
<meta
name=
"description"
content=
".:GetBlogDescription:."
/>
<meta
charset=
"utf-8"
/>
<script
type=
"text/javascript"
src=
".:GetRelativeOrigin:.VenC-Infinite-Scroll-1.0.0.js"
></script>
<script
type=
"text/javascript"
>
window
.
onload
=
VENC_INFINITE_SCROLL_ON_LOAD
;
</script>
<link
rel=
"alternate"
type=
"application/rss+xml"
title=
".:GetBlogName:."
href=
"feed.xml"
/>
<link
rel=
"stylesheet"
href=
".:GetRelativeOrigin:.style.css"
type=
"text/css"
/>
.:IfInThread::
<link
rel=
"stylesheet"
href=
".:GetRelativeOrigin:.styleThread.css"
type=
"text/css"
/>
::
<link
rel=
"stylesheet"
href=
".:GetRelativeOrigin:.styleEntry.css"
type=
"text/css"
/>
:.
</head>
<body>
<header>
<h1><img
src=
"logo.png"
alt=
".:GetBlogName:."
title=
".:GetBlogName:."
></h1>
<h2>
.:GetBlogDescription:.
</h2>
<img
src=
"character0x00.png"
id=
"char0"
>
<h1>
<a
href=
".:IfInThread:: ../.:GetRelativeOrigin:. :: index.html :. "
>
<img
id=
"banner"
src=
".:GetRelativeOrigin:..:GetBlogMetadataIfExists::banner:."
alt=
".:GetBlogName:."
title=
".:GetBlogName:."
/>
</a>
</h1>
<h2>
CATEGORIES
</h2>
<div
id=
"categories"
>
.:RecursiveFor::BlogCategories::
<ul>
::
<li><a
href=
"{0[relativeOrigin]}{0[categoryPath]}"
title=
"{0[count]} publications"
>
{0[item]}
</a>
::
</li>
::
</ul>
:.
</div>
<h2
id=
"archivesHeader"
>
ARCHIVES
</h2>
<ul
id=
"archives"
>
.:ForBlogDates::
<li><a
href=
"{0[dateUrl]}"
title=
"{0[count]} publications"
>
{0[date]}
</a></li>
:: :.
</ul>
<div
id=
"__VENC_LOADING__"
></div>
</header>
<div
id=
"__VENC_THREAD__"
>
VenC-site/theme/chunks/rssEntry.html
View file @
3ddd013b
<item>
<title>
.:GetEntryTitle:.
</title>
<link>
.:GetBlogURL:.
/
.:GetEntryURL:.
</link>
<guid
isPermaLink=
"true"
>
.:GetBlogURL:.
/
.:GetEntryURL:.
</guid>
<description>
.:GetEntryContent:.
</description>
<link>
.:GetBlogURL:..:GetEntryURL:.
</link>
<guid
isPermaLink=
"true"
>
.:GetBlogURL:..:GetEntryURL:.
</guid>
<description>
<![CDATA[
.:GetEntryContent:.
]]>
</description>
</item>
VenC-site/theme/chunks/rssHeader.html
View file @
3ddd013b
...
...
@@ -2,7 +2,7 @@
<rss
version=
"2.0"
xmlns:atom=
"http://www.w3.org/2005/Atom"
>
<channel>
<atom:link
href=
".:GetBlogURL:.
/
feed.xml"
rel=
"self"
type=
"application/rss+xml"
/>
<atom:link
href=
".:GetBlogURL:.
.:GetRelativeLocation:.
feed.xml"
rel=
"self"
type=
"application/rss+xml"
/>
<title>
.:GetBlogName:.
</title>
<link>
.:GetBlogURL:.
</link>
<description>
.:GetBlogDescription:.
</description>
<description>
<![CDATA[
.:GetBlogDescription:.
]]>
</description>
changelog.md
View file @
3ddd013b
...
...
@@ -86,7 +86,6 @@
DONE | Catch exception when Yaml cannot parse blog configuration.
DONE | Hardcoded opening,closing and separator symbols in pattern processor.
DONE | Add a copyright notice and term of use in each source files.
DONE | Auto include CSS.
DONE | Warn about missing mandatory field in entry.
DONE | Add function GetBlogMetadataIfExists and GetEntryMetadataIfExists.
DONE | Catch exception nicely in CodeHighLight.
...
...
@@ -104,9 +103,11 @@
DONE | Handle currentLocale = locale.getlocale()[0].split('_')[0] AttributeError: 'NoneType'.
DONE | Clean up installation.
DONE | Add random number generator.
DONE | Add function Include. (Add a directory force included ressources)
DONE | Create theme folder if missing while setup new theme.
WIP | Massive refactorisation, code cleaning and optimisation.
WIP | Change nomenclature: Most of the usual patterns are changed. Fix doc.
DONE | Add function Include. (Add a directory force included ressources)
WIP | Auto include CodeHighlight CSS.
TODO | Fix vertical scroll bar in code snippet.
TODO | Add relevant templates for themes.
TODO | Add categories tree in entry.
...
...
src/share/themes/gentle/chunks/entry.html
View file @
3ddd013b
<div
class=
"entry .:Get
::
EntryCSS:."
id=
"entry.:Get
::
EntryID:."
data-venc-tags=
".:For
::
EntryTags::{0[tag]}:: :."
>
<div
class=
"entry .:GetEntry
MetadataIfExists::
CSS:."
id=
"entry.:GetEntryID:."
data-venc-tags=
".:ForEntryTags::{0[tag]}:: :."
>
<div
class=
"permalink"
>
<h1><a
href=
".:Get
::
RelativeOrigin:.entry.:Get
::
EntryID:..html"
>
.:Get
::
Entry
Nam
e:.
</a></h1>
<p>
.:Get
::
EntryDate:.
</p>
<h1><a
href=
".:GetRelativeOrigin:.entry.:GetEntryID:..html"
>
.:GetEntry
Titl
e:.
</a></h1>
<p>
.:GetEntryDate:.
</p>
</div>
.:Get
::
EntryContent:.
.:GetEntryContent:.
</div>
src/share/themes/gentle/chunks/header.html
View file @
3ddd013b
<!DOCTYPE html>
<html
lang=
".:Get
::
BlogLanguage:."
>
<html
lang=
".:GetBlogLanguage:."
>
<head>
<title>
.:Get
::
BlogName:.
</title>
<title>
.:GetBlogName:.
</title>
<meta
name=
"generator"
content=
"VenC"
/>
<meta
name=
"keywords"
content=
".:Get
::
BlogKeywords:."
/>
<meta
name=
"description"
content=
".:Get
::
BlogDescription:."
/>
<meta
name=
"keywords"
content=
".:GetBlogKeywords:."
/>
<meta
name=
"description"
content=
".:GetBlogDescription:."
/>
<meta
charset=
"utf-8"
/>
<script
type=
"text/javascript"
src=
".:Get
::
RelativeOrigin:.VenC-Infinite-Scroll-1.0.0.js"
></script>
<script
type=
"text/javascript"
src=
".:GetRelativeOrigin:.VenC-Infinite-Scroll-1.0.0.js"
></script>
<script
type=
"text/javascript"
>
window
.
onload
=
VENC_INFINITE_SCROLL_ON_LOAD
;
</script>
<link
rel=
"alternate"
type=
"application/rss+xml"
title=
".:Get
::
BlogName:."
href=
"feed.xml"
/>
<link
rel=
"stylesheet"
href=
".:Get
::
RelativeOrigin:.style.css"
type=
"text/css"
/>
.:IfInThread::
<link
rel=
"stylesheet"
href=
".:Get
::
RelativeOrigin:.styleThread.css"
type=
"text/css"
/>
::
<link
rel=
"stylesheet"
href=
".:Get
::
RelativeOrigin:.styleEntry.css"
type=
"text/css"
/>
:.
<link
rel=
"alternate"
type=
"application/rss+xml"
title=
".:GetBlogName:."
href=
"feed.xml"
/>
<link
rel=
"stylesheet"
href=
".:GetRelativeOrigin:.style.css"
type=
"text/css"
/>
.:IfInThread::
<link
rel=
"stylesheet"
href=
".:GetRelativeOrigin:.styleThread.css"
type=
"text/css"
/>
::
<link
rel=
"stylesheet"
href=
".:GetRelativeOrigin:.styleEntry.css"
type=
"text/css"
/>
:.
</head>
<body>
<header>
<h1>
<a
href=
".:IfInThread:: ../.:Get
::
RelativeOrigin:. :: index.html :. "
>
<img
id=
"banner"
src=
".:Get
::
RelativeOrigin:..:Get::
B
anner:."
alt=
".:Get
::
BlogName:."
title=
".:Get
::
BlogName:."
/>
<a
href=
".:IfInThread:: ../.:GetRelativeOrigin:. :: index.html :. "
>
<img
id=
"banner"
src=
".:GetRelativeOrigin:..:Get
BlogMetadataIfExists
::
b
anner:."
alt=
".:GetBlogName:."
title=
".:GetBlogName:."
/>
</a>
</h1>
<h2>
CATEGORIES
</h2>
...
...
@@ -26,7 +26,7 @@
.:RecursiveFor::BlogCategories::
<ul>
::
<li><a
href=
"{0[relativeOrigin]}{0[categoryPath]}"
title=
"{0[count]} publications"
>
{0[item]}
</a>
::
</li>
::
</ul>
:.
</div>
<h2
id=
"archivesHeader"
>
ARCHIVES
</h2>
<ul
id=
"archives"
>
.:For
::
BlogDates::
<li><a
href=
"{0[dateUrl]}"
title=
"{0[count]} publications"
>
{0[date]}
</a></li>
:: :.
</ul>
<ul
id=
"archives"
>
.:ForBlogDates::
<li><a
href=
"{0[dateUrl]}"
title=
"{0[count]} publications"
>
{0[date]}
</a></li>
:: :.
</ul>
<div
id=
"__VENC_LOADING__"
></div>
</header>
<div
id=
"__VENC_THREAD__"
>
src/share/themes/gentle/chunks/rssEntry.html
View file @
3ddd013b
<item>
<title>
.:Get
::
Entry
Nam
e:.
</title>
<link>
.:Get
::
BlogU
rl
:..:Get
::
EntryU
rl
:.
</link>
<guid
isPermaLink=
"true"
>
.:Get
::
BlogU
rl
:..:Get
::
EntryU
rl
:.
</guid>
<description>
<![CDATA[.:Get
::
EntryContent:.]]>
</description>
<title>
.:GetEntry
Titl
e:.
</title>
<link>
.:GetBlogU
RL
:..:GetEntryU
RL
:.
</link>
<guid
isPermaLink=
"true"
>
.:GetBlogU
RL
:..:GetEntryU
RL
:.
</guid>
<description>
<![CDATA[.:GetEntryContent:.]]>
</description>
</item>
src/share/themes/gentle/chunks/rssHeader.html
View file @
3ddd013b
...
...
@@ -2,7 +2,7 @@
<rss
version=
"2.0"
xmlns:atom=
"http://www.w3.org/2005/Atom"
>
<channel>
<atom:link
href=
".:Get
::
BlogU
rl
:..:Get
::
RelativeLocation:.feed.xml"
rel=
"self"
type=
"application/rss+xml"
/>
<title>
.:Get
::
BlogName:.
</title>
<link>
.:Get
::
BlogU
rl
:.
</link>
<description>
<![CDATA[.:Get
::
BlogDescription:.]]>
</description>
<atom:link
href=
".:GetBlogU
RL
:..:GetRelativeLocation:.feed.xml"
rel=
"self"
type=
"application/rss+xml"
/>
<title>
.:GetBlogName:.
</title>
<link>
.:GetBlogU
RL
:.
</link>
<description>
<![CDATA[.:GetBlogDescription:.]]>
</description>
src/venc2/commands/export.py
View file @
3ddd013b
...
...
@@ -99,7 +99,6 @@ def export_and_remote_copy(argv=list()):
remote_copy
()
def
export_blog
(
argv
=
list
()):
# Initialisation of environment
datastore
=
DataStore
()
...
...
@@ -180,7 +179,7 @@ def export_blog(argv=list()):
# Copy assets and extra files
#
code
H
ighlight.
E
xport
S
tyle
S
heets()
code
_h
ighlight
.
e
xport
_s
tyle
_s
heets
()
copy_recursively
(
"extra/"
,
"blog/"
)
copy_recursively
(
"theme/assets/"
,
"blog/"
)
...
...
src/venc2/commands/install.py
View file @
3ddd013b
...
...
@@ -37,8 +37,8 @@ def install_theme(argv):
try
:
shutil
.
move
(
"theme"
,
new_folder_name
)
except
FileNotFoundError
:
die
(
messages
.
file_not_found
.
format
(
"'theme'"
))
except
:
pass
try
:
shutil
.
copytree
(
os
.
path
.
expanduser
(
"~"
)
+
"/.local/share/VenC/themes/"
+
argv
[
0
],
"theme"
)
...
...
src/venc2/datastore/datastore.py
View file @
3ddd013b
...
...
@@ -21,7 +21,7 @@ from venc2.datastore.configuration import get_blog_configuration
from
venc2.datastore.entry
import
yield_entries_content
from
venc2.datastore.entry
import
Entry
from
venc2.datastore.metadata
import
MetadataNode
from
venc2.pattern.code_highlight
import
CodeHighlight
from
venc2.pattern
s
.code_highlight
import
CodeHighlight
def
merge
(
iterable
,
argv
):
return
argv
[
1
].
join
(
...
...
src/venc2/datastore/entry.py
View file @
3ddd013b
...
...
@@ -28,7 +28,7 @@ from venc2.helpers import notify
from
venc2.l10n
import
messages
from
venc2.datastore.metadata
import
MetadataNode
from
venc2.pattern.processor
import
PreProcessor
from
venc2.pattern
s
.processor
import
PreProcessor
class
EntryWrapper
:
def
__init__
(
self
,
wrapper
):
...
...
src/venc2/datastore/theme.py
View file @
3ddd013b
...
...
@@ -20,7 +20,7 @@
from
venc2.datastore.entry
import
EntryWrapper
from
venc2.helpers
import
die
from
venc2.l10n
import
messages
from
venc2.pattern.processor
import
PreProcessor
from
venc2.pattern
s
.processor
import
PreProcessor
themes_descriptor
=
{
"dummy"
:
{
"columns"
:
1
,
"_themeDescription_"
:
messages
.
theme_description_dummy
},
...
...
src/venc2/patterns/code_highlight.py
View file @
3ddd013b
...
...
@@ -21,6 +21,7 @@ import os
import
pygments.lexers
import
pygments.formatters
from
venc2.helpers
import
die
from
venc2.helpers
import
notify
from
venc2.l10n
import
messages
...
...
@@ -37,7 +38,6 @@ class CodeHighlight:
def
export_style_sheets
(
self
):
extra
=
os
.
listdir
(
os
.
getcwd
()
+
"/extra/"
)
for
key
in
self
.
includes
:
if
key
not
in
extra
:
stream
=
open
(
os
.
getcwd
()
+
"/extra/"
+
key
,
'w'
)
...
...
src/venc2/threads/categories_thread.py
View file @
3ddd013b
...
...
@@ -21,8 +21,8 @@ import os
from
venc2.helpers
import
notify
from
venc2.threads.thread
import
Thread
from
venc2.pattern.processor
import
UnknownContextual
from
venc2.pattern.processor
import
merge_batches
from
venc2.pattern
s
.processor
import
UnknownContextual
from
venc2.pattern
s
.processor
import
merge_batches
class
CategoriesThread
(
Thread
):
def
__init__
(
self
,
prompt
,
datastore
,
theme
,
patterns
):
...
...
Prev
1
2
Next
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