fix codehilite

This commit is contained in:
Jesús 2019-02-26 11:59:02 -05:00
parent 59f5250d11
commit 393e1e12e4
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766
5 changed files with 126 additions and 32 deletions

View File

@ -19,8 +19,89 @@ label[for=navbar-toggle-cbox] {
#navbar-toggle-cbox:checked ~ .navbar-menu {
display: block;
}
/* ------------ End Menu Mobile sin JS ------------- */
/* ------------------- codehilite ------------------ */
.highlight pre {
font-size: 75%;
}
.highlight .hll { background-color: #222222 }
.highlight { background: #000000; color: #cccccc }
.highlight .c { color: #4E4F8E } /* Comment */
.highlight .err { color: #cccccc; border: 1px solid #FF0000 } /* Error */
.highlight .esc { color: #cccccc } /* Escape */
.highlight .g { color: #cccccc } /* Generic */
.highlight .k { color: #cdcd00 } /* Keyword */
.highlight .l { color: #cccccc } /* Literal */
.highlight .n { color: #cccccc } /* Name */
.highlight .o { color: #3399cc } /* Operator */
.highlight .x { color: #cccccc } /* Other */
.highlight .p { color: #fac0ba } /* Punctuation */
.highlight .ch { color: #4E4F8E } /* Comment.Hashbang */
.highlight .cm { color: #4E4F8E } /* Comment.Multiline */
.highlight .cp { color: #4E4F8E } /* Comment.Preproc */
.highlight .cpf { color: #4E4F8E } /* Comment.PreprocFile */
.highlight .c1 { color: #4E4F8E } /* Comment.Single */
.highlight .cs { color: #cd0000; font-weight: bold } /* Comment.Special */
.highlight .gd { color: #cd0000 } /* Generic.Deleted */
.highlight .ge { color: #cccccc; font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #4E4F8E; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00cd00 } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #4E4F8E; font-weight: bold } /* Generic.Prompt */
.highlight .gs { color: #cccccc; font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .kc { color: #cdcd00 } /* Keyword.Constant */
.highlight .kd { color: #00cd00 } /* Keyword.Declaration */
.highlight .kn { color: #cd00cd } /* Keyword.Namespace */
.highlight .kp { color: #cdcd00 } /* Keyword.Pseudo */
.highlight .kr { color: #cdcd00 } /* Keyword.Reserved */
.highlight .kt { color: #00cd00 } /* Keyword.Type */
.highlight .ld { color: #cccccc } /* Literal.Date */
.highlight .m { color: #cd00cd } /* Literal.Number */
.highlight .s { color: #cd0000 } /* Literal.String */
.highlight .na { color: #cccccc } /* Name.Attribute */
.highlight .nb { color: #cd00cd } /* Name.Builtin */
.highlight .nc { color: #00cdcd } /* Name.Class */
.highlight .no { color: #cccccc } /* Name.Constant */
.highlight .nd { color: #cccccc } /* Name.Decorator */
.highlight .ni { color: #cccccc } /* Name.Entity */
.highlight .ne { color: #666699; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #cccccc } /* Name.Function */
.highlight .nl { color: #cccccc } /* Name.Label */
.highlight .nn { color: #cccccc } /* Name.Namespace */
.highlight .nx { color: #cccccc } /* Name.Other */
.highlight .py { color: #cccccc } /* Name.Property */
.highlight .nt { color: orange } /* Name.Tag */
.highlight .nv { color: #00cdcd } /* Name.Variable */
.highlight .ow { color: #cdcd00 } /* Operator.Word */
.highlight .w { color: #cccccc } /* Text.Whitespace */
.highlight .mb { color: #cd00cd } /* Literal.Number.Bin */
.highlight .mf { color: #cd00cd } /* Literal.Number.Float */
.highlight .mh { color: #cd00cd } /* Literal.Number.Hex */
.highlight .mi { color: #cd00cd } /* Literal.Number.Integer */
.highlight .mo { color: #cd00cd } /* Literal.Number.Oct */
.highlight .sb { color: #cd0000 } /* Literal.String.Backtick */
.highlight .sc { color: #cd0000 } /* Literal.String.Char */
.highlight .sd { color: #cd0000 } /* Literal.String.Doc */
.highlight .s2 { color: #cd0000 } /* Literal.String.Double */
.highlight .se { color: #cd0000 } /* Literal.String.Escape */
.highlight .sh { color: #cd0000 } /* Literal.String.Heredoc */
.highlight .si { color: #cd0000 } /* Literal.String.Interpol */
.highlight .sx { color: #cd0000 } /* Literal.String.Other */
.highlight .sr { color: #cd0000 } /* Literal.String.Regex */
.highlight .s1 { color: #cd0000 } /* Literal.String.Single */
.highlight .ss { color: #cd0000 } /* Literal.String.Symbol */
.highlight .bp { color: #cd00cd } /* Name.Builtin.Pseudo */
.highlight .vc { color: #00cdcd } /* Name.Variable.Class */
.highlight .vg { color: #00cdcd } /* Name.Variable.Global */
.highlight .vi { color: #00cdcd } /* Name.Variable.Instance */
.highlight .il { color: #cd00cd } /* Literal.Number.Integer.Long */
/* ----------------- End codehilite ---------------- */
code {
background-color: #282828;
color: #73d1ed;
@ -112,11 +193,11 @@ a.pagination-next.disabled {
/* html/body/font-fixes */
body, input, textarea, .button {
font-family: 'Roboto Condensed', sans-serif;
font-family: 'Roboto Condensed', Nimbus Sans, sans-erif;
}
.fa small {
font-family: 'Roboto Condensed', sans-serif;
font-family: 'Roboto Condensed', Nimbus Sans, sans-serif;
color: #7a7a7a;
}

View File

@ -26,29 +26,28 @@ un entorno virtual con python-virtualenv.
1. Clonación del repositorio e ingreso al directorio de trabajo
$ git clone https://notabug.org/Freak-Spot/Freak-Spot
$ cd Freak-Spot
:::bash
git clone https://notabug.org/Freak-Spot/Freak-Spot
cd Freak-Spot
2. Generar el entorno virtual y activarlo
$ virtualenv env
$ source env/bin/activate
:::bash
virtualenv env
source env/bin/activate
3. Instalación de dependencias pip y npm
$ sudo npm install uglifycss uglify-js -g
$ pip install -U pelican beautifulsoup4 markdown babel
$ npm install
:::bash
sudo npm install uglifycss uglify-js -g
pip install -U pelican beautifulsoup4 markdown babel
4. Generar el sitio web
`$ (cd freak-theme && make compile)`
:::bash
$ (cd freak-theme && make compile)
$ make html
`$ make html`
<!--Plyr-->
<script src="{static}/vendor/js/play.js"></script>

View File

@ -53,7 +53,7 @@ de un issue del repositorio GitHub de yowsup.
Para crearte una cuenta con yowsup, debes ejecutar el siguiente comando:
```
```bash
$ yowsup-cli registration -E s40 -r sms -p <nº_de_teléfono> -C <código_del_país> -m <código_móvil_del_país> -n <código_móvil_de_la_red>
```
@ -68,14 +68,14 @@ Entonces, como dijo Jack el destripador, vamos por parte.
Si todo funcionó, debería aparecerte algo como esto al final del comando, deberías recibir
un mensaje de texto con el código para registrarte, de forma similar, escribe:
```
```bash
$ yowsup-cli registration -E s40 -p <nº_de_teléfono> -C <código_del_país> -m <código_móvil_del_país> -n <código_móvil_de_la_red> -R <código_del_sms>
```
Donde `<código_del_sms>` corresponde al código que recibiste en tu celular.
El resultado del comando, cerca del final, deberías obtener algo como:
```
```bash
INFO:yowsup.common.http.warequest:b'{"status":"ok","login":"<nº_de_teléfono>","type":"existing","pw":"FBmvgZs8UUbSX2ZHeVyxc7G7g4s=","expiration":4444444444.0,"kind":"free","price":"US$0.99","cost":"0.99","currency":"USD","price_expiration":1497967560}\n' status: b'ok' login: b'<nº_de_teléfono>' pw: b'<contraseña>' type: b'existing' expiration: 4444444444.0 kind: b'free' price: b'US$0.99' cost: b'0.99' currency: b'USD' price_expiration: 1497967560
```
@ -92,10 +92,8 @@ Listo! Ya tienes una cuenta XMPP funcional con WhatsApp. Para agregar contactos
añadirlos con la dirección `<nº_de_teléfono>@dominio.del.transporte>`
**Nota:**
```
<nº_de_teléfono>
```
tiene que ser el número completo pero sin el **signo +**, igual que cuando te registraste.
`<nº_de_teléfono>`: tiene que ser el número completo pero sin el **signo +**, igual que cuando te registraste.
## Para finalizar

View File

@ -34,7 +34,8 @@ donde `modificado.sh` es, en este caso, un script que fue modificado (.❛ ᴗ
Entonces, para modificar nuestro script, texto o código fuente primero hay que
crear el directorio `a` y `b`
$ mkdir a b
:::bash
mkdir a b
En el directorio `a` pondremos el o los archivos sin modificar, y en el
directorio `b` el modificado.
@ -42,8 +43,8 @@ directorio `b` el modificado.
## Segundo paso: crea el parche
Ejecuta:
```
$ git diff --no-prefix --no-index --no-renames --binary a b > parche.patch
```bash
git diff --no-prefix --no-index --no-renames --binary a b > parche.patch
```
+ --no-prefix: No mostrar ningún prefijo de origen o destino.
@ -62,6 +63,7 @@ dependiendo del caso.
archivos de código fuente en C/C++, Python, Pascal, Javascript, PHP, HMTL, etc.
entonces usaremos este comando:
:::bash
patch -p1 -i /ruta/del/parche.diff
2. Con archivos binarios: Es decir, cosas como programas ejecutables ya compilados,
@ -69,6 +71,7 @@ dependiendo del caso.
cuando se parcha un binario cuando en parche dice algo como "GIT binary patch".
En este caso aplicaremos el parche de la siguiente manera:
:::bash
git apply -v /ruta/del/parche.diff
## El problema con diff y no hacer directorios a y b
@ -94,25 +97,26 @@ En el primero, crearé los archivos que puse de ejemplo (valga la redundancia) y
**script.sh:**
```
```bash
#!/bin/bash
echo "Hello world"
```
**script.sh.new:**
```
```bash
#!/bin/sh
echo "Hello world"
echo "This is a patched file :D"
```
Ahora haremos lo que la mayoría de tutoriales de internet te dicen que hagas:
:::bash
diff -u script.sh script.sh.new
Y me queda así:
```
```diff
--- script.sh 2018-03-16 15:52:49.887087539 -0300
+++ script.sh.new 2018-03-16 15:53:02.490420209 -0300
@@ -1,2 +1,3 @@
@ -123,8 +127,11 @@ Y me queda así:
```
Todo aparentemente bien, pero ahora apliquemos dicho parche
```
```bash
$ diff -u script.sh script.sh.new | patch -p1 -i /dev/stdin
```
```diff
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
@ -148,8 +155,11 @@ archivo_binario.bin script.sh
Bien, ahora hagamos el parche con diff:
```
```bash
$ diff -ur a b
```
```diff
Sólo en b: archivo_binario.bin
diff -ur a/script.sh b/script.sh
--- a/script.sh 2018-03-16 15:37:27.513802777 -0300
@ -170,8 +180,11 @@ su trabajo y creara este nuevo archivo no funcionaría porque
pero sí por `git` lo cual nos lleva al tercer punto.
Mira lo que pasa si uso `git` en vez de `diff`:
```
```bash
$ git diff --no-prefix --no-index --no-renames --binary a b
```
```diff
diff --git b/archivo_binario.bin b/archivo_binario.bin
new file mode 100644
index 0000000000000000000000000000000000000000..1ce3c1c596d7a7f400b0cc89bda5a41eed2780c5

View File

@ -19,6 +19,9 @@ MARKDOWN = {
},
'output_format': 'html5',
}
# Fix issue with < and > characters (among others) being double-escaped
# Bug report in markdown/extensions/codehilite.py → https://github.com/Python-Markdown/markdown/pull/726/files
PATH = 'content'
PLUGIN_PATHS = ['plugins']
PLUGINS = ['another_read_more_link', 'i18n_subsites', 'neighbors', 'pelican-css', 'pelican-js', 'sitemap', 'tag-cloud', 'tipue-search']