mirror of
https://0xacab.org/anarsec/anarsec.guide.git
synced 2025-06-08 06:42:56 -04:00
layout fr
This commit is contained in:
parent
65777895db
commit
05a1171289
14 changed files with 88 additions and 42 deletions
|
@ -10,8 +10,8 @@ tags = ["intro", "e2ee", "beginner"]
|
||||||
blogimage="/images/cwtch-dither.png"
|
blogimage="/images/cwtch-dither.png"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-19
|
dateedit=2024-04-19
|
||||||
a4="e2ee-a4.pdf"
|
a4="e2ee-a4-en.pdf"
|
||||||
letter = "e2ee-letter.pdf"
|
letter = "e2ee-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
There are several different options for [end-to-end encrypted](/glossary/#end-to-end-encryption-e2ee) communication, each with different trade-offs. This article provides an overview and installation instructions for Tails, Qubes OS, and GrapheneOS.
|
There are several different options for [end-to-end encrypted](/glossary/#end-to-end-encryption-e2ee) communication, each with different trade-offs. This article provides an overview and installation instructions for Tails, Qubes OS, and GrapheneOS.
|
||||||
<!-- more -->
|
<!-- more -->
|
||||||
|
|
|
@ -10,8 +10,8 @@ tags = ["intro", "mobile", "beginner"]
|
||||||
toc = true
|
toc = true
|
||||||
blogimage="/images/graphene-pink.png"
|
blogimage="/images/graphene-pink.png"
|
||||||
dateedit=2024-04-22
|
dateedit=2024-04-22
|
||||||
a4="grapheneos-a4.pdf"
|
a4="grapheneos-a4-en.pdf"
|
||||||
letter="grapheneos-letter.pdf"
|
letter="grapheneos-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
While [anarchists should minimize the presence of phones in their lives](/posts/nophones/), if you do decide to use a phone, make it as difficult as possible for an adversary to geotrack it, intercept its messages, or hack it. This means using GrapheneOS.
|
While [anarchists should minimize the presence of phones in their lives](/posts/nophones/), if you do decide to use a phone, make it as difficult as possible for an adversary to geotrack it, intercept its messages, or hack it. This means using GrapheneOS.
|
||||||
|
|
|
@ -11,8 +11,8 @@ blogimage="/gifs/destroy2.gif"
|
||||||
blogimagepng="/images/destroy.png"
|
blogimagepng="/images/destroy.png"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-21
|
dateedit=2024-04-21
|
||||||
a4="linux-a4.pdf"
|
a4="linux-a4-en.pdf"
|
||||||
letter="linux-letter.pdf"
|
letter="linux-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
As an anarchist, someone's probably recommended that you use a Linux computer at some point. This article is intended to get you started by giving you a brief overview of what you need to know.
|
As an anarchist, someone's probably recommended that you use a Linux computer at some point. This article is intended to get you started by giving you a brief overview of what you need to know.
|
||||||
|
|
|
@ -10,8 +10,8 @@ tags = ["metadata", "tails", "qubes", "beginner"]
|
||||||
blogimage="/images/app-dither.png"
|
blogimage="/images/app-dither.png"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-20
|
dateedit=2024-04-20
|
||||||
a4="metadata-a4.pdf"
|
a4="metadata-a4-en.pdf"
|
||||||
letter="metadata-letter.pdf"
|
letter="metadata-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ tags = ["mobile"]
|
||||||
blogimage="/images/prison-pink.jpg"
|
blogimage="/images/prison-pink.jpg"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-23
|
dateedit=2024-04-23
|
||||||
a4="nophones-a4.pdf"
|
a4="nophones-a4-fr.pdf"
|
||||||
letter="nophones-letter.pdf"
|
letter="nophones-letter-fr.pdf"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
La [culture de la sécurité et la sécurité opérationnelle](https://notrace.how/fr/blog/a-base-to-stand-on/une-base-sur-laquelle-s-appuyer.html), quand elles sont efficaces, empêchent les forces répressives de se renseigner sur nos activités criminelles, mais aussi sur nos vies, nos [relations](https://notrace.how/threat-library/fr/techniques/network-mapping.html), nos déplacements, et ainsi de suite. Ces renseignements sont un énorme atout pour préciser une liste de suspects et mettre en place de la surveillance ciblée. Cet article va présenter quelques stratégies pour tuer le flic dans ta poche.
|
La [culture de la sécurité et la sécurité opérationnelle](https://notrace.how/fr/blog/a-base-to-stand-on/une-base-sur-laquelle-s-appuyer.html), quand elles sont efficaces, empêchent les forces répressives de se renseigner sur nos activités criminelles, mais aussi sur nos vies, nos [relations](https://notrace.how/threat-library/fr/techniques/network-mapping.html), nos déplacements, et ainsi de suite. Ces renseignements sont un énorme atout pour préciser une liste de suspects et mettre en place de la surveillance ciblée. Cet article va présenter quelques stratégies pour tuer le flic dans ta poche.
|
||||||
|
|
|
@ -10,8 +10,8 @@ tags = ["mobile"]
|
||||||
blogimage="/images/prison-pink.jpg"
|
blogimage="/images/prison-pink.jpg"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-23
|
dateedit=2024-04-23
|
||||||
a4="nophones-a4.pdf"
|
a4="nophones-a4-en.pdf"
|
||||||
letter="nophones-letter.pdf"
|
letter="nophones-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Effective [security culture and operational security](https://www.notrace.how/fr/blog/a-base-to-stand-on/a-base-to-stand-on.html) prevents the forces of repression from knowing about our specific criminal activities, but also about our lives, [relationships](https://notrace.how/threat-library/techniques/network-mapping.html), movement patterns, and so on. This knowledge is a huge advantage in narrowing down suspects and conducting targeted surveillance. This article will outline some strategies for killing the cop in your pocket.
|
Effective [security culture and operational security](https://www.notrace.how/fr/blog/a-base-to-stand-on/a-base-to-stand-on.html) prevents the forces of repression from knowing about our specific criminal activities, but also about our lives, [relationships](https://notrace.how/threat-library/techniques/network-mapping.html), movement patterns, and so on. This knowledge is a huge advantage in narrowing down suspects and conducting targeted surveillance. This article will outline some strategies for killing the cop in your pocket.
|
||||||
|
|
|
@ -10,8 +10,8 @@ tags = ["intro", "linux", "windows", "qubes", "intermediate"]
|
||||||
blogimage="/images/qubes-dither.png"
|
blogimage="/images/qubes-dither.png"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-24
|
dateedit=2024-04-24
|
||||||
a4="qubes-a4.pdf"
|
a4="qubes-a4-en.pdf"
|
||||||
letter="qubes-letter.pdf"
|
letter="qubes-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
Qubes OS is a security-oriented [operating system](/glossary#operating-system-os) (OS), which means it is an operating system designed from the ground up to be more difficult to hack. This is achieved through [compartmentalization](https://www.qubes-os.org/faq/#how-does-qubes-os-provide-security), where the base system is divided into compartments called "qubes". All other Linux systems like [Tails](/tags/tails/) are *monolithic*, which means that they are not compartmentalized, so if a hack succeeds anywhere on the system, it can more easily take over. In Qubes OS, if one qube is compromised, the others remain safe. You can think of using Qubes OS as having many different computers on your desk, each for a different activity, but with the convenience of a single physical machine and a set of tools for securely using them all together as a unified system.
|
Qubes OS is a security-oriented [operating system](/glossary#operating-system-os) (OS), which means it is an operating system designed from the ground up to be more difficult to hack. This is achieved through [compartmentalization](https://www.qubes-os.org/faq/#how-does-qubes-os-provide-security), where the base system is divided into compartments called "qubes". All other Linux systems like [Tails](/tags/tails/) are *monolithic*, which means that they are not compartmentalized, so if a hack succeeds anywhere on the system, it can more easily take over. In Qubes OS, if one qube is compromised, the others remain safe. You can think of using Qubes OS as having many different computers on your desk, each for a different activity, but with the convenience of a single physical machine and a set of tools for securely using them all together as a unified system.
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ tags = ["linux", "router", "beginner"]
|
||||||
blogimage="/images/bestpractices-dither.png"
|
blogimage="/images/bestpractices-dither.png"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-10
|
dateedit=2024-04-10
|
||||||
a4="router-a4.pdf"
|
a4="router-a4-en.pdf"
|
||||||
letter="router-letter.pdf"
|
letter="router-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
The security of your home network matters because a malicious network device can be [used to attack any devices that connect to it](https://hak5.org/products/wifi-pineapple) and [State-sponsored malware campaigns are known to compromise network devices](https://arstechnica.com/information-technology/2022/06/a-wide-range-of-routers-are-under-attack-by-new-unusually-sophisticated-malware/).
|
The security of your home network matters because a malicious network device can be [used to attack any devices that connect to it](https://hak5.org/products/wifi-pineapple) and [State-sponsored malware campaigns are known to compromise network devices](https://arstechnica.com/information-technology/2022/06/a-wide-range-of-routers-are-under-attack-by-new-unusually-sophisticated-malware/).
|
||||||
|
|
|
@ -10,8 +10,8 @@ tags = ["linux", "tails", "beginner"]
|
||||||
blogimage="/images/bestpractices-dither.png"
|
blogimage="/images/bestpractices-dither.png"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-25
|
dateedit=2024-04-25
|
||||||
a4="tails-best-a4.pdf"
|
a4="tails-best-a4-en.pdf"
|
||||||
letter="tails-best-letter.pdf"
|
letter="tails-best-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
All anarchists should know how to use Tails — this text describes some additional precautions you can take that are relevant to an anarchist [threat model](/glossary/#threat-model). Not all anarchist threat models are the same, and only you can decide which mitigations are worth putting into practice for your activities, but we aim to provide advice that is appropriate for high-risk activities like claiming an action. If you are new to Tails, start with [Tails for Anarchists](/posts/tails/).
|
All anarchists should know how to use Tails — this text describes some additional precautions you can take that are relevant to an anarchist [threat model](/glossary/#threat-model). Not all anarchist threat models are the same, and only you can decide which mitigations are worth putting into practice for your activities, but we aim to provide advice that is appropriate for high-risk activities like claiming an action. If you are new to Tails, start with [Tails for Anarchists](/posts/tails/).
|
||||||
|
|
|
@ -10,8 +10,8 @@ tags = ["intro", "linux", "tails", "beginner"]
|
||||||
blogimage="/images/tails-dither.png"
|
blogimage="/images/tails-dither.png"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-26
|
dateedit=2024-04-26
|
||||||
a4="tails-a4.pdf"
|
a4="tails-a4-en.pdf"
|
||||||
letter="tails-letter.pdf"
|
letter="tails-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Tails is an [operating system](/glossary/#operating-system-os) that makes anonymous computer use accessible to everyone. Tails is [designed](https://tails.net/about/index.en.html) to leave no trace of your activity on your computer unless you explicitly configure it to save specific data. It accomplishes this by running from a DVD or USB, independent of the operating system installed on the computer. Tails comes with [several built-in applications](https://tails.net/doc/about/features/index.en.html) preconfigured with security in mind, and all anarchists should know how to use it for secure communication, research, editing, and publishing sensitive content.
|
Tails is an [operating system](/glossary/#operating-system-os) that makes anonymous computer use accessible to everyone. Tails is [designed](https://tails.net/about/index.en.html) to leave no trace of your activity on your computer unless you explicitly configure it to save specific data. It accomplishes this by running from a DVD or USB, independent of the operating system installed on the computer. Tails comes with [several built-in applications](https://tails.net/doc/about/features/index.en.html) preconfigured with security in mind, and all anarchists should know how to use it for secure communication, research, editing, and publishing sensitive content.
|
||||||
|
|
|
@ -10,8 +10,8 @@ tags = ["opsec", "beginner"]
|
||||||
blogimage="/images/beads-pink.jpg"
|
blogimage="/images/beads-pink.jpg"
|
||||||
toc=true
|
toc=true
|
||||||
dateedit=2024-04-18
|
dateedit=2024-04-18
|
||||||
a4="tamper-a4.pdf"
|
a4="tamper-a4-en.pdf"
|
||||||
letter="tamper-letter.pdf"
|
letter="tamper-letter-en.pdf"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
If the police ever have [physical access](/glossary/#physical-attacks) to an electronic device like a laptop, even [for five minutes](https://www.vice.com/en/article/a3q374/hacker-bios-firmware-backdoor-evil-maid-attack-laptop-5-minutes), they can install hardware keyloggers, create images of the storage media, or otherwise trivially compromise it at the hardware, firmware, or software level. One way to minimize this risk is to make devices tamper-evident. As the Threat Library [notes](https://notrace.how/threat-library/mitigations/tamper-evident-preparation.html), "Tamper-evident preparation is the process of taking precautionary measures to make it possible to detect when something has been physically accessed by an adversary."
|
If the police ever have [physical access](/glossary/#physical-attacks) to an electronic device like a laptop, even [for five minutes](https://www.vice.com/en/article/a3q374/hacker-bios-firmware-backdoor-evil-maid-attack-laptop-5-minutes), they can install hardware keyloggers, create images of the storage media, or otherwise trivially compromise it at the hardware, firmware, or software level. One way to minimize this risk is to make devices tamper-evident. As the Threat Library [notes](https://notrace.how/threat-library/mitigations/tamper-evident-preparation.html), "Tamper-evident preparation is the process of taking precautionary measures to make it possible to detect when something has been physically accessed by an adversary."
|
||||||
|
|
|
@ -7,9 +7,9 @@ paginate_by = 5
|
||||||
<br>
|
<br>
|
||||||
<div class="column is-8 is-offset-2">
|
<div class="column is-8 is-offset-2">
|
||||||
|
|
||||||
AnarSec is a resource designed to help anarchists navigate the hostile terrain of technology — defensive guides for digital security and anonymity, as well as offensive guides for hacking. All guides are available in booklet format for printing and will be kept up to date.
|
AnarSec est une ressource conçue pour aider les anarchistes à se frayer un chemin à travers le terrain hostile de la technologie — des guides défensifs sur la sécurité numérique et l'anonymat, et des guides offensifs sur le piratage informatique. Tous les guides sont disponibles sous forme de brochures à imprimer et seront maintenus à jour.
|
||||||
|
|
||||||
## Defensive
|
## Défensif
|
||||||
|
|
||||||
### Tails
|
### Tails
|
||||||
* [Tails for Anarchists](/posts/tails/)
|
* [Tails for Anarchists](/posts/tails/)
|
||||||
|
@ -18,17 +18,17 @@ AnarSec is a resource designed to help anarchists navigate the hostile terrain o
|
||||||
### Qubes OS
|
### Qubes OS
|
||||||
* [Qubes OS for Anarchists](/posts/qubes/)
|
* [Qubes OS for Anarchists](/posts/qubes/)
|
||||||
|
|
||||||
### Phones
|
### Téléphonie
|
||||||
* [Kill the Cop in Your Pocket](/posts/nophones/)
|
* [**Tue le flic dans ta poche**](/fr/posts/nophones/)
|
||||||
* [GrapheneOS for Anarchists](/posts/grapheneos/)
|
* [GrapheneOS for Anarchists](/posts/grapheneos/)
|
||||||
|
|
||||||
### General
|
### Général
|
||||||
* [Linux Essentials](/posts/linux/)
|
* [Linux Essentials](/posts/linux/)
|
||||||
* [Remove Identifying Metadata From Files](/posts/metadata/)
|
* [Remove Identifying Metadata From Files](/posts/metadata/)
|
||||||
* [Encrypted Messaging for Anarchists](/posts/e2ee/)
|
* [Encrypted Messaging for Anarchists](/posts/e2ee/)
|
||||||
* [Make Your Electronics Tamper-Evident](/posts/tamper/)
|
* [Make Your Electronics Tamper-Evident](/posts/tamper/)
|
||||||
|
|
||||||
## Offensive
|
## Offensif
|
||||||
|
|
||||||
*Coming soon*
|
*Coming soon*
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
subtitle: none,
|
subtitle: none,
|
||||||
category: none,
|
category: none,
|
||||||
backcoverinsidecontent: none,
|
backcoverinsidecontent: none,
|
||||||
|
lang: none,
|
||||||
content
|
content
|
||||||
) = {
|
) = {
|
||||||
|
|
||||||
|
@ -43,18 +44,32 @@
|
||||||
dy: -20pt,
|
dy: -20pt,
|
||||||
)[
|
)[
|
||||||
#set text(font: "Jost")
|
#set text(font: "Jost")
|
||||||
#text(18pt)[Series: #category]
|
#if lang == "en" [
|
||||||
|
#text(18pt)[Series: #category]
|
||||||
|
]
|
||||||
|
#if lang == "fr" [
|
||||||
|
#text(18pt)[Séries: #category]
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// inside cover
|
// inside cover
|
||||||
page()[
|
page()[
|
||||||
#set align(center + bottom)
|
#if lang == "en" [
|
||||||
|
#set align(center + bottom)
|
||||||
|
|
||||||
#text()[This version of the zine was last edited on #lastediteddate. Visit anarsec.guide to see whether it has been updated since.]
|
#text()[This version of the zine was last edited on #lastediteddate. Visit anarsec.guide to see whether it has been updated since.]
|
||||||
|
|
||||||
#text()[The dagger symbol #super[†] on a word means that there is a glossary entry for it. Ai ferri corti.]
|
#text()[The dagger symbol #super[†] on a word means that there is a glossary entry for it. Ai ferri corti.]
|
||||||
|
]
|
||||||
|
#if lang == "fr" [
|
||||||
|
#set align(center + bottom)
|
||||||
|
|
||||||
|
#text()[Cette version de la brochure a été modifiée pour la dernière fois le #lastediteddate. Visitez anarsec.guide/fr pour savoir si elle a été mise à jour depuis.]
|
||||||
|
|
||||||
|
#text()[Le symbole de dague #super[†] près d'un mot indique qu'une entrée existe dans le glossaire pour ce mot. Ai ferri corti.]
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
// set headings
|
// set headings
|
||||||
|
|
|
@ -22,7 +22,8 @@ class Converter:
|
||||||
self.pandoc_binary = pandoc_binary
|
self.pandoc_binary = pandoc_binary
|
||||||
self.typst_binary = typst_binary
|
self.typst_binary = typst_binary
|
||||||
self.anarsec_root = anarsec_root
|
self.anarsec_root = anarsec_root
|
||||||
self.post_id = post_id
|
self.post_id = post_id.split('.',1)[0]
|
||||||
|
self.post_lang = post_id.split('.',1)[1]
|
||||||
self.force = force
|
self.force = force
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
|
|
||||||
|
@ -43,22 +44,34 @@ class Converter:
|
||||||
"""Convert the input file to the output file. This method should only be run once."""
|
"""Convert the input file to the output file. This method should only be run once."""
|
||||||
|
|
||||||
# Set glossary file
|
# Set glossary file
|
||||||
glossary_file = self.anarsec_root / "content" / "glossary" / "_index.md"
|
if self.post_lang == 'en':
|
||||||
|
glossary_file = self.anarsec_root / "content" / "glossary" / "_index.md"
|
||||||
|
else:
|
||||||
|
glossary_file = self.anarsec_root / "content" / "glossary" / f"_index.{self.post_lang}.md"
|
||||||
if not glossary_file.exists() or not glossary_file.is_file():
|
if not glossary_file.exists() or not glossary_file.is_file():
|
||||||
raise RuntimeError(f"Glossary file '{glossary_file}' doesn't exist or isn't a file.")
|
raise RuntimeError(f"Glossary file '{glossary_file}' doesn't exist or isn't a file.")
|
||||||
|
|
||||||
# Set recommendations file
|
# Set recommendations file
|
||||||
recommendations_file = self.anarsec_root / "content" / "recommendations" / "_index.md"
|
if self.post_lang == 'en':
|
||||||
|
recommendations_file = self.anarsec_root / "content" / "recommendations" / "_index.md"
|
||||||
|
else:
|
||||||
|
recommendations_file = self.anarsec_root / "content" / "recommendations" / f"_index.{self.post_lang}.md"
|
||||||
if not recommendations_file.exists() or not recommendations_file.is_file():
|
if not recommendations_file.exists() or not recommendations_file.is_file():
|
||||||
raise RuntimeError(f"Recommendations file '{recommendations_file}' doesn't exist or isn't a file.")
|
raise RuntimeError(f"Recommendations file '{recommendations_file}' doesn't exist or isn't a file.")
|
||||||
|
|
||||||
# Set series file
|
# Set series file
|
||||||
series_file = self.anarsec_root / "content" / "series" / "_index.md"
|
if self.post_lang == 'en':
|
||||||
|
series_file = self.anarsec_root / "content" / "series" / "_index.md"
|
||||||
|
else:
|
||||||
|
series_file = self.anarsec_root / "content" / "series" / f"_index.{self.post_lang}.md"
|
||||||
if not series_file.exists() or not series_file.is_file():
|
if not series_file.exists() or not series_file.is_file():
|
||||||
raise RuntimeError(f"Series file '{series_file}' doesn't exist or isn't a file.")
|
raise RuntimeError(f"Series file '{series_file}' doesn't exist or isn't a file.")
|
||||||
|
|
||||||
# Set input path
|
# Set input path
|
||||||
input_path = self.post_directory / "index.md"
|
if self.post_lang == 'en':
|
||||||
|
input_path = self.post_directory / "index.md"
|
||||||
|
else:
|
||||||
|
input_path = self.post_directory / f"index.{self.post_lang}.md"
|
||||||
if not input_path.exists() or not input_path.is_file():
|
if not input_path.exists() or not input_path.is_file():
|
||||||
raise RuntimeError(f"Post Markdown file '{input_path}' doesn't exist or isn't a file.")
|
raise RuntimeError(f"Post Markdown file '{input_path}' doesn't exist or isn't a file.")
|
||||||
|
|
||||||
|
@ -73,7 +86,10 @@ class Converter:
|
||||||
# For each paper size
|
# For each paper size
|
||||||
for paper_size in ["a4", "letter"]:
|
for paper_size in ["a4", "letter"]:
|
||||||
# Set the output path
|
# Set the output path
|
||||||
output_path = self.post_directory / f"{self.post_id}-{paper_size}.pdf"
|
if self.post_lang == 'en':
|
||||||
|
output_path = self.anarsec_root / "static" / "posts" / self.post_id / f"{self.post_id}-{paper_size}-{self.post_lang}.pdf"
|
||||||
|
else:
|
||||||
|
output_path = self.anarsec_root / "static" / self.post_lang / "posts" / self.post_id / f"{self.post_id}-{paper_size}-{self.post_lang}.pdf"
|
||||||
if not self.force and output_path.exists():
|
if not self.force and output_path.exists():
|
||||||
raise RuntimeError(f"Output file '{output_path}' already exists.")
|
raise RuntimeError(f"Output file '{output_path}' already exists.")
|
||||||
|
|
||||||
|
@ -122,7 +138,10 @@ class Converter:
|
||||||
|
|
||||||
# Add recommendations to the Markdown content
|
# Add recommendations to the Markdown content
|
||||||
recommendations = re.search(r'\+{3}.*?\+{3}(.*)', recommendations_file.open().read(), re.MULTILINE | re.DOTALL).group(1)
|
recommendations = re.search(r'\+{3}.*?\+{3}(.*)', recommendations_file.open().read(), re.MULTILINE | re.DOTALL).group(1)
|
||||||
markdown_content += f"\n\n# Appendix: Recommendations\n\n{recommendations}\n\n"
|
if self.post_lang == 'en':
|
||||||
|
markdown_content += f"\n\n# Appendix: Recommendations\n\n{recommendations}\n\n"
|
||||||
|
if self.post_lang == 'fr':
|
||||||
|
markdown_content += f"\n\n# Annexe: Recommendations\n\n{recommendations}\n\n"
|
||||||
|
|
||||||
# Make all images paths relative in the Markdown content
|
# Make all images paths relative in the Markdown content
|
||||||
for extension in ["jpg", "png", "webp", "jpeg", "gif"]:
|
for extension in ["jpg", "png", "webp", "jpeg", "gif"]:
|
||||||
|
@ -138,7 +157,10 @@ class Converter:
|
||||||
|
|
||||||
# Add glossary entries to the Markdown content
|
# Add glossary entries to the Markdown content
|
||||||
if glossary_entries:
|
if glossary_entries:
|
||||||
markdown_content += "\n\n# Appendix: Glossary\n\n"
|
if self.post_lang == 'en':
|
||||||
|
markdown_content += "\n\n# Appendix: Glossary\n\n"
|
||||||
|
if self.post_lang == 'fr':
|
||||||
|
markdown_content += "\n\n# Annexe: Glossaire\n\n"
|
||||||
for entry, entry_content in glossary.items():
|
for entry, entry_content in glossary.items():
|
||||||
if entry in glossary_entries:
|
if entry in glossary_entries:
|
||||||
markdown_content += f"## {entry_content[0]}\n\n{entry_content[1]}\n\n"
|
markdown_content += f"## {entry_content[0]}\n\n{entry_content[1]}\n\n"
|
||||||
|
@ -159,6 +181,14 @@ class Converter:
|
||||||
series_typst_path = pathlib.Path(workingDirectory) / f"series.typ"
|
series_typst_path = pathlib.Path(workingDirectory) / f"series.typ"
|
||||||
subprocess.check_call([str(self.pandoc_binary), "-f", "markdown", "-t", "typst", "--columns", "999999", "-o", series_typst_path, series_markdown_path])
|
subprocess.check_call([str(self.pandoc_binary), "-f", "markdown", "-t", "typst", "--columns", "999999", "-o", series_typst_path, series_markdown_path])
|
||||||
|
|
||||||
|
# mutlilingual categories
|
||||||
|
category = toml_front_matter["taxonomies"]["categories"][0]
|
||||||
|
if self.post_lang == 'fr':
|
||||||
|
if category == 'Defensive':
|
||||||
|
category = 'Défensif'
|
||||||
|
if category == 'Offensive':
|
||||||
|
category = 'Offensif'
|
||||||
|
|
||||||
# Build the full typst file
|
# Build the full typst file
|
||||||
full_typst_path = pathlib.Path(workingDirectory) / f"{self.post_id}-full.typ"
|
full_typst_path = pathlib.Path(workingDirectory) / f"{self.post_id}-full.typ"
|
||||||
full_typst = f"""
|
full_typst = f"""
|
||||||
|
@ -173,8 +203,9 @@ class Converter:
|
||||||
lastediteddate: "{toml_front_matter["extra"]["dateedit"]}",
|
lastediteddate: "{toml_front_matter["extra"]["dateedit"]}",
|
||||||
description: "{description}",
|
description: "{description}",
|
||||||
subtitle: "{toml_front_matter.get("description")}",
|
subtitle: "{toml_front_matter.get("description")}",
|
||||||
category: "{toml_front_matter["taxonomies"]["categories"][0]}",
|
category: "{category}",
|
||||||
backcoverinsidecontent: [{series_typst_path.open().read()}],
|
backcoverinsidecontent: [{series_typst_path.open().read()}],
|
||||||
|
lang: "{self.post_lang}",
|
||||||
content
|
content
|
||||||
)
|
)
|
||||||
{typst_path.open().read()}
|
{typst_path.open().read()}
|
||||||
|
@ -225,7 +256,7 @@ if __name__ == "__main__":
|
||||||
parser.add_argument("--pandoc-binary", type = pathlib.Path, required = True, help = "Path to the Pandoc binary. Minimum required version is 3.1.5.")
|
parser.add_argument("--pandoc-binary", type = pathlib.Path, required = True, help = "Path to the Pandoc binary. Minimum required version is 3.1.5.")
|
||||||
parser.add_argument("--typst-binary", type = pathlib.Path, required = True, help = "Path to the typst binary. Minimum required version is 0.6.0.")
|
parser.add_argument("--typst-binary", type = pathlib.Path, required = True, help = "Path to the typst binary. Minimum required version is 0.6.0.")
|
||||||
parser.add_argument("--anarsec-root", type = pathlib.Path, required = True, help = "Root of the Anarsec repository.")
|
parser.add_argument("--anarsec-root", type = pathlib.Path, required = True, help = "Root of the Anarsec repository.")
|
||||||
parser.add_argument("--post-id", type = str, required = True, help = "ID of the Anarsec post to convert, i.e. the name of the post folder in '/content/posts'.")
|
parser.add_argument("--post-id", type = str, required = True, help = "ID of the Anarsec post to convert with language added after a period, i.e. 'nophones.en' and 'nophones.fr', where 'nophones' is the name of the post folder in '/content/posts'.")
|
||||||
parser.add_argument("-f", "--force", dest = "force", default = False, action = "store_true", help = "Replace the output files if they already exist.")
|
parser.add_argument("-f", "--force", dest = "force", default = False, action = "store_true", help = "Replace the output files if they already exist.")
|
||||||
parser.add_argument("-v", "--verbose", dest = "verbose", default = False, action = "store_true", help = "Print messages when the output files are created.")
|
parser.add_argument("-v", "--verbose", dest = "verbose", default = False, action = "store_true", help = "Print messages when the output files are created.")
|
||||||
arguments = parser.parse_args()
|
arguments = parser.parse_args()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue