Skip to content

Commit 0455037

Browse files
Copilotjtemporal
andcommitted
Migrate PT card 022 to Mermaid format with SVG generation
Co-authored-by: jtemporal <[email protected]>
1 parent 99b1fcb commit 0455037

File tree

6 files changed

+127
-14
lines changed

6 files changed

+127
-14
lines changed

_posts/2021-10-13-022.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
---
22
layout: post
3-
title: '#022 git remote rename atual novo'
4-
image: "https://res.cloudinary.com/jesstemporal/image/upload/f_auto/v1642878674/gitfichas/pt/022/thumbnail_rzvcmn.jpg"
5-
permalink: "/projects/022"
3+
pretitle: Como
4+
title: Renomeando
5+
subtitle: um remote
6+
command: git remote rename atual novo
7+
descriptors:
8+
- command: comando para\ngerenciar remotes
9+
- part1: comando para\nrenomear o remote
10+
- part2: nome atual do remote
11+
- part3: novo nome do remote
12+
author: "@jtemporal"
13+
number: "022"
14+
mermaid: true
15+
use_static_image: true
616
translations:
717
- lang: en
818
url: /en/022
19+
permalink: "/projects/022"
920
lang: "pt"
1021
pv:
1122
url: "/projects/021"
@@ -14,14 +25,5 @@ nt:
1425
url: "/projects/023"
1526
title: "#023 git push --set-upstream remote branch"
1627
---
17-
##### Como renomear um remote
18-
19-
<img alt="Use o comando 'git remote rename atual novo' para dar um novo nome para um remote pre-existente" src="https://res.cloudinary.com/jesstemporal/image/upload/v1642878674/gitfichas/pt/022/full_ww7jh5.jpg"><br><br>
2028

21-
| Comando | Descrição |
22-
|---------|-------------|
23-
| `remote` | Comando para gerenciar remotes |
24-
| `rename` | Comando para renomear o remote |
25-
| `atual` | Nome atual do remote |
26-
| `novo` | Novo nome do remote |
27-
{: .styled-table}
29+
{% include mermaid-graphs.html %}

assets/img/mermaid/022-es.svg

Lines changed: 47 additions & 0 deletions
Loading

assets/img/mermaid/022.svg

Lines changed: 47 additions & 0 deletions
Loading

es/_posts/2021-10-13-022.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ descriptors:
1212
author: "@jtemporal"
1313
number: "022"
1414
mermaid: true
15+
use_static_image: true
1516
permalink: "/es/022"
1617
translations:
1718
- lang: pt

puppeteer-config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"args": [
3+
"--no-sandbox",
4+
"--disable-setuid-sandbox"
5+
],
6+
"executablePath": "/usr/bin/chromium-browser"
7+
}

scripts/config_manager.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ def _setup_paths(self):
3939

4040
# Theme configuration
4141
self.theme_path = self.root_dir / 'gitfichas-mermaid-theme.json'
42+
43+
# Puppeteer configuration
44+
self.puppeteer_config_path = self.root_dir / 'puppeteer-config.json'
4245

4346
def _setup_directories(self):
4447
"""Create required directories if they don't exist."""
@@ -92,7 +95,7 @@ def cleanup_temp_files(self):
9295

9396
def get_mermaid_cli_command(self, temp_file: Path, output_path: Path) -> list:
9497
"""Get the Mermaid CLI command arguments."""
95-
return [
98+
cmd = [
9699
'npx', '@mermaid-js/mermaid-cli',
97100
'-i', str(temp_file),
98101
'-o', str(output_path),
@@ -103,6 +106,12 @@ def get_mermaid_cli_command(self, temp_file: Path, output_path: Path) -> list:
103106
'--configFile', str(self.theme_path),
104107
'--cssFile', str(self.combined_css_path)
105108
]
109+
110+
# Add puppeteer config if it exists
111+
if self.puppeteer_config_path.exists():
112+
cmd.extend(['--puppeteerConfigFile', str(self.puppeteer_config_path)])
113+
114+
return cmd
106115

107116
def get_image_path(self, front_matter: Dict[str, Any], file_path: Path) -> Path:
108117
"""Determine the output image path based on front matter and file path."""

0 commit comments

Comments
 (0)