added intro

This commit is contained in:
Bachir Soussi Chiadmi
2017-10-18 12:30:38 +02:00
parent 50a22a57dc
commit f45f05be04
12 changed files with 1243 additions and 1083 deletions
+17 -7
View File
@@ -753,7 +753,7 @@ html, body {
header { header {
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 4em; height: 5em;
top: 0; top: 0;
z-index: 5; z-index: 5;
background-color: white; } background-color: white; }
@@ -762,14 +762,21 @@ header {
vertical-align: text-bottom; } vertical-align: text-bottom; }
header > *:last-child { header > *:last-child {
margin-right: 1em; } margin-right: 1em; }
header > h1 { header hgroup {
font-size: 3em; margin: 0 4em 0 70px; }
margin: 0 0 0 70px; } header hgroup h1, header hgroup h2 {
margin: 0;
padding: 0;
line-height: 1; }
header hgroup h1 {
font-size: 3em; }
header hgroup h2 {
line-height: 1; }
header #menus > * { header #menus > * {
display: inline-block; display: inline-block;
vertical-align: top; } vertical-align: top; }
header #menus nav { header #menus nav {
padding: 1em 1em; padding: 0 1em;
position: relative; } position: relative; }
header #menus nav h3 { header #menus nav h3 {
margin: 0; margin: 0;
@@ -815,7 +822,7 @@ header {
color: #000; } color: #000; }
.sticky-clone-wrapper { .sticky-clone-wrapper {
padding-top: 4em; padding-top: 5em;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
@@ -829,7 +836,7 @@ header {
margin: 0 0 0 70px; } margin: 0 0 0 70px; }
main#content { main#content {
margin-top: 4em; } margin-top: 5em; }
main#content h1.part-title { main#content h1.part-title {
font-size: 1.6em; font-size: 1.6em;
width: 450px; } width: 450px; }
@@ -839,6 +846,9 @@ main#content {
font-size: 1em; font-size: 1em;
width: 450px; } width: 450px; }
section.intro {
margin-left: 70px; }
main#content.inline h1.part-title { main#content.inline h1.part-title {
margin: 1em 0 0 70px; } margin: 1em 0 0 70px; }
+1105 -1049
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+10 -1
View File
@@ -1,9 +1,18 @@
[ [
{
"index":0,
"id":"intro",
"text": "Ethica \nordine geometrico demonstrata \net \nin quinque Partes distincta \nin quibus agitur"
},
{ {
"index": 1, "index": 1,
"id": "p1", "id": "p1",
"title": "_Pars Prima,_\n\n DE DEO.\n\n\n\n DEFINITIONES ", "title": "_Pars Prima,_\n\n DE DEO.",
"enonces": [ "enonces": [
{
"title":"DEFINITIONES",
"type":"title"
},
{ {
"id": "1d1", "id": "1d1",
"title": "", "title": "",
+10 -1
View File
@@ -1,9 +1,18 @@
[ [
{
"index":0,
"id":"intro",
"text": "Éthique \ndémontrée suivant l'ordre géométrique \net \ndivisée en cinq Parties"
},
{ {
"index": 1, "index": 1,
"id": "p1", "id": "p1",
"title": "_Première Partie,_\n\n DE DIEU.", "title": "_Première Partie,_\n\n DE DIEU.",
"enonces": [ "enonces": [
{
"title":"DEFINITIONS",
"type":"title"
},
{ {
"id":"1d1", "id":"1d1",
"title":"", "title":"",
@@ -717,7 +726,7 @@
{ {
"index": 2, "index": 2,
"id": "p2", "id": "p2",
"title": "Deuxième Partie, \n\n\n\n DE _la Nature et de l'Origine de_ L'ÂME.", "title": "_Deuxième Partie_, \n\n\n\n DE _la Nature et de l'Origine de_ L'ÂME.",
"enonces": [ "enonces": [
{ {
"id": "2pr", "id": "2pr",
+7 -2
View File
@@ -1,4 +1,9 @@
[ [
{
"index":0,
"id":"intro",
"text": "Ethics \nDemonstrated in Geometrical Order \nand \ndivided into five Parts"
},
{ {
"index": 1, "index": 1,
"id": "p1", "id": "p1",
@@ -11,7 +16,7 @@
{ {
"id": "1d1", "id": "1d1",
"title": "", "title": "",
"text": "i ; By that which is self-caused, I mean that of which the essence involves existence, or that of which the nature is only conceivable as existent.", "text": "I. By that which is self-caused, I mean that of which the essence involves existence, or that of which the nature is only conceivable as existent.",
"childs": [] "childs": []
}, },
{ {
@@ -35,7 +40,7 @@
{ {
"id": "1d5", "id": "1d5",
"title": "", "title": "",
"text": "By mode, I mean the modifications ^[\"Affectiones\"] of substance, or that which exists in, and is conceived through, something other than itself.", "text": "By mode, I mean the modifications (_Affectiones_) of substance, or that which exists in, and is conceived through, something other than itself.",
"childs": [] "childs": []
}, },
{ {
+5
View File
@@ -1,4 +1,9 @@
[ [
{
"index":0,
"id":"intro",
"text": "Ética \ndemonstrada em ordem geométrica \ne \ndividida em cinco Partes que tratam"
},
{ {
"index": 1, "index": 1,
"id": "P1", "id": "P1",
+14 -5
View File
@@ -21,7 +21,7 @@ html, body{
padding:0; padding:0;
} }
$header_height:4em; $header_height:5em;
$dot_w:500px; $dot_w:500px;
$bullet_w:40px; $bullet_w:40px;
$margin_left:50px + ($bullet_w/2); $margin_left:50px + ($bullet_w/2);
@@ -39,9 +39,14 @@ header{
// &:first-child{ margin-left: 1em;} // &:first-child{ margin-left: 1em;}
&:last-child{ margin-right: 1em;} &:last-child{ margin-right: 1em;}
} }
>h1{ hgroup{
font-size: 3em; margin: 0 4em 0 $margin_left;
margin: 0 0 0 $margin_left; h1,h2{
margin:0; padding:0;
line-height: 1;
}
h1{font-size: 3em;}
h2{line-height: 1;}
} }
@@ -52,7 +57,7 @@ header{
vertical-align: top; vertical-align: top;
} }
nav { nav {
padding:1em 1em; padding:0 1em;
position: relative; position: relative;
h3{ h3{
margin:0; padding:0; margin:0; padding:0;
@@ -167,6 +172,10 @@ main#content{
} }
section.intro{
margin-left: $margin_left;
}
// ____ __ _ // ____ __ _
// / _/___ / / (_)___ ___ // / _/___ / / (_)___ ___
// / // __ \/ / / / __ \/ _ \ // / // __ \/ / / / __ \/ _ \
+12 -8
View File
@@ -12,7 +12,8 @@ module.exports = {
{ {
'lc':'lat', 'lc':'lat',
'label':'Latin (Carl Gebhardt)', 'label':'Latin (Carl Gebhardt)',
'db':'0-LAT-ethicadb.json'}, 'db':'0-LAT-ethicadb.json'
},
{ {
'lc':'fr', 'lc':'fr',
'label':'Français (Traduction par Charles Appuhn)', 'label':'Français (Traduction par Charles Appuhn)',
@@ -70,6 +71,7 @@ module.exports = {
this.loaded_dbs ++; this.loaded_dbs ++;
// //
if (this.loaded_dbs == this.langs.length) { if (this.loaded_dbs == this.langs.length) {
console.log('All db loaded : data', this.data);
this.parseByID(callback); this.parseByID(callback);
} }
@@ -79,13 +81,15 @@ module.exports = {
// console.log('l', l); // console.log('l', l);
this.data_byid[l] = {}; this.data_byid[l] = {};
for (p in this.data[l]) { for (p in this.data[l]) {
// console.log(this.data[l][p]); if(this.data[l][p].type !== "intro"){
for (e in this.data[l][p].enonces) { // console.log(this.data[l][p]);
// console.log('e',e); for (e in this.data[l][p].enonces) {
this.data_byid[l][this.data[l][p].enonces[e].id] = this.data[l][p].enonces[e]; // console.log('e',e);
for (c in this.data[l][p].enonces[e].childs){ this.data_byid[l][this.data[l][p].enonces[e].id] = this.data[l][p].enonces[e];
// console.log(_db[p][e][c]); for (c in this.data[l][p].enonces[e].childs){
this.data_byid[l][this.data[l][p].enonces[e].childs[c].id] = this.data[l][p].enonces[e].childs[c]; // console.log(_db[p][e][c]);
this.data_byid[l][this.data[l][p].enonces[e].childs[c].id] = this.data[l][p].enonces[e].childs[c];
}
} }
} }
} }
+9 -4
View File
@@ -13,7 +13,10 @@ var markdown = require('markdown-it')()
module.exports = { module.exports = {
view: function(vn){ view: function(vn){
return m('header', [ return m('header', [
m('h1', 'Ethica'), m('hgroup', [
m('h1', 'Ethica'),
m('h2', 'Benedictus Spinoza')
]),
// m('nav', {'id':'parts-nav'}, [ // m('nav', {'id':'parts-nav'}, [
// //
// ]), // ]),
@@ -40,9 +43,11 @@ var _PartsNav = {
m('h3', 'Parts'), m('h3', 'Parts'),
m('ul', _dbs.data[lang].map(function(p){ m('ul', _dbs.data[lang].map(function(p){
// console.log("anchors, part", p); // console.log("anchors, part", p);
return m('li', [ if(p.id !== "intro"){
m('a', {'href':'#'+p.id}, m.trust(markdown.renderInline(p.title))) return m('li', [
]); m('a', {'href':'#'+p.id}, m.trust(markdown.renderInline(p.title)))
]);
}
}) })
) )
]); ]);
+26 -2
View File
@@ -303,6 +303,26 @@ var _Part = {
} }
} }
// ____ __
// / _/___ / /__________
// / // __ \/ __/ ___/ __ \
// _/ // / / / /_/ / / /_/ /
// /___/_/ /_/\__/_/ \____/
var _Intro = {
oninit : function(vn){
console.log('_Intro : oninit : vn', vn);
this.id = vn.attrs.id;
this.text = vn.attrs.text || '';
},
onbeforeupdate : function(vn, old){
this.id = vn.attrs.id;
this.text = vn.attrs.text || '';
},
view : function(vn){
return m("section", {'class':'intro'}, m("p",m.trust(markdown.renderInline(this.text))));
}
}
// ____ __ _ // ____ __ _
// / _/___ / / (_)___ ___ // / _/___ / / (_)___ ___
// / // __ \/ / / / __ \/ _ \ // / // __ \/ / / / __ \/ _ \
@@ -321,8 +341,12 @@ module.exports = {
return [ return [
m(_Header), m(_Header),
m('main', {id:"content", 'class':'inline'}, _dbs.data[vn.attrs.lang].map(function(p){ m('main', {id:"content", 'class':'inline'}, _dbs.data[vn.attrs.lang].map(function(p){
// console.log("MAP _dbs", p); console.log("MAP _dbs", p);
return m(_Part,p); if(p.id == 'intro'){
return m(_Intro,p);
}else{
return m(_Part,p);
}
}) })
), ),
m(_Footer) m(_Footer)
+25 -1
View File
@@ -322,6 +322,26 @@ var _Part = {
} }
} }
// ____ __
// / _/___ / /__________
// / // __ \/ __/ ___/ __ \
// _/ // / / / /_/ / / /_/ /
// /___/_/ /_/\__/_/ \____/
var _Intro = {
oninit : function(vn){
console.log('_Intro : oninit : vn', vn);
this.id = vn.attrs.id;
this.text = vn.attrs.text || '';
},
onbeforeupdate : function(vn, old){
this.id = vn.attrs.id;
this.text = vn.attrs.text || '';
},
view : function(vn){
return m("section", {'class':'intro'}, m("p",m.trust(markdown.renderInline(this.text))));
}
}
// ______ // ______
// /_ __/_______ ___ // /_ __/_______ ___
@@ -341,7 +361,11 @@ module.exports = {
return [ return [
m(_Header), m(_Header),
m('main', {id:"content", 'class':'tree'}, _dbs.data[vn.attrs.lang].map(function(p){ m('main', {id:"content", 'class':'tree'}, _dbs.data[vn.attrs.lang].map(function(p){
return m(_Part,p); if(p.id == 'intro'){
return m(_Intro,p);
}else{
return m(_Part,p);
}
}) })
), ),
m(_Footer) m(_Footer)