Little refactoring and addition of ebooks

This commit is contained in:
NikaZhenya 2018-10-04 12:07:19 -05:00
parent 59ee5fe71b
commit 5bc7925ff5
14 changed files with 1972 additions and 92 deletions

175
build.rb
View File

@ -6,24 +6,25 @@ require 'fileutils'
require 'time' require 'time'
require 'json' require 'json'
# Also requires Pecas #=> Also requires Inkscape and Pecas
Encoding.default_internal = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8
Dir.chdir(File.dirname(__FILE__)) Dir.chdir(File.dirname(__FILE__))
# Variables #=> Variables
$language = 'en-US' $language = 'en-US'
$mariana = 'Mariana Eguaras\'s blog'
$site_name = 'Publishing is Coding: Change My Mind' $site_name = 'Publishing is Coding: Change My Mind'
$site_description = 'A broken english version of some entries published in Mariana Eguaras\'s blog.' $site_description = 'A broken english version of some entries published in ' + $mariana + '.'
$site_keywords = 'publishing, blog, book, ebook, methodology, foss, libre-software, format, markdown, html, epub, pdf, mobi, latex, tex' $site_keywords = 'publishing, blog, book, ebook, methodology, foss, libre-software, format, markdown, html, epub, pdf, mobi, latex, tex'
$site_link = 'https://blog.cliteratu.re' $site_link = 'https://blog.cliteratu.re'
$site_img = 'icon.png' $site_img = 'icon.png'
$author_name = 'Nika Zhenya' $author_name = 'Nika Zhenya'
$author_email = 'nika.zhenya@cliteratu.re' $author_email = 'nika.zhenya@cliteratu.re'
$date = Time.now.to_s.split(' ')[0] $date = Time.now.to_s.split(' ')[0]
$head = `cat template/head.html` $head = File.read('template/site/head.html')
$header = `cat template/header.html` $header = File.read('template/site/header.html')
$footer = `cat template/footer.html` $footer = File.read('template/site/footer.html')
$rss = { $rss = {
:channel => { :channel => {
:title => $site_name, :title => $site_name,
@ -40,10 +41,11 @@ $rss = {
:items => [] :items => []
} }
} }
$xml = []
# Definitions #=> Definitions
# Gets date in a proper format # Gets date in proper format
def get_date d, rfc = false def get_date d, rfc = false
d = d.split('-') d = d.split('-')
@ -82,24 +84,28 @@ def replace_content content, title = 'Main'
] ]
elements.each do |e| elements.each do |e|
content = content.gsub("$#{e[0]}$", e[1]) content.gsub!("$#{e[0]}$", e[1])
end end
if content.split("\n")[0] == '<header>' if content.split("\n")[0] == '<header>'
content = content.gsub("Mariana Eguaras's blog", "<a target=\"_blank\" href=\"https://marianaeguaras.com/blog/\">Mariana Eguaras's blog</a>") content.gsub!($mariana, "<a target=\"_blank\" href=\"https://marianaeguaras.com/blog/\">#{$mariana}</a>")
end end
if title == 'Main' if title == 'Main' then content.gsub!('href="../', 'href="') end
content.gsub!('href="../', 'href="')
end
return content return content
end end
# Changes file content
def change_file url, content
file = File.new(url, 'w:UTF-8')
file.puts content
file.close
end
# Converts MD in other formats # Converts MD in other formats
def convert_md md def convert_md md
content = [] md_content = []
original = {:link => '', :pubDate => ''}
item = { item = {
:guid => $site_link + '/html/' + File.basename(md, '.*'), :guid => $site_link + '/html/' + File.basename(md, '.*'),
:title => '', :title => '',
@ -124,98 +130,129 @@ def convert_md md
item[:title] = l.gsub(/^#/, '').strip item[:title] = l.gsub(/^#/, '').strip
end end
if l =~ /^@original\[.*?\]\s*?$/ if l =~ /^@meta\[.*?\]\s*?$/
data = item_split(l)
elsif l =~ /^@current\[.*?\]\s*?$/
data = item_split(l) data = item_split(l)
item[:pubDate] = get_date(data[0], true) item[:pubDate] = get_date(data[0], true)
item[:category] = data[1] item[:category] = data[1]
item[:description] = data[2] item[:description] = data[2]
content.push( md_content.push(
'<p class="meta">' + '<p class="meta">' +
get_date(data[0]) + ' | ' + get_date(data[0]) + ' | ' +
data[1] + ' | ' + data[1] + ' | ' +
'<span class="smallcap"><a target="_blank" href="' + $site_link + '/epub/' + File.basename(md, ".*") + '.epub">EPUB</a></span> / ' + '<span class="smallcap"><a target="_blank" href="' + $site_link + '/ebooks/' + File.basename(md, ".*") + '.epub">EPUB</a></span> / ' +
'<span class="smallcap"><a target="_blank" href="' + $site_link + '/mobi/' + File.basename(md, ".*") + '.mobi">MOBI</a></span> / ' + '<span class="smallcap"><a target="_blank" href="' + $site_link + '/ebooks/' + File.basename(md, ".*") + '.mobi">MOBI</a></span> / ' +
'<a target="_blank" href="' + data[3] + '">original</a>' + '<a target="_blank" href="' + data[3] + '">original</a>' +
'</p>' '</p>'
) )
else else
content.push(l) md_content.push(l)
end end
end end
# Creates an MD with some changes # Everything is gonna be created in a temporary directory
html_name = 'html/' + File.basename(md, '.*') + '.html' Dir.mkdir('tmp')
new_md_name = 'html/' + File.basename(md) Dir.chdir('tmp')
new_md = File.new(new_md_name, 'w:UTF-8')
new_md.puts content
new_md.close
# Converts MD to HTML # Some variables that are going to be used
html_name = '../html/' + File.basename(md, '.*') + '.html'
new_md_name = File.basename(md)
cover_url = '../../template/ebooks/'
# Creates an MD with some changes so it can be converted to HTML
change_file(new_md_name, md_content)
system("pc-pandog -i #{new_md_name} -o #{html_name}") system("pc-pandog -i #{new_md_name} -o #{html_name}")
FileUtils.rm(new_md_name)
# EPUB and MOBI goes here # Will convert HTML to EPUB and MOBI
system("pc-automata --init")
Dir.chdir('epub-automata')
# Changes some things for the final HTML # Modifies the metadata
write = false yaml_content = File.read('meta-data.yaml')
new_html = [] yaml_content.gsub!('title: Sin título', 'title: "' + item[:title] + '"')
html = File.open(html_name, 'r:UTF-8') .gsub!('Apellido, Nombre', $author_name)
html.each do |l| .gsub!('publisher:', "publisher:\n - Perro Tuerto")
if write && l !~ /^\s*<style/ .gsub!('synopsis:', 'synopsis: "' + item[:description] + '"')
new_html.push(l.gsub(/\s+<\/body>/, '')) .gsub!('category:', "category:\n - \"" + item[:category] + '"')
end .gsub!('language: es', 'language: en')
.gsub!('cover:', 'cover: cover.png')
change_file('meta-data.yaml', yaml_content)
if l =~ /^\s*?<body/ || l =~ /^\s*?<\/body/ # Creates the cover
write = !write FileUtils.cp(cover_url + 'svg/cover.svg', cover_url + 'svg/cover_tmp.svg')
svg_content = File.read(cover_url + 'svg/cover_tmp.svg')
svg_content = replace_content(svg_content, item[:title])
change_file(cover_url + 'svg/cover_tmp.svg', svg_content)
Dir.mkdir(cover_url + 'img')
quiet = `inkscape -z -e #{cover_url}img/cover.png #{cover_url}svg/cover_tmp.svg`
# Creates the ebooks
system("pc-automata -f ../#{html_name} -i #{cover_url}img -c #{cover_url}img/cover.png -s ../../css/core.css -x ../../template/ebooks/xhtml --no-pre --no-analytics --no-ace")
# Removes temporary covers
FileUtils.rm("#{cover_url}svg/cover_tmp.svg")
FileUtils.rm_rf("#{cover_url}img")
# Renames and moves the ebooks
Dir.glob('*.{epub,mobi}').each do |ebook|
if File.basename(ebook) !~ /^epub-[\w|\d]+?\.epub/
FileUtils.mv(ebook, '../../ebooks/' + File.basename(md, '.*') + File.extname(ebook))
end end
end end
html.close Dir.chdir('..')
html = File.open(html_name, 'w:UTF-8')
html.puts replace_content($head, item[:title]), replace_content($header) # Changes head, header, footer and styles for the final HTML
html.puts new_html write = false
html.puts replace_content($footer) html_content = File.read(html_name).gsub(/\n/,'')
html.close html_content.gsub!(/.*?<\/style>\s+/, '')
.gsub!(/<\/body>.*?$/, '')
change_file(html_name, [replace_content($head, item[:title]),
replace_content($header),
html_content,
replace_content($footer)])
# Deletes temporary folder
Dir.chdir('..')
FileUtils.rm_rf('tmp')
# Adds content to RSS # Adds content to RSS
$rss[:channel][:items].push(item) $rss[:channel][:items].push(item)
end end
# Converts the RSS to a XML syntax # Converts the RSS to a XML syntax
def convert_xml file, hash, space = '' def create_xml hash, space = ''
hash.each do |k, v| hash.each do |k, v|
if k.to_s != 'items' if k.to_s != 'items'
file.puts space + '<' + k.to_s + '>' $xml.push(space + '<' + k.to_s + '>')
if k.to_s == 'channel' if k.to_s == 'channel'
file.puts space + ' <atom:link href="' + $site_link + '/feed/rss.xml" rel="self" type="application/rss+xml" />' $xml.push(space + ' <atom:link href="' + $site_link + '/feed/rss.xml" rel="self" type="application/rss+xml" />')
end end
end end
if v.class == Hash if v.class == Hash
convert_xml(file, v, space + ' ') create_xml(v, space + ' ')
elsif v.class == Array elsif v.class == Array
v.each do |e| v.each do |e|
file.puts space + '<item>' $xml.push(space + '<item>')
convert_xml(file, e, space + ' ') create_xml(e, space + ' ')
file.puts space + '</item>' $xml.push(space + '</item>')
end end
else else
file.puts space + ' ' + v $xml.push(space + ' ' + v)
end end
if k.to_s != 'items' if k.to_s != 'items'
file.puts space + '</' + k.to_s + '>' $xml.push(space + '</' + k.to_s + '>')
end end
end end
end end
# Deployment #=> Deployment
# Generates core CSS # Generates core CSS
Dir.chdir('css') Dir.chdir('css')
system("pc-add --add css") system("pc-add --add css")
change_file('core.css', [File.read('styles.css'), File.read('ebooks.css')])
Dir.chdir('..') Dir.chdir('..')
# Gets MDs to convert in other formats # Gets MDs to convert in other formats
@ -226,8 +263,9 @@ end
# Last info added to RSS # Last info added to RSS
$rss[:channel][:lastBuildDate] = get_date($date, true) $rss[:channel][:lastBuildDate] = get_date($date, true)
$rss[:channel][:items].sort_by!{|h| h[:link]}.reverse! $rss[:channel][:items].sort_by!{|h| h[:link]}.reverse!
create_xml($rss)
# Builds the index.html # Builds index.html
puts "Building 'index.html'…" puts "Building 'index.html'…"
html_content = [] html_content = []
$rss[:channel][:items].each do |item| $rss[:channel][:items].each do |item|
@ -237,17 +275,14 @@ $rss[:channel][:items].each do |item|
' | ' + item[:category] + '</p><p>' + item[:description] + '</p></div>' ' | ' + item[:category] + '</p><p>' + item[:description] + '</p></div>'
html_content.push(inner_html.gsub!($site_link, '.')) html_content.push(inner_html.gsub!($site_link, '.'))
end end
html = File.new('index.html', 'w:UTF-8') change_file('index.html', [replace_content($head),
html.puts replace_content($head), replace_content($header) replace_content($header),
html.puts html_content html_content,
html.puts replace_content($footer) replace_content($footer)])
html.close
# Builds the RSS # Builds RSS
puts "Building 'rss.xml'…" puts "Building 'rss.xml'…"
xml = File.new('feed/rss.xml', 'w:UTF-8') change_file('feed/rss.xml', ['<?xml version="1.0" ?>',
xml.puts '<?xml version="1.0" ?>' '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">',
xml.puts '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">' $xml,
convert_xml(xml, $rss) '</rss>'])
xml.puts '</rss>'
xml.close

817
css/core.css Normal file
View File

@ -0,0 +1,817 @@
/**************************************************/
/******************* RESETEADOR *******************/
/**************************************************/
/* http://meyerweb.com/eric/tools/css/reset/ v2.0 */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* Old browsers / Para viejos exploradores */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1.5;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/**************************************************/
/* Fuentes */
@font-face {
font-family: "Bitter Regular";
src: url(../ttf/bitter-regular.ttf);
}
@font-face {
font-family: "Bitter Italic";
src: url(../ttf/bitter-italic.ttf);
}
@font-face {
font-family: "Bitter Bold";
src: url(../ttf/bitter-bold.ttf);
}
@font-face {
font-family: "Bitter BoldItalic";
src: url(../ttf/bitter-bolditalic.ttf);
}
/* Body / Cuerpo */
@media screen and (min-width: 769px) {
body {
margin: 5em;
}
.no-margin, .sin-margen {
margin: -5em;
}
}
@media screen and (max-width: 768px) {
body {
margin: 4em;
}
.no-margin, .sin-margen {
margin: -4em;
}
}
@media screen and (max-width: 640px) {
body {
margin: 3em;
}
.no-margin, .sin-margen {
margin: -3em;
}
}
@media screen and (max-width: 480px) {
body {
margin: 2em;
}
.no-margin, .sin-margen {
margin: -2em;
}
}
@media screen and (max-width: 320px) {
body {
margin: 1em;
}
.no-margin, .sin-margen {
margin: -1em;
}
}
@media amzn-mobi, amzn-kf8 { /* For Kindle because it generates a lot of margin / Para Kindle porque genera mucho margen */
body {
margin: 0;
}
.no-margin, .sin-margen {
margin: 0;
}
}
/* Sections / Secciones */
section + section {
margin-top: 10em;
}
/* Headers / Encabezados */
h1, h2, h3, h4, h5, h6 {
font-family: "Bitter Regular", Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
margin-bottom: 1em;
text-align: left;
font-size: 1em;
-moz-hyphens: none !important;
-webkit-hyphens: none !important;
-o-hyphens: none !important;
-ms-hyphens: none !important;
hyphens: none !important;
}
h2, h3, h4, h5, h6 {
margin-top: 2em;
}
h4, h5, h6 {
text-align: right;
}
h1 {
margin-bottom: 6em;
}
h3, h5 {
font-family: "Bitter Italic", Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-style: italic;
}
h6 {
font-family: "Bitter Bold", Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-weight: bold;
}
h1.title, h1.titulo {
margin-top: 4em;
margin-bottom: 0;
font-size: 2em;
}
h2.subtitle, h2.subtitulo {
margin-top: .5em;
margin-bottom: 3em;
font-size: 1.25em;
}
/* Paragraphs / Párrafos */
p, blockquote, li, figcaption, details, aside {
font-family: "Bitter Regular", Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 1em;
text-align: justify;
line-height: 1.5em;
-moz-hyphens: auto;
-webkit-hyphens: auto;
-o-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
p + p {
text-indent: 1.5em;
}
blockquote {
font-size: .9em;
margin: 1em 1.5em;
}
blockquote + blockquote {
text-indent: 1.5em;
margin-top: -1em;
}
blockquote, blockquote > * {
line-height: 1.65;
}
.justified, .justificado {
text-align: justify !important;
}
.right, .derecha {
text-indent: 0;
text-align: right !important;
}
.left, .izquierda {
text-align: left !important;
}
.centered, .centrado {
text-indent: 0;
text-align: center !important;
}
.hanging, .frances {
margin-left: 1.5em;
text-indent: -1.5em;
text-align: left !important;
}
* + .hanging, * + .frances {
margin-top: 1em;
}
.hanging + .hanging, .frances + .frances {
margin-top: 0;
text-indent: -1.5em;
}
.indent, .sangria {
text-indent: 1.5em;
}
.no-indent, .sin-sangria {
text-indent: 0;
}
.no-hyphens, .sin-separacion {
-moz-hyphens: none !important;
-webkit-hyphens: none !important;
-o-hyphens: none !important;
-ms-hyphens: none !important;
hyphens: none !important;
}
.invisible {
visibility: hidden;
}
.hidden, .oculto {
display: none;
}
.block, .bloque {
display: block;
}
/* Font effects / Efectos en las fuentes */
i, em {
font-family: "Bitter Italic", Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-style: italic;
}
b, strong {
font-family: "Bitter Bold", Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-weight: bold;
}
i > b, b > i,
em > strong, strong > em,
i > strong, strong > i,
em > b, b > em {
font-family: "Bitter BoldItalic", Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
}
.initial, .capitular {
float: left;
font-size: 3em;
margin-top: .15em;
padding-right: .1em;
}
.uppercase, .versal {
text-transform: uppercase;
}
.normal, .redonda {
font-variant: none;
}
.smallcap-light, .versalita-ligera {
font-variant: small-caps;
-moz-hyphens: auto;
-webkit-hyphens: auto;
-o-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
.smallcap, .versalita {
text-transform: lowercase;
font-variant: small-caps;
-moz-hyphens: auto;
-webkit-hyphens: auto;
-o-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
.underline, .subrayado {
text-decoration: underline black;
}
.auto-width, .anchura-auto {
display: block;
width: auto;
margin-left: auto;
margin-right: auto;
}
@media not amzn-mobi, not amzn-kf8 { /* For any device except Kindle / Para cualquier dispositivo excepto Kindle */
.auto-width, .anchura-auto {
max-width: 100%;
}
}
/* Links / Enlaces */
a, a:link, a:visited {
text-decoration: none;
}
/* Lists / Listas */
ol, ul {
margin: 1em 1em 1em 2.5em;
padding: 0;
}
ol {
list-style-type: decimal;
}
ul {
list-style-type: disc;
}
ol ol, ol ul,
ul ol, ul ul {
margin: 0 1em;
}
ol p, ul p {
margin-left: .5em;
}
ul.dash, ul.en-dash, ul.em-dash {
list-style-type: none;
}
ul.dash > li:before, ul.en-dash > li:before, ul.em-dash > li:before {
display: block;
width: 1.5em;
text-align: right;
padding: 0 .5em 0 0;
margin: 0 0 -1.25em -2em;
}
ul.dash > li:before {
content: "-";
}
ul.en-dash > li:before {
content: "";
}
ul.em-dash > li:before {
content: "—";
}
li.no-count {
list-style-type: none;
}
li.no-count:before {
content: none !important;
}
.li-manual {
list-style-type: none;
}
.li-manual > li > p:first-child > span:first-of-type:not(.versalita) {
display: block;
margin-left: -1.5em;
margin-bottom: -1.25em;
}
li > .li-manual {
margin: 0 0 0 1.5em;
}
/* Images / Imágenes */
img { /* It helps if the source doesn't exist / Ayuda a detectarlos si no existe el recurso */
color: #0000EE;
width: 100%;
}
figure {
margin: 2em auto;
}
figcaption {
font-family: "Bitter Regular", Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
margin-top: .5em;
font-size: .9em;
}
figure + figure {
margin-top: 0;
}
p + img {
margin-left: -1.5em;
margin-top: 2em;
margin-bottom: 2em;
}
.caption, .leyenda {
font-size: .9em;
margin-top: -1.5em;
margin-bottom: 2em;
}
.caption + img, .leyenda + img {
margin-top: 0;
}
img + .caption, img + .leyenda {
margin-top: .5em;
}
.caption + p, .leyenda + p {
text-indent: 0;
}
p > img {
display: inline;
height: 1.5em;
width: auto;
}
/* Superscript and subscripts / Superíndices y subíndices */
sup, sub {
font-size: .75em;
vertical-align: super;
}
sub {
vertical-align: sub;
}
/* Code / Código (inspirados en https://codepen.io/elomatreb/pen/hbgxp)*/
code {
font-family: "Courier New", Courier, monospace;
background-color: #fff;
padding: .125em .5em;
border: 1px solid #ddd;
border-radius: .25em;
}
pre {
width: 90%;
font-family: "Courier New", Courier, monospace;
background-color: #fff;
margin: 2em auto;
padding: .5em;
line-height: 1.5;
border-radius: .25em;
box-shadow: .1em .1em .5em rgba(0,0,0,.45);
white-space: unset;
}
pre * {
color: #555;
}
pre code {
display: block;
margin: 0;
padding: 0;
background-color: inherit;
border: none;
border-radius: 0;
}
pre code:before {
width: 1.5em;
display: inline-block;
padding: 0 .5em;
margin-right: .5em;
color: #888;
}
@media not amzn-mobi, not amzn-kf8 { /* For any device except Kindle / Para cualquier dispositivo excepto Kindle */
pre {
counter-reset: line;
overflow: scroll;
}
pre code:before {
counter-increment: line;
content: counter(line);
}
pre code {
white-space: pre;
}
}
@media amzn-mobi, amzn-kf8 { /* Only for Kindle / Solo para Kindle */
pre code:before {
content: "•";
}
}
/* Glosses / Glosas */
section.gloss, body.gloss, section.glosa, body.glosa { /* El estilo ha de ponerse en el contenedor de los párrafos y en el span de la glosa */
margin-right: 7em;
}
span.gloss, span.glosa {
width: 6em; /* No son 7 porque se resta uno del margen añadido a continuación */
margin-right: -8em; /* No son -7 porque se añade 1 de margen */
float: right;
text-indent: 0;
text-align: left;
font-size: .75em;
}
/* Poetry / Poesía: <p class="poetry">Verse 1<br />verse 2<br />verse 3.</p>*/
.poetry, .poesia {
margin: 1em 1.5em;
text-indent: 0;
-moz-hyphens: none;
-webkit-hyphens: none;
-o-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Screenwriting / Guiones */
.mono,
section.script *, section.guion * {
font-family: "Courier New", Courier, monospace;
}
section.script *, section.guion * {
font-size: 1em;
font-style: normal;
font-weight: normal;
font-variant: normal;
margin: 0;
padding: 0;
text-indent: 0;
text-align: left;
-moz-hyphens: none !important;
-webkit-hyphens: none !important;
-o-hyphens: none !important;
-ms-hyphens: none !important;
hyphens: none !important;
}
section.script ol, section.guion ol,
section.script ul, section.guion ul {
margin: 1em 2em;
}
section.script h2, section.guion h2,
section.script h3, section.guion h3,
section.script blockquote, section.guion blockquote {
width: 60%;
margin-left: 3em;
}
section.script h1, section.guion h1 {
text-transform: uppercase;
margin-bottom: 1em;
}
section.script h2, section.guion h2 {
margin-top: 1em;
padding-left: 6em;
text-transform: uppercase;
}
section.script h3, section.guion h3 {
padding-left: 3em;
}
section.script > p, section.guion > p {
margin-top: 1em;
}
section.script blockquote + blockquote > p,
section.guion blockquote + blockquote > p {
text-indent: 1.5em;
}
/* Special contents / Contenidos especiales */
.title, .titulo {
margin-top: 3em;
margin-left: 0;
font-size: 2em;
}
.subtitle, .subtitulo {
margin-top: -1.25em;
margin-bottom: 3em;
margin-left: 0;
}
.author, .autor {
width: 250px; /* Avoids 100% width in author image / Se añade a la imagen del autor para que no abarque el 100% */
}
.contributor + p, .contribuidor + p {
text-indent: 0;
}
h1 + .contributor, h1 + .contribuidor {
margin-top: -6em !important;
margin-bottom: 6em;
}
.copyright, .legal * {
text-indent: 0;
}
.epigraph, .epigrafe {
font-size: .9em;
text-align: right;
line-height: 1.65em;
margin-left: 40%;
}
body > .epigraph:first-child, body > .epigrafe:first-child {
margin-top: 3em;
}
.epigraph + p, .epigrafe + p {
margin-top: 2em;
text-indent: 0;
}
.epigraph + .epigraph, .epigrafe + .epigrafe {
margin-top: .5em;
}
.vertical-space1, .espacio-arriba1 {
margin-top: 1em !important;
}
.vertical-space2, .espacio-arriba2 {
margin-top: 2em !important;
}
.vertical-space3, .espacio-arriba3 {
margin-top: 3em !important;
}
.space, .espacio {
white-space: pre-wrap;
}
/* Footnotes / Notas al pie */
.n-note-sup {
font-style: normal;
font-weight: normal;
}
.n-note-hr {
margin-top: 2em;
width: 25%;
margin-left: 0;
border: 1px solid blue;
background-color: blue;
}
.n-note-a {
display: block;
margin-left: -3em;
margin-bottom: -1.375em;
}
.n-note-sup:before, .n-note-a:before {
content: "[";
color: #0000EE;
}
.n-note-sup:after, .n-note-a:after {
content: "]";
color: #0000EE;
}
.n-note-p, .n-note-p2 {
margin-left: 3em;
font-size: .9em;
text-indent: 0;
}
* + .n-note-p {
margin-top: 1em;
text-indent: 0;
}
.n-note-p2 {
margin-top: 0;
text-indent: 1.5em;
}
/* Indexes / Índices analíticos */
.i-item-section p {
margin-top: .5em !important;
}
.i-item-div > h2:first-child, .i-item-div-single > h2:first-child {
margin-top: 0;
}
@media screen and (min-width:768px) {
@media not amzn-mobi, not-amzn-kf8 { /* For any device except Kindle / Para cualquier dispositivo excepto Kindle */
.i-item-div {
column-count: 2;
column-gap: 2em;
column-rule: solid 1px lightgray;
}
}
}
.i-item-a:before {
content: "[";
color: #0000EE;
}
.i-item-a:after {
content: "]";
color: #0000EE;
}
/* For print / Para impresión */
@media print {
section {
page-break-before: always;
}
section:first-of-type {
page-break-before: avoid;
}
section > h1:first-child {
padding-top: 5em !important;
}
}
/* Styles for this edition / Estilos de esta edición */
/* ADD HERE CUSTOM STYLES / AGREGAR ESTILOS PERSONALIZADOS */
body > h1:first-child {margin-bottom:0;}
.addenda {border-left: 3px solid yellow; padding-left:1em;}
.meta {font-size:.75em;text-indent:0;color:gray;margin-bottom:6em;}
.meta a {color:gray;}
.meta + p {text-indent:0;}

5
css/ebooks.css Normal file
View File

@ -0,0 +1,5 @@
body > h1:first-child {margin-bottom:0;}
.addenda {border-left: 3px solid yellow; padding-left:1em;}
.meta {font-size:.75em;text-indent:0;color:gray;margin-bottom:6em;}
.meta a {color:gray;}
.meta + p {text-indent:0;}

View File

@ -29,10 +29,6 @@ footer > *:first-child {margin-top: 1em;}
footer {word-wrap: break-word;} footer {word-wrap: break-word;}
} }
.addenda {border-left: 3px solid yellow; padding-left:1em;}
.meta {font-size:.75em;text-indent:0;color:gray;margin-bottom:6em;}
.meta a {color:gray;}
.meta + p {text-indent:0;}
div {margin-bottom:1em;padding-bottom:1em;border-bottom: 1px solid #ddd;} div {margin-bottom:1em;padding-bottom:1em;border-bottom: 1px solid #ddd;}
div:last-child {border:none;} div:last-child {border:none;}
div .meta {margin-bottom: 0;} div .meta {margin-bottom: 0;}

BIN
ebooks/entry001.epub Normal file

Binary file not shown.

BIN
ebooks/entry001.mobi Normal file

Binary file not shown.

View File

@ -8,7 +8,7 @@
<meta name="keywords" content="publishing, blog, book, ebook, methodology, foss, libre-software, format, markdown, html, epub, pdf, mobi, latex, tex"> <meta name="keywords" content="publishing, blog, book, ebook, methodology, foss, libre-software, format, markdown, html, epub, pdf, mobi, latex, tex">
<link rel="shortcut icon" href="../icon.png"> <link rel="shortcut icon" href="../icon.png">
<link rel="alternate" type="application/rss+xml" href="https://blog.cliteratu.re/feed/" title="Publishing is Coding: Change My Mind"> <link rel="alternate" type="application/rss+xml" href="https://blog.cliteratu.re/feed/" title="Publishing is Coding: Change My Mind">
<link type="text/css" rel="stylesheet" href="../css/styles.css"> <link type="text/css" rel="stylesheet" href="../css/core.css">
<link type="text/css" rel="stylesheet" href="../css/extra.css"> <link type="text/css" rel="stylesheet" href="../css/extra.css">
</head> </head>
<body> <body>
@ -23,18 +23,7 @@
</nav> </nav>
</header> </header>
<section> <section>
<h1 id="digital-publishing-as-publishing-from-scratch">Digital Publishing as Publishing from Scratch</h1> <h1 id="digital-publishing-as-publishing-from-scratch">Digital Publishing as Publishing from Scratch</h1> <p class="meta">October 3, 2018 | Methodology | <span class="smallcap"><a target="_blank" href="https://blog.cliteratu.re/ebooks/entry001.epub">EPUB</a></span> / <span class="smallcap"><a target="_blank" href="https://blog.cliteratu.re/ebooks/entry001.mobi">MOBI</a></span> / <a target="_blank" href="https://marianaeguaras.com/edicion-digital-como-edicion-desde-cero">original</a></p> <p>Thanks to <a href="http://marianaeguaras.com/">Mariana Eguaras</a> we are going to blogging about <b>digital publishing</b>, its <b>characteristics, benefits and challenges</b>, as well as <b>its relation with print publishing</b> and how these issues directly affect the necesary proceedings for any kind of publishing.</p> <p>We already have planned what we are going write in the first entries, but any suggestion is welcome. As far as possible the writing is not going to be technical and more friendly to general public or publishers.</p> <p>However, you have to consider that some technicalities are now necessary for publishing. As well as the typography, printing or design slangs are common knowledge for publishers, in the same way the jargons from web or software developers are starting to be part of our cultural background.</p> <blockquote class="addenda"> <p>The entries were originally wrote in spanish. Some of them are now kind of old: for some things I already have a different opinion or distinct approach. And as is obvious, english is not my first language. Therefore, you are going to find a lot of grammar mistakes or typos and I will only translate (in a very free way) the entries that I still consider relevant. So when you find this kind of box with a yellow border, it means that it is an <i>addendum</i> for this broken english version.</p> </blockquote> <blockquote class="addenda"> <p>Do you want to improve this mess? You can always help through <a href="https://gitlab.com/NikaZhenya/publishing-is-coding">GitLab</a> or <a href="https://github.com/NikaZhenya/publishing-is-coding">GitHub</a> (the links are always in the footer).</p> </blockquote>
<p class="meta">October 3, 2018 | Methodology | <span class="smallcap"><a target="_blank" href="https://blog.cliteratu.re/epub/entry001.epub">EPUB</a></span> / <span class="smallcap"><a target="_blank" href="https://blog.cliteratu.re/mobi/entry001.mobi">MOBI</a></span> / <a target="_blank" href="https://marianaeguaras.com/edicion-digital-como-edicion-desde-cero">original</a></p>
<p>Thanks to <a href="http://marianaeguaras.com/">Mariana Eguaras</a> we are going to blogging about <b>digital publishing</b>, its <b>characteristics, benefits and challenges</b>, as well as <b>its relation with print publishing</b> and how these issues directly affect the necesary proceedings for any kind of publishing.</p>
<p>We already have planned what we are going write in the first entries, but any suggestion is welcome. As far as possible the writing is not going to be technical and more friendly to general public or publishers.</p>
<p>However, you have to consider that some technicalities are now necessary for publishing. As well as the typography, printing or design slangs are common knowledge for publishers, in the same way the jargons from web or software developers are starting to be part of our cultural background.</p>
<blockquote class="addenda">
<p>The entries were originally wrote in spanish. Some of them are now kind of old: for some things I already have a different opinion or distinct approach. And as is obvious, english is not my first language. Therefore, you are going to find a lot of grammar mistakes or typos and I will only translate (in a very free way) the entries that I still consider relevant. So when you find this kind of box with a yellow border, it means that it is an <i>addendum</i> for this broken english version.</p>
</blockquote>
<blockquote class="addenda">
<p>Do you want to improve this mess? You can always help through <a href="https://gitlab.com/NikaZhenya/publishing-is-coding">GitLab</a> or <a href="https://github.com/NikaZhenya/publishing-is-coding">GitHub</a> (the links are always in the footer).</p>
</blockquote>
</section> </section>
<footer> <footer>
<p><a target="_blank" href="https://ted.cliteratu.re/">ted.cliteratu.re</a> | <a target="_blank" href="https://ed.cliteratu.re/">ed.cliteratu.re</a> | <a target="_blank" href="https://pecas.cliteratu.re/">pecas.cliteratu.re</a> | <a target="_blank" href="https://xxx.cliteratu.re/">xxx.cliteratu.re</a></p> <p><a target="_blank" href="https://ted.cliteratu.re/">ted.cliteratu.re</a> | <a target="_blank" href="https://ed.cliteratu.re/">ed.cliteratu.re</a> | <a target="_blank" href="https://pecas.cliteratu.re/">pecas.cliteratu.re</a> | <a target="_blank" href="https://xxx.cliteratu.re/">xxx.cliteratu.re</a></p>

View File

@ -1,20 +1,20 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en-US"> <html lang="en-US">
<head> <head>
<title>Publishing is Coding: Change My Mind | Main</title> <title>Publishing is Coding: Change My Mind | Digital Publishing as Publishing from Scratch</title>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="application-name" content="Publishing is Coding: Change My Mind"> <meta name="application-name" content="Publishing is Coding: Change My Mind">
<meta name="description" content="A broken english version of some entries published in Mariana Eguaras's blog."> <meta name="description" content="A broken english version of some entries published in Mariana Eguaras's blog.">
<meta name="keywords" content="publishing, blog, book, ebook, methodology, foss, libre-software, format, markdown, html, epub, pdf, mobi, latex, tex"> <meta name="keywords" content="publishing, blog, book, ebook, methodology, foss, libre-software, format, markdown, html, epub, pdf, mobi, latex, tex">
<link rel="shortcut icon" href="icon.png"> <link rel="shortcut icon" href="icon.png">
<link rel="alternate" type="application/rss+xml" href="https://blog.cliteratu.re/feed/" title="Publishing is Coding: Change My Mind"> <link rel="alternate" type="application/rss+xml" href="https://blog.cliteratu.re/feed/" title="Publishing is Coding: Change My Mind">
<link type="text/css" rel="stylesheet" href="css/styles.css"> <link type="text/css" rel="stylesheet" href="css/core.css">
<link type="text/css" rel="stylesheet" href="css/extra.css"> <link type="text/css" rel="stylesheet" href="css/extra.css">
</head> </head>
<body> <body>
<header> <header>
<h1><a href="https://blog.cliteratu.re">Publishing is Coding: Change My Mind</a></h1> <h1><a href="https://blog.cliteratu.re">Publishing is Coding: Change My Mind</a></h1>
<p>A broken english version of some entries published in <a target="_blank" href="https://marianaeguaras.com/blog/">Mariana Eguaras's blog</a>.</p> <p>A broken english version of some entries published in <a target="_blank" href="https://marianaeguaras.com/blog/"><a target="_blank" href="https://marianaeguaras.com/blog/">Mariana Eguaras's blog</a></a>.</p>
<nav> <nav>
<h3>Contact</h3> <h3>Contact</h3>
<p><a target="_blank" href="mailto:nika.zhenya@cliteratu.re">Email</a></p> <p><a target="_blank" href="mailto:nika.zhenya@cliteratu.re">Email</a></p>

View File

@ -1,6 +1,6 @@
# Digital Publishing as Publishing from Scratch # Digital Publishing as Publishing from Scratch
@current['2018-10-03','Methodology','A general comparation between the most common methods for developing EPUBs.','https://marianaeguaras.com/edicion-digital-como-edicion-desde-cero'] @meta['2018-10-03','Methodology','A general comparation between the most common methods for developing EPUBs.','https://marianaeguaras.com/edicion-digital-como-edicion-desde-cero']
Thanks to [Mariana Eguaras](http://marianaeguaras.com/) Thanks to [Mariana Eguaras](http://marianaeguaras.com/)
we are going to blogging about __digital publishing__, we are going to blogging about __digital publishing__,

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="es" lang="es">
<head>
<meta charset="UTF-8" />
<title>Cover</title>
<style>.sin-margen{margin:0;padding:0;}.forro{display:block;margin:auto;padding:0;height:100vh;width:auto;}</style>
</head>
<body class="sin-margen">
<section epub:type="cover" role="doc-cover">
<img id="cover-image" class="forro" alt="Imagen de portada" src="../img/cover.png" />
</section>
</body>
</html>

View File

@ -8,7 +8,7 @@
<meta name="keywords" content="$site_keywords$"> <meta name="keywords" content="$site_keywords$">
<link rel="shortcut icon" href="../$site_img$"> <link rel="shortcut icon" href="../$site_img$">
<link rel="alternate" type="application/rss+xml" href="$site_link$/feed/" title="$site_name$"> <link rel="alternate" type="application/rss+xml" href="$site_link$/feed/" title="$site_name$">
<link type="text/css" rel="stylesheet" href="../css/styles.css"> <link type="text/css" rel="stylesheet" href="../css/core.css">
<link type="text/css" rel="stylesheet" href="../css/extra.css"> <link type="text/css" rel="stylesheet" href="../css/extra.css">
</head> </head>
<body> <body>