Layout of book and interface

master
Gijs 3 years ago
parent 34e8fc3f40
commit 16a866dde1

@ -1,2 +1,3 @@
spacy
weasyprint
#weasyprint
flask

@ -2,10 +2,12 @@
from flask import Flask, render_template, request, Response
# from weasyprint import HTML
from pagedjs import make_pdf
from .pagedjs import make_pdf
from .settings import DEBUG, BASEURL
# Spacy tries to import CUDA, do not break when it fails
try:
from paseo import crear_camino
from .paseo import crear_camino
except ModuleNotFoundError:
pass
@ -13,9 +15,11 @@ import os.path
basepath = os.path.dirname(__file__)
BASEURL = ''
app = Flask(__name__)
# Book HTML is loaded through filesystem, in a tmp dir, make path absolute.
PAGEDJS_STATIC_DIR = os.path.join(basepath, 'static')
@app.route('{}/'.format(BASEURL))
def index():
return render_template('index.html')
@ -28,28 +32,34 @@ def book():
if fragment == 0:
novel = os.path.join(basepath, '../data/emilia_prueba.txt')
author = 'Emilia Pardo Bazán'
title = 'La Madre Naturaleza'
author = 'Emilia Pardo Bazán' # Non breaking spaces
title = 'La Madre Naturaleza' # Non breaking spaces
else:
novel = os.path.join(basepath, '../data/prueba.txt')
author = 'Benito Pérez Gáldos'
author = 'Benito Pérez Gáldos' # Non breaking spaces
title = 'Miau'
path = crear_camino(novel, first_word)
context = { 'title': title, 'author': author, 'path': path }
context = {
'title': title,
'author': author,
'path': path,
'STATIC_DIR': '/static' if DEBUG else PAGEDJS_STATIC_DIR,
'DEBUG': DEBUG
}
html = render_template('book.html', **context)
if (DEBUG):
return html
else:
pdf = make_pdf(html)
# pdf = HTML(string=html).write_pdf()
# Use pagedjs as weasyprint does not seem to support our layout.
pdf = make_pdf(html)
r = Response(pdf, mimetype='application/pdf')
r = Response(pdf, mimetype='application/pdf')
r.headers.extend({
'Content-Disposition': 'attachment; filename="Paseo por arboles de madrid.pdf"'
})
r.headers.extend({
'Content-Disposition': 'attachment; filename="Paseo por arboles de madrid.pdf"'
})
return r
# return html
return r

@ -1,13 +1,14 @@
import subprocess
import tempfile
import os.path
from .settings import PAGEDJS_BINARY_PATH
basepath = os.path.abspath(os.path.dirname(__file__))
paged_bin = 'node_modules/pagedjs-cli/bin/paged'
def run_pagedjs (path_html, path_pdf, cwd=None, extra_scripts=[]):
args = [
paged_bin
PAGEDJS_BINARY_PATH
]
for script in extra_scripts:

@ -1,5 +1,5 @@
from parse_trees import load_trees_from_json
from medialab import crear_base_datos, paso
from .parse_trees import load_trees_from_json
from .medialab import crear_base_datos, paso
from random import shuffle, random
# creating Markov Chain in text & trees

@ -0,0 +1,3 @@
PAGEDJS_BINARY_PATH = 'node_modules/pagedjs-cli/bin/paged'
DEBUG = True
BASEURL = ''

@ -0,0 +1,94 @@
Copyright (c) 2014, the font authors (see font file information)
with Reserved Font Name MFI Serreria Extravagante.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

@ -0,0 +1,3 @@
2012-2019 (c) Manufactura Independente & the participants of the "Stone to Spaceship" workshop at Medialab Prado in July 2012: Javier Gonzalez, Eduardo Merchán, Guillermo Afonso, Beatriz García, Alberto Hernández, Marta Calabria, Txus Tejado, Beatriz Fernández, Marcos Prack, Pablo Gámez, Miriam Castro, César A. Fernández, Gabriel Lucas, Alfredo Calosci, Rafael Parrilla.
Visit http://manufacturaindependente.com/stonespaceship/ for additional information.

@ -0,0 +1,94 @@
Copyright (c) 2010, ParaType Ltd. (http://www.paratype.com/public),
with Reserved Font Names "PT Sans", "PT Serif" and "ParaType".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

@ -0,0 +1,3 @@
/* CSS for Paged.js interface v0.2 */ /* Change the look */ :root { --color-background: whitesmoke; --color-pageSheet: #cfcfcf; --color-pageBox: violet; --color-paper: white; --color-marginBox: transparent; --pagedjs-crop-color: black; --pagedjs-crop-shadow: white; --pagedjs-crop-stroke: 1px; } /* To define how the book look on the screen: */ @media screen { body { background-color: var(--color-background); } .pagedjs_pages { display: flex; width: calc(var(--pagedjs-width) * 2); flex: 0; flex-wrap: wrap; margin: 0 auto; } .pagedjs_page { background-color: var(--color-paper); box-shadow: 0 0 0 1px var(--color-pageSheet); margin: 0; flex-shrink: 0; flex-grow: 0; margin-top: 10mm; } .pagedjs_first_page { margin-left: var(--pagedjs-width); } .pagedjs_page:last-of-type { margin-bottom: 10mm; } .pagedjs_pagebox{ box-shadow: 0 0 0 1px var(--color-pageBox); } .pagedjs_left_page{ z-index: 20; width: calc(var(--pagedjs-bleed-left) + var(--pagedjs-pagebox-width))!important; } .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-crop { border-color: transparent; } .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-middle{ width: 0; } .pagedjs_right_page{ z-index: 10; position: relative; left: calc(var(--pagedjs-bleed-left)*-1); } /* show the margin-box */ .pagedjs_margin-top-left-corner-holder, .pagedjs_margin-top, .pagedjs_margin-top-left, .pagedjs_margin-top-center, .pagedjs_margin-top-right, .pagedjs_margin-top-right-corner-holder, .pagedjs_margin-bottom-left-corner-holder, .pagedjs_margin-bottom, .pagedjs_margin-bottom-left, .pagedjs_margin-bottom-center, .pagedjs_margin-bottom-right, .pagedjs_margin-bottom-right-corner-holder, .pagedjs_margin-right, .pagedjs_margin-right-top, .pagedjs_margin-right-middle, .pagedjs_margin-right-bottom, .pagedjs_margin-left, .pagedjs_margin-left-top, .pagedjs_margin-left-middle, .pagedjs_margin-left-bottom { box-shadow: 0 0 0 1px inset var(--color-marginBox); } /* uncomment this part for recto/verso book : ------------------------------------ */ /* .pagedjs_pages { flex-direction: column; width: 100%; } .pagedjs_first_page { margin-left: 0; } .pagedjs_page { margin: 0 auto; margin-top: 10mm; } .pagedjs_left_page{ width: calc(var(--pagedjs-bleed-left) + var(--pagedjs-pagebox-width) + var(--pagedjs-bleed-left))!important; } .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-crop{ border-color: var(--pagedjs-crop-color); } .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-middle{ width: var(--pagedjs-cross-size)!important; } .pagedjs_right_page{ left: 0; } */ /*--------------------------------------------------------------------------------------*/ /* uncomment this par to see the baseline : -------------------------------------------*/ /* .pagedjs_pagebox { --pagedjs-baseline: 22px; --pagedjs-baseline-position: 5px; --pagedjs-baseline-color: cyan; background: linear-gradient(transparent 0%, transparent calc(var(--pagedjs-baseline) - 1px), var(--pagedjs-baseline-color) calc(var(--pagedjs-baseline) - 1px), var(--pagedjs-baseline-color) var(--pagedjs-baseline)), transparent; background-size: 100% var(--pagedjs-baseline); background-repeat: repeat-y; background-position-y: var(--pagedjs-baseline-position); } */ /*--------------------------------------------------------------------------------------*/ } /* Marks (to delete when merge in paged.js) */ .pagedjs_marks-crop{ z-index: 999999999999; } .pagedjs_bleed-top .pagedjs_marks-crop, .pagedjs_bleed-bottom .pagedjs_marks-crop{ box-shadow: 1px 0px 0px 0px var(--pagedjs-crop-shadow); } .pagedjs_bleed-top .pagedjs_marks-crop:last-child, .pagedjs_bleed-bottom .pagedjs_marks-crop:last-child{ box-shadow: -1px 0px 0px 0px var(--pagedjs-crop-shadow); } .pagedjs_bleed-left .pagedjs_marks-crop, .pagedjs_bleed-right .pagedjs_marks-crop{ box-shadow: 0px 1px 0px 0px var(--pagedjs-crop-shadow); } .pagedjs_bleed-left .pagedjs_marks-crop:last-child, .pagedjs_bleed-right .pagedjs_marks-crop:last-child{ box-shadow: 0px -1px 0px 0px var(--pagedjs-crop-shadow); }

@ -6,37 +6,35 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
@page {
size: 210mm 297mm;
margin: 10mm 10mm 15mm 10mm;
@font-face {
font-family: Serreria;
src: url({{ STATIC_DIR }}/MFI-Serreria/MFI-Serreria-Extravagante.otf) format('opentype');
font-weight: normal;
font-style: normal;
}
[data-picked] {
text-decoration: underline;
position: relative;
@font-face {
font-family: PTSerif;
src: url({{ STATIC_DIR }}/PT_Serif/PTSerif-Regular.ttf) format('truetype');
font-weight: normal;
font-style: normal;
}
[data-picked]::after {
content: ' → ';
text-decoration: none;
position: absolute;
left: calc(100% + 1.5em);
top: 0;
height: 1.2em;
display: block;
}
.traces > :last-child [data-picked]::after {
display: none;
@font-face {
font-family: PTSerif;
src: url({{ STATIC_DIR }}/PT_Serif/PTSerif-Italic.ttf) format('truetype');
font-weight: normal;
font-style: italic;
}
@page {
size: a4;
size: 210mm 297mm;
margin: 0mm 10mm 15mm 10mm;
}
@page title {
background: black;
margin: 10mm 10mm 15mm 10mm;
background: green;
}
@page:left {
@ -73,6 +71,18 @@
}
}
:root {
--font-size: 10pt;
--line-height: 15pt;
}
html, body {
font-family: PTSerif;
font-size: var(--font-size);
line-height: var(--line-height);
}
ul {
margin: 0;
padding: 0;
@ -82,28 +92,44 @@
page: title;
color: white;
page-break-after: right;
font-family: Serreria;
font-weight: normal;
font-size: 24pt;
line-height: 30pt;
}
h1 em {
text-decoration: underline;
font-style: normal;
}
section.step {
page-break-before: always;
text-align: center;
display: flex;
flex-direction: column;
height: 252mm;
align-items: center;
justify-content: space-between;
overflow: hidden;
position: relative;
height: 282mm;
/* position: relative; */
margin: 0;
padding: 0;
}
section.step_content {
overflow: hidden;
position: absolute;
top: 20mm;
left: 0;
right: 0;
bottom: 0mm;
}
.traces {
list-style-type: none;
display: flex;
flex-direction: row;
position: absolute;
top: 50%;
left: 0;
right: 0;
justify-content: center;
line-height: 1.2em;
margin: 0;
padding: 0;
@ -116,58 +142,87 @@
}
.options li {
line-height: 1.2em;
height: 1.2em;
line-height: var(--line-height);
height: var(--line-height);
margin: 0;
padding: 0;
}
.sentence {
z-index: 1;
position: relative;
/* background: -webkit-linear-gradient(to top, rgba(255,255,255,0), white 2.5em); */
/* background: linear-gradient(to top, rgba(255,255,255,0), white 2.5em); */
background: white;
position: absolute;
top: 3mm;
padding: 0.5em 20mm 3em 20mm;
width: 100%;
box-sizing: border-box;
/* background: -webkit-linear-gradient(to top, rgba(255,255,255,0), white 2.5em); */
/* background: linear-gradient(to top, rgba(255,255,255,0), white 2.5em); */
/* background: white; */
}
.tree {
z-index: 1;
position: relative;
/* background: -webkit-linear-gradient(to top, rgba(255,255,255,0), white 2.5em); */
/* background: linear-gradient(to bottom, rgba(255,255,255,0), white 2.5em); */
background: white;
padding: 3em 20mm 0.5em 20mm;
position: absolute;
padding: 0 20mm 0 20mm;
bottom: -10mm;
width: 100%;
box-sizing: border-box;
/* background: -webkit-linear-gradient(to top, rgba(255,255,255,0), white 2.5em); */
/* background: linear-gradient(to bottom, rgba(255,255,255,0), white 2.5em); */
/* background: white; */
}
[data-picked] {
text-decoration: underline;
position: relative;
/* font-style: italic; */
}
[data-picked]::after {
content: ' → ';
text-decoration: none;
position: absolute;
left: calc(100% + 1.5em);
top: 0;
height: 1.2em;
display: block;
}
.traces > :last-child [data-picked]::after {
display: none;
}
</style>
{% if DEBUG %}
<link href="{{ STATIC_DIR }}/pagedjs-interface.css" rel="stylesheet" type="text/css">
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
{% endif %}
</head>
<body>
<h1>Paseo por los árboles de Madrid con {{ author }} y {{ title }}</h1>
<h1>Paseo por los árboles de Madrid con&nbsp;<em>{{ author }}</em> y&nbsp;{{ title }}</h1>
{% for sentence, previous_steps, tree, traces in path %}
<section class="step">
<section class="sentence">
{{ previous_steps }}
</section>
<ul class="traces">
{% for word, dice, options in traces %}
<li style="margin-top: calc({{ dice }} * -1.2em)">
<ul class="options">
{% for option in options %}
<li {% if loop.index0 == dice %}data-picked{% endif %}>
{{ option }}
</li>
{% endfor %}
</ul>
<!-- Rolled: {{ dice }} -->
</li>
{% endfor %}
</ul>
<section class="step_content">
<ul class="traces">
{% for word, dice, options in traces %}
<li style="margin-top: calc(-{{ dice }} * var(--line-height))">
<ul class="options">
{% for option in options %}
<li {% if loop.index0 == dice %}data-picked{% endif %}>
{{ option }}
</li>
{% endfor %}
</ul>
<!-- Rolled: {{ dice }} -->
</li>
{% endfor %}
</ul>
</section>
<section class="tree">
{{ tree.properties.NOMBRE_COMUN }} en {{ tree.properties.MINTDIRECCIONAUX }}
</section>

@ -6,20 +6,76 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Paseo por los árboles de Madrid</title>
<style>
@font-face {
font-family: Serreria;
src: url(static/MFI-Serreria/MFI-Serreria-Extravagante.otf) format('opentype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: PTSerif;
src: url(static/PT_Serif/PTSerif-Regular.ttf) format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: PTSerif;
src: url(static/PT_Serif/PTSerif-Italic.ttf) format('truetype');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: PTSerif;
src: url(static/PT_Serif/PTSerif-Bold.ttf) format('truetype');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: PTSerif;
src: url(static/PT_Serif/PTSerif-BoldItalic.ttf) format('truetype');
font-weight: bold;
font-style: italic;
}
body {
max-width: 60ch;
margin: 3em auto;
/* max-width: 60ch; */
margin: 2em 1em 1em 1em;
font-size: var(--font-size);
line-height: var(--line-height)
line-height: var(--line-height);
font-family: PTSerif, serif;
flex-direction: row;
box-sizing: border-box;
/* height: calc(100vh - 2em); */
/* align-items: center; */
display: grid;
grid-template-columns: 1fr 1.5fr 1.5fr;
column-gap: 2em;
}
:root {
--font-size: 14pt;
--font-size: 13pt;
--line-height: 18pt;
}
h1 {
line-height: 1.25;
font-family: Serreria;
font-weight: regular;
font-size: 34pt;
line-height: 45pt;
margin-top: 0;
}
p {
margin-top: 0;
}
form {
padding-left: 11ch;
}
label {
@ -32,43 +88,98 @@
font: inherit;
}
@media screen and (max-width: 600px) {
footer {
margin-top: calc(3 * var(--line-height));
font-size: 85%;
}
#title {
grid-column: 1;
position: sticky;
top: 2rem;
align-self: start;
}
#introduction {
align-self: start;
position: sticky;
top: 2rem;
}
#introduction, #form {
margin-bottom: 2rem;
}
footer {
position: fixed;
bottom: .5em;
left: .5em;
right: .5em;
}
@media screen and (max-width: 900px) {
body {
margin: 3em 1em;
grid-template-columns: 1fr 1.5fr;
grid-template-rows: min-content min-content;
}
label {
margin-left: 11ch;
#title {
grid-row: 1 / span 2;
}
#introduction {
position: initial;
margin-bottom: 0;
}
}
footer {
margin-top: calc(3 * var(--line-height));
font-size: 85%;
@media screen and (max-width: 720px) {
body {
grid-template-columns: 1fr;
grid-template-rows: min-content min-content min-content min-content;
}
#title {
grid-row: initial;
position: initial;
}
#form {
margin-bottom: 0;
}
footer {
position: initial;
}
}
</style>
</head>
<body>
<h1>Paseo por los árboles de Madrid</h1>
<p>En este libro, el algoritmo de las cadenas de Markov genera simultáneamente un poema y un paseo por los árboles del barrio de Las Letras, en el centro de Madrid. A pesar de la impresión de que hay pocos árboles en el barrio, el algoritmo cuenta con 460 de ellos. </p>
<p>La cadena de Markov fue diseñada en 1906 por Andrey Markov, un matemático ruso fallecido en 1992. Este algoritmo está en la base de muchos programas informáticos que generan spam. Se utiliza para sistemas que describen una serie de eventos que son interdependientes. Lo que ocurre depende únicamente del paso anterior.</p>
<p>El libro se construye entonces paso a paso. </p>
<p>
<strong>Puedes elegir una novela para crear tu Paseo por árboles de Madrid.</strong>
</p>
<form method="POST" action="/book">
<label><input type="radio" name="fragment" value="0" checked> Opción 1: La novela <em>La madre naturaleza</em> de la escritora feminista <em>Emilia Pardo Bazán</em>
fue publicada en 1887. Usa en esta obra una prosa poética y descriptiva, y en sus páginas se
siente el amor que profesa al paisaje gallego, con un conocimiento de la botánica y de
las costumbres rurales muy superior al de sus contemporáneos.</label><br />
<label><input type="radio" name="fragment" value="1"> Opción 2: La novela <em>Miau</em> del escritor <em>Benito Pérez Galdós</em> fue publicada en 1888.
Enmarcada en el género realista, satiriza el Madrid burocrático de finales del siglo XIX
a partir de las vicisitudes vitales de su protagonista, Ramón Villaamil,
un competente exempleado del Ministerio de Hacienda, al que una serie de intrigas
han dejado cesante.</label><br />
<button type="submit">Generate</button>
</form>
<h1 id="title">Paseo por los árboles de Madrid</h1>
<section id="introduction">
<p>En este libro, el algoritmo de las cadenas de Markov genera simultáneamente un poema y un paseo por los árboles del barrio de Las Letras, en el centro de Madrid. A pesar de la impresión de que hay pocos árboles en el barrio, el algoritmo cuenta con 460 de ellos. </p>
<p>La cadena de Markov fue diseñada en 1906 por Andrey Markov, un matemático ruso fallecido en 1992. Este algoritmo está en la base de muchos programas informáticos que generan spam. Se utiliza para sistemas que describen una serie de eventos que son interdependientes. Lo que ocurre depende únicamente del paso anterior.</p>
<p>El libro se construye entonces paso a paso. </p>
</section>
<section id="form">
<p>
<strong>Puedes elegir una novela para crear tu Paseo por árboles de Madrid.</strong>
</p>
<form method="POST" action="/book">
<label><input type="radio" name="fragment" value="0" checked> Opción 1: La novela <em>La madre naturaleza</em> de la escritora feminista <em>Emilia Pardo Bazán</em>
fue publicada en 1887. Usa en esta obra una prosa poética y descriptiva, y en sus páginas se
siente el amor que profesa al paisaje gallego, con un conocimiento de la botánica y de
las costumbres rurales muy superior al de sus contemporáneos.</label><br />
<label><input type="radio" name="fragment" value="1"> Opción 2: La novela <em>Miau</em> del escritor <em>Benito Pérez Galdós</em> fue publicada en 1888.
Enmarcada en el género realista, satiriza el Madrid burocrático de finales del siglo XIX
a partir de las vicisitudes vitales de su protagonista, Ramón Villaamil,
un competente exempleado del Ministerio de Hacienda, al que una serie de intrigas
han dejado cesante.</label><br />
<button type="submit">Generate</button>
</form>
</section>
<footer>
Paseo por los árboles de Madrid is a publication by <a href="http://algoliterarypublishing.net/">An&nbsp;Algoliterary Publishing&nbsp;House</a>
</footer>

Loading…
Cancel
Save