Commit a18b654d authored by Jorge Aguilera's avatar Jorge Aguilera

Jorge

parent 8ca56eae
......@@ -11,6 +11,7 @@ build/
.classpath
src/docs/asciidoc/images/
src/docs/asciidoc/images/!avatars/
/src/jbake/assets/scripts/google/.credentials/
/src/jbake/assets/scripts/office/CopyContacts2QRCode.xlsx
/src/jbake/assets/scripts/office/Contacts2QRCode.xlsx
......
......@@ -30,6 +30,16 @@ build:epub:
paths:
- build/asciidoc/epub3
build:kindle:
stage: build
script:
- chmod +x kindlegen.sh
- ./kindlegen.sh buildKindle
allow_failure: true
artifacts:
paths:
- build/asciidoc/epub3
pages:
stage: deploy
script:
......@@ -37,6 +47,7 @@ pages:
- echo html && [ -d "build/jbake" ] && cp -R build/jbake/* public
- echo epub && [ -d "build/asciidoc/epub3" ] && cp -R build/asciidoc/epub3/* public
- echo pdf && [ -d "build/asciidoc/pdf" ] && cp -R build/asciidoc/pdf/* public
- find public/epub3
artifacts:
paths:
- public
......@@ -44,6 +55,7 @@ pages:
- build:html
- build:pdf
- build:epub
- build:kindle
when: manual
only:
- master
\ No newline at end of file
......@@ -60,7 +60,7 @@ dependencies {
compile 'org.slf4j:slf4j-simple:1.7.25'
compile 'org.asciidoctor:asciidoctorj:1.5.6'
asciidoctor 'org.asciidoctor:asciidoctorj-epub3:1.5.0-alpha.6'
asciidoctor 'org.asciidoctor:asciidoctorj-epub3:1.5.0-alpha.8.1'
asciidoctor 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
asciidoctor 'org.asciidoctor:asciidoctorj-diagram:1.5.8'
......@@ -118,16 +118,16 @@ downloadRevealJs {
asciidoctorj {
version = '1.5.5'
version = '1.5.6'
}
task copyImagesToKindle( type: Copy){
outputs.upToDateWhen { false }
from("$projectDir/src/jbake/assets/images"){
include '*'
include '**/*'
}
into "$projectDir/src/docs/asciidoc/images"
}
copyImagesToKindle.dependsOn extractKindlegen
task buildEpub(type:org.asciidoctor.gradle.AsciidoctorTask) {
group 'documentation'
......@@ -154,6 +154,7 @@ task buildEpub(type:org.asciidoctor.gradle.AsciidoctorTask) {
'idprefix': '',
'idseparator': '-',
'docinfo1': '',
'epub3-stylesdir':'customstyles',
'buildVersion':buildVersion
}
buildEpub.dependsOn copyImagesToKindle
......@@ -183,10 +184,11 @@ task buildKindle(type:org.asciidoctor.gradle.AsciidoctorTask) {
'idprefix': '',
'idseparator': '-',
'docinfo1': '',
'epub3-stylesdir':'customstyles',
'ebook-format': 'kf8',
'buildVersion':buildVersion
}
buildKindle.dependsOn copyImagesToKindle
buildKindle.dependsOn extractKindlegen, copyImagesToKindle
task copyImagesToPdf( type: Copy){
......
#!/usr/bin/env sh
export KINDLEGEN="`pwd`/build/kindlegen/kindlegen"
./gradlew "$@"
echo "done"
\ No newline at end of file
......@@ -82,7 +82,7 @@ include::fragment.adoc[]
include::fragment.adoc[]
// dsls
:adoc: /basico/dsls_performance
:adoc: /basico/dsl_performance
:jbake-script: /scripts/basico/DSLPerformance.groovy
include::fragment.adoc[]
......
/* Gitden & Namo default to 16px font-size; bump it to 20px (125%) */
body.gitden-reader,
body.namo-epub-library {
font-size: 125%;
}
/* Gitden doesn't give us much margin, so let's match Kindle */
body.gitden-reader {
margin: 0 25pt;
}
/* Namo has the same margin problem, except setting side margins doesn't work */
/*body.namo-epub-library > section.chapter {
margin: 0 25pt;
}*/
/* Use tighter margins and smaller font (18px) on phones (Nexus 4 and smaller) */
@media only screen and (max-device-width: 768px) and (max-device-height: 1280px),
only screen and (max-device-width: 1280px) and (max-device-height: 768px) {
body.gitden-reader,
body.namo-epub-library {
font-size: 112.5%;
}
body.gitden-reader {
margin: 0 5pt;
}
/*body.namo-epub-library > section.chapter {
margin: 0 5pt;
}*/
}
body h1, body h2, body h3:not(.list-heading), body h4, body h5, body h6,
h1 :not(code), h2 :not(code), h3:not(.list-heading) :not(code), h4 :not(code), h5 :not(code), h6 :not(code) {
/* !important required to override custom font setting in Kindle / Gitden / Namo */
/* Gitden requires the extra weight of a parent selector; it also makes headings bold when custom font is specified */
/* Kindle and Gitden require the override on heading child elements */
font-family: "M+ 1p", sans-serif !important;
}
/* QUESTION what about nested elements inside code? */
body code, body kbd, body pre, pre :not(code) {
/* !important required to override custom font setting in Kindle / Gitden / Namo */
/* Gitden requires the extra weight of a parent selector */
/* Kindle and Gitden require the override on pre child elements */
font-family: "M+ 1mn", monospace !important;
}
@media amzn-kf8 {
/* Kindle does its own margin management, so don't use an explicit margin */
/*body {
margin: 0 !important;
}*/
/* text-rendering is the only way to enable kerning in Kindle (and Calibre, though it seems to kern automatically) */
/* personally, I think Kindle overdoes kerning, but we're running with it for now */
/* text-rendering: optimizeLegibility kills certain Kindle eInk devices */
/*h1, h2, h3, h4, h5, h6,
body p, li, dd, blockquote > footer,
th, td, figcaption, caption {
text-rendering: optimizeLegibility;
}*/
/* hack line height of subtitle using floats on Kindle */
h1.chapter-title .subtitle {
margin-top: -0.2em;
margin-bottom: 0.3em; /* compensate for reduced line height */
}
/* NOTE using b instead of span since Firefox ePubReader applies immutable styles to span */
h1.chapter-title .subtitle > b {
float: left;
display: inline-block;
margin-bottom: -0.3em; /* reduce the line height */
padding-right: 0.2em; /* spacing between words */
}
h1.chapter-title .subtitle > b:last-child {
padding-right: 0;
}
h1.chapter-title .subtitle::after {
display: table;
content: ' ';
clear: both;
}
}
.chapter-header p.byline {
height: auto; /* Aldiko requires this value to be 0; reset it for all others */
}
/* Font-based icons */
.icon {
display: inline-block;
/* !important required to override custom font setting in Kindle (since .icon can appear inside a span) */
font-family: "FontAwesome" !important;
font-style: normal !important;
font-weight: normal !important;
line-height: 1;
}
.icon-1_5x {
padding: 0 0.25em;
-webkit-transform: scale(1.5, 1.5);
transform: scale(1.5, 1.5);
}
.icon-2x {
padding: 0 0.5em;
-webkit-transform: scale(2, 2);
transform: scale(2, 2);
}
.icon-small {
font-size: 0.85em;
vertical-align: 0.075em;
}
.icon-1_5em {
font-size: 1.5em;
}
.icon-2em {
font-size: 2em;
}
.icon-3em {
font-size: 3em;
}
.icon-4em {
font-size: 4em;
}
.icon-rotate-90 {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
.icon-rotate-90i {
-webkit-transform: scale(-1, 1) rotate(90deg);
transform: scale(-1, 1) rotate(90deg);
}
.icon-rotate-180 {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
}
.icon-rotate-180i {
-webkit-transform: scale(-1, 1) rotate(180deg);
transform: scale(-1, 1) rotate(180deg);
}
.icon-rotate-270 {
-webkit-transform: rotate(270deg);
transform: rotate(270deg);
}
.icon-rotate-270i {
-webkit-transform: scale(-1, 1) rotate(270deg);
transform: scale(-1, 1) rotate(270deg);
}
.icon-flip-h {
-webkit-transform: scale(-1, 1);
transform: scale(-1, 1);
}
.icon-flip-v {
-webkit-transform: scale(1, -1);
transform: scale(1, -1);
}
This diff is collapsed.
......@@ -91,4 +91,4 @@ void generatePdf(){
asciidoctor.convertFile(new File("catalogo.adoc"), options) // <3>
}
//end::create_pdf[]
\ No newline at end of file
//end::create_pdf[]
......@@ -111,4 +111,4 @@ println '-'.multiply(20)
list()
println '-'.multiply(20)
//end::main[]
\ No newline at end of file
//end::main[]
......@@ -113,4 +113,4 @@ void generateExcel(filename){
}
}
}
//end::generateExcel[]
\ No newline at end of file
//end::generateExcel[]
......@@ -142,4 +142,4 @@ if( !google2Database ) {
}
}
}
//end::d2g[]
\ No newline at end of file
//end::d2g[]
......@@ -167,4 +167,4 @@ start {
saveScreenshot(saveNode,plotsDSL._screenshot)
}
}
//end::view[]
\ No newline at end of file
//end::view[]
......@@ -96,4 +96,4 @@ start {
}
}
}
//end::view[]
\ No newline at end of file
//end::view[]
......@@ -40,4 +40,4 @@ def getFile(file_config,server_name){
}
return result.readLines()// <3>
}
//end::read[]
\ No newline at end of file
//end::read[]
......@@ -17,7 +17,7 @@ hosts.each{host->
println line
}
}
//tag::main[]
//end::main[]
//tag::read[]
def getFile(dir,host){
......@@ -27,4 +27,4 @@ def getFile(dir,host){
return result.readLines()// <3>
}
//end::read[]
\ No newline at end of file
//end::read[]
......@@ -70,4 +70,4 @@ println prettyPrint(toJson(keys))
def remove = keys.findAll{ it.value.find{ it.key.indexOf('XXXXXXXXXXXXXXXXXXX')!=-1 } } //<1>
println "Remove: ${remove*.key}"
//end::report[]
\ No newline at end of file
//end::report[]
......@@ -63,4 +63,4 @@ try{
println sce.request?.contentAsString
println sce.response?.contentAsString
}
//end::exceptions[]
\ No newline at end of file
//end::exceptions[]
......@@ -152,4 +152,7 @@ We need to indicate to _Asciidoctor_ we want to apply this theme using the attri
tableOfContents(true).
sectionNumbers(true).
get()
----
\ No newline at end of file
----
include::{contentdir}/include-source.txt[]
......@@ -167,4 +167,7 @@ Para que _Asciidoctor_ utilize este tema simplemente hay que indicarlo en los at
tableOfContents(true).
sectionNumbers(true).
get()
----
\ No newline at end of file
----
include::{contentdir}/include-source.txt[]
= Json a Pdf
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2018-08-13
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -112,3 +113,6 @@ Puedes ver el resultado final en este enlace https://jorge-aguilera.gitlab.io/co
Como la agenda puede sufrir modificaciones utilizaremos la funcion `Schedule` de Gitlab que nos permite programar
de forma recurrente nuestros jobs de tal forma que podremos actualizar diariamente (por ejemplo) el documento.
include::{contentdir}/include-source.txt[]
= PlantUML
Jorge Aguilera <jorge.aguilera@puravida-software.com>
:username: jorge-aguilera
2018-06-07
ifndef::backend-pdf[]
:jbake-type: post
......
......@@ -6,7 +6,7 @@ ifndef::backend-pdf[]
:jbake-status: published
:jbake-tags: blog, asciidoc, reveal, pptx, powerpoint, adoc
:jbake-category: asciidoctor
:jbake-script: scripts/asciidoctor/ToRevaljs.groovy
:jbake-script: /scripts/asciidoctor/ToRevaljs.groovy
:idprefix:
:imagesdir: ../images
endif::[]
......@@ -74,4 +74,7 @@ Si todo ha ido bien, el script nos habrá creado un `slide.html` con nuestra pre
[source,groovy]
----
include::{sourcedir}{jbake-script}[tags=create]
----
\ No newline at end of file
----
include::{contentdir}/include-source.txt[]
= Basic concepts
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2017-08-20
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-lang: gb
:jbake-type: post
......@@ -113,3 +114,5 @@ include::{sourcedir}{jbake-script}[lines=41..43]
----
<1> The closure receives two parameters
include::{contentdir}/include-source.txt[]
= Conceptos básicos
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2017-08-20
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-lang: es
:jbake-type: post
......@@ -124,3 +125,5 @@ include::{sourcedir}{jbake-script}[lines=41..43]
----
<1> La closure recibe dos parámetros
include::{contentdir}/include-source.txt[]
......@@ -42,3 +42,6 @@ usage: clibuilder_ebook.groovy -[habcd]
-d,--Option d When selecting "d" write seleccionada -> d
-h,--help Usage Information
----
include::{contentdir}/include-source.txt[]
......@@ -41,3 +41,7 @@ usage: clibuilder_ebook.groovy -[habcd]
-d,--Option d Al seleccionar "d" pinta seleccionada -> d
-h,--help Usage Information
----
include::{contentdir}/include-source.txt[]
......@@ -59,3 +59,5 @@ include::{sourcedir}{jbake-script}[lines=1..14]
<6> The result is correct we can continue.
include::{contentdir}/include-source.txt[]
......@@ -56,3 +56,5 @@ valor se guardará en resultado.
<6> El resultado es correcto podemos continuar.
include::{contentdir}/include-source.txt[]
= From properties to YML
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2018-03-07
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-lang: es
:jbake-type: post
......@@ -41,3 +42,5 @@ include::{sourcedir}{jbake-script}[]
include::{contentdir}/include-source.txt[]
= De Properties a YML
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2018-03-07
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-lang: es
:jbake-type: post
......@@ -43,3 +44,5 @@ include::{sourcedir}{jbake-script}[]
include::{contentdir}/include-source.txt[]
= Consumo de recursos con DSLs
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2018-08-26
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -88,3 +89,5 @@ Lógicamente estos scripts son muy simples y no son parametrizables por lo que q
implementar una posible solución más completa
include::{contentdir}/include-source.txt[]
= Packaging Scripts
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2017-11-14
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -211,3 +212,5 @@ If all ik ok, your jar will have been created with the embedded scripts in it an
Starting from here our device is accessible by any dependency manager such as Maven or Gradle and of course *Grape* so
we can create new scripts that depend on our artifact simply putting the appropriate "coordinates" (repository,
organization, artifact and version) in the script
include::{contentdir}/include-source.txt[]
= Empaquetado Scripts
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2017-11-14
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -212,3 +213,5 @@ Gradle y por supuesto *Grape* por lo que podremos crear nuevos scripts que depen
poniendo las "coordenadas" (repositorio, organización, artefacto y versión) oportunas en el script
include::{contentdir}/include-source.txt[]
= Html Table to CSV
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2018-06-24
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -35,3 +36,5 @@ It'll join all `td` elements for each `tr` using `;` as field separator
include::{contentdir}/include-source.txt[]
= Extraer una Table HTML a CSV
Jorge Aguilera <jorge.aguilera@puravida-software.com>
2018-06-24
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -34,3 +35,5 @@ Para cada elemento `tr` que encuentre generará una única línea concatenando t
campos `td` que contenga
include::{contentdir}/include-source.txt[]
......@@ -87,4 +87,7 @@ groovy HolaMundo.groovy
== Groovy Web Console
Finally, you can also try using the online console https://groovyconsole.appspot.com/ which will allow you to execute
some simple scripts (and shar it)
\ No newline at end of file
some simple scripts (and shar it)
include::{contentdir}/include-source.txt[]
......@@ -90,3 +90,5 @@ groovy HolaMundo.groovy
Por último, también puedes probar a utilizar la consola on-line https://groovyconsole.appspot.com/
la cual te permitirá ejecutar algunos scripts sencillos (además de compartirlos de forma pública)
include::{contentdir}/include-source.txt[]
......@@ -108,3 +108,5 @@ include::{sourcedir}{jbake-script}[tags=unique]
With this functionality, what we obtain a list of values ​​without duplicities, obtaining an array with unique values.
We will use the `unique()` method.
include::{contentdir}/include-source.txt[]
......@@ -107,3 +107,5 @@ include::{sourcedir}{jbake-script}[tags=unique]
Con esta funcionalidad lo que obtenemos es una lista de valores sin duplicidades obteniendo una array con valores únicos.
Para emplearlo simpletemente utilizaremos el método `unique()`.
include::{contentdir}/include-source.txt[]
......@@ -54,4 +54,8 @@ def my_passwd = "passwd",
def my_server ="localhost"
def database = "test"
def my_sql = Configuration.instanceMysql(my_user,my_passwd,my_server,my_database)
----
\ No newline at end of file
----
include::{contentdir}/include-source.txt[]
......@@ -56,3 +56,5 @@ def my_sql = Configuration.instanceMysql(my_user,my_passwd,my_server,my_database
----
include::{contentdir}/include-source.txt[]
= How many records are there ?
Jorge Aguilera, jorge.aguilera@puravida-software.com
2017-08-26
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -38,3 +39,5 @@ include::{sourcedir}{jbake-script}[]
This script show how easy is to connect and ejecute a parametrizable query. We use the _?_ character
to specify where we want to substitute the params, in our example we want to substitute with *yesterday* param.
include::{contentdir}/include-source.txt[]
= Contar registros de base de datos
Jorge Aguilera, jorge.aguilera@puravida-software.com
2017-08-26
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -38,3 +39,5 @@ Este script muestra cómo conectarnos y buscar un registro mediante una query pa
caracter ? para indicar donde se deben de sustituir los parámetros. En este ejemplo usamos el día de ayer como
parámetro
include::{contentdir}/include-source.txt[]
= Are you into the Panama Papers?
Jorge Aguilera, jorge.aguilera@puravida-software.com
2018-04-18
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -162,3 +163,5 @@ And you? are you in the Panama Papers ?
include::{contentdir}/include-source.txt[]
= use GORM into your scripts
Jorge Aguilera, jorge.aguilera@puravida-software.com
2018-03-30
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -102,3 +103,5 @@ include::{sourcedir}{jbake-script}[tag=main]
include::{contentdir}/include-source.txt[]
= GORM en tus scripts
Jorge Aguilera, jorge.aguilera@puravida-software.com
2018-03-30
:username: jorge-aguilera
ifndef::backend-pdf[]
:jbake-type: post
:jbake-status: published
......@@ -129,3 +130,5 @@ include::{sourcedir}{jbake-script}[tag=main]
----
include::{contentdir}/include-source.txt[]
......@@ -37,3 +37,5 @@ include::{sourcedir}{jbake-script}[]
<5> Execute our business logic
<6> Every batchSize addBatch Groovy will do the inserts
<7> At the end Groovy will do the reamins inserts and close the resources