Compare commits

..

No commits in common. "d5157f98fa8bb87e4f58a288e546c7d3d9d7f72f" and "4475c1a3f52b28506909137422169ea4b158c663" have entirely different histories.

5 changed files with 24 additions and 42 deletions

View file

@ -1,6 +1,6 @@
Da direcciones a lugares a partir de los datos de OpenStreetMap. Disponible como [servicio comercial](https://graphhopper.com) y como [self-hosted](https://github.com/graphhopper/graphhopper). Da direcciones a lugares a partir de los datos de [[OpenStreetMap]]. Disponible como [servicio comercial](https://graphhopper.com) y como [self-hosted](https://github.com/graphhopper/graphhopper).
Tip: usar la [interfaz web](https://openstreetmap.org) de OpenStreetMap o [GraphHopper Maps](https://graphhopper.com/maps/) para hacer pedidos a la API fácil. Tip: usar la [interfaz web](https://openstreetmap.org) de [[OpenStreetMap]] o [GraphHopper Maps](https://graphhopper.com/maps/) para hacer pedidos a la API fácil.
## API ## API

View file

@ -1 +1,3 @@
- [Opus Recommended Settings](https://wiki.xiph.org/index.php?title=Opus_Recommended_Settings) - [Opus Recommended Settings](https://wiki.xiph.org/index.php?title=Opus_Recommended_Settings)
[[Encoding de multimedia]]

View file

@ -1,11 +1,4 @@
import { import { copyFile, mkdir, opendir, readFile, writeFile } from "fs/promises";
copyFile,
mkdir,
opendir,
readFile,
readdir,
writeFile,
} from "fs/promises";
import { basename, extname, join } from "path"; import { basename, extname, join } from "path";
import { execFile as execFileCallback } from "child_process"; import { execFile as execFileCallback } from "child_process";
import { promisify } from "util"; import { promisify } from "util";
@ -61,13 +54,19 @@ const connections = await scanForConnections(config.sourcePath);
await mkdir(config.buildPath, { recursive: true }); await mkdir(config.buildPath, { recursive: true });
const dir = await readdir(config.sourcePath, { withFileTypes: true }); const dir = await opendir(config.sourcePath);
let pageList: { src: string }[] = []; let pageList: string[] = [];
for (const entry of dir) { let promises: Promise<void>[] = [];
for await (const entry of dir) {
if (!entry.isFile()) continue; if (!entry.isFile()) continue;
const { name } = entry; promises.push(compileFile(entry.name));
const extension = extname(name); }
await Promise.all(promises);
await compilePageList(config, pageList);
async function compileFile(name: string) {
const extension = extname(name);
if ( if (
[ [
".ts", ".ts",
@ -83,14 +82,11 @@ for (const entry of dir) {
) { ) {
await copyFile(join(config.sourcePath, name), join(config.buildPath, name)); await copyFile(join(config.sourcePath, name), join(config.buildPath, name));
} }
if ([".md"].includes(extension) || name.endsWith(".gen.js")) { if ([".md"].includes(extension) || name.endsWith(".gen.js")) {
pageList.push({ src: name }); pageList.push(basename(name, extension));
await compilePage(config, name);
} }
} }
await Promise.all(pageList.map(({ src }) => compilePage(config, src)));
await compilePageList(config, pageList);
async function compilePage(config: Config, sourceFileName: string) { async function compilePage(config: Config, sourceFileName: string) {
const name = basename(sourceFileName, extname(sourceFileName)); const name = basename(sourceFileName, extname(sourceFileName));
@ -166,7 +162,6 @@ async function compileMarkdownHtml(
const parsed = reader.parse(markdown); const parsed = reader.parse(markdown);
const markdownHtml = writer.render(parsed); const markdownHtml = writer.render(parsed);
checkLinks(sourceFileName, markdownHtml);
const contentHtml = await hackilyTransformHtml(markdownHtml); const contentHtml = await hackilyTransformHtml(markdownHtml);
return { html: contentHtml, image }; return { html: contentHtml, image };
} }
@ -359,7 +354,7 @@ function generateConnectionsSection(
: []; : [];
} }
async function compilePageList(config: Config, pageList: { src: string }[]) { async function compilePageList(config: Config, pageList: string[]) {
const name = "Lista de páginas"; const name = "Lista de páginas";
const outputPath = join(config.buildPath, name + ".html"); const outputPath = join(config.buildPath, name + ".html");
const html = render( const html = render(
@ -367,7 +362,6 @@ async function compilePageList(config: Config, pageList: { src: string }[]) {
...generateHeader(name, "compilar.ts"), ...generateHeader(name, "compilar.ts"),
ul( ul(
...pageList ...pageList
.map(({ src: name }) => basename(name, extname(name)))
.sort((a, b) => a.localeCompare(b, "es", { sensitivity: "base" })) .sort((a, b) => a.localeCompare(b, "es", { sensitivity: "base" }))
.map((name) => li(internalLink(name))) .map((name) => li(internalLink(name)))
) )
@ -417,17 +411,6 @@ async function hackilyTransformHtml(html: string): Promise<string> {
return html; return html;
} }
function checkLinks(srcName: string, html: string) {
const matches = html.matchAll(wikilinkExp);
const list = pageList.map(({ src }) => basename(src, extname(src)));
if (!matches) return;
for (const match of matches) {
if (!list.some((n) => n === match[1])) {
console.warn(`${srcName} linkea a ${match[1]}, pero no existe`);
}
}
}
// ============================================== // ==============================================
// Linking // Linking
// ============================================== // ==============================================

View file

@ -7,13 +7,11 @@
- Perdete en la [[Lista de páginas]] - Perdete en la [[Lista de páginas]]
Algunas cosas que escribí: Algunas cosas que escribí:
- [[2023-02-05 Vergüenza algorítmica]] - [[2023-02-05 Vergüenza algorítmica]]
- [[2022-10-15 Analisis de la extracción de datos del teléfono de Fernando André Sabag Montiel]] - [[2022-10-15 Analisis de la extracción de datos del teléfono de Fernando André Sabag Montiel]]
- [[Arreglando bugs ajenos]] - [[Arreglando bugs ajenos]]
Algunas cosas que hice: Algunas cosas que hice:
- [Este sitio](https://gitea.nulo.in/Nulo/sitio) - [Este sitio](https://gitea.nulo.in/Nulo/sitio)
- Juguetes: - Juguetes:
- [Cuarentena](https://cuarentena.nulo.in) - [Cuarentena](https://cuarentena.nulo.in)
@ -24,10 +22,9 @@ Algunas cosas que hice:
- Y otros [[Proyectos]]. - Y otros [[Proyectos]].
Algunas cosas de las que soy parte: Algunas cosas de las que soy parte:
- [Sutty](https://sutty.coop.ar/) - [Sutty](https://sutty.coop.ar/)
## Mis amigxs ([[Mi webring.gen]]) ## Mis amigxs ([[Mi webring]])
<nulo-sitio-reemplazar-con archivo="Mi webring.gen.js" /> <nulo-sitio-reemplazar-con archivo="Mi webring.gen.js" />

View file

@ -1,3 +1,3 @@
Implementación de la CLI de Git usando libgit2. [GitHub](https://github.com/sba1/simplegit) Implementación de la CLI de Git usando libgit2. [GitHub](https://github.com/sba1/simplegit)
[[Git]] y libgit2 [[Git]] y [[libgit2]]