Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 93cc857d authored by romuald dubourg's avatar romuald dubourg
Browse files

[Update] generation of pdf

parent 328ac748
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,18 @@ TEMPLATE_JEKYLL = _templates/jekyll-gazelle-documentation
DOCS := $(filter-out _templates/,$(DOCS))
DOCS := $(filter-out target/,$(DOCS))
# Répertoire source où se trouvent les fichiers Markdown
SOURCE_DIR := $(CURDIR)
# Récupère tous les fichiers Markdown récursivement dans SOURCE_DIR
MARKDOWN_FILES := $(shell find $(SOURCE_DIR) -type f -name "*.md")
# Génère la liste des répertoires uniques où se trouvent les fichiers Markdown
DIRS := $(sort $(dir $(MARKDOWN_FILES)))
# Remplace l'extension .md par .pdf pour les fichiers cibles
PDF_FILES := $(patsubst $(SOURCE_DIR)/%.md,$(OUTPUT_FOLDER)/%.pdf,$(MARKDOWN_FILES))
all: clean jekyll $(DOCS)
$(DOCS): force | $(OUTPUT_FOLDER)
......@@ -62,6 +74,7 @@ copy_source_to_jekyll:
@echo "Done!"
.PHONY: clean
clean:
-rm -rf $(OUTPUT_FOLDER)
@for a in $(DOCS); do \
......@@ -71,3 +84,13 @@ clean:
fi; \
done;
@echo "All clear!"
# Règle par défaut pour générer tous les PDF. Attention avec les tableaux il peut y avoir des problèmes de rendu voir README
pdf-gen: $(PDF_FILES)
# Règle pour convertir un fichier Markdown en PDF
$(OUTPUT_FOLDER)/%.pdf: $(SOURCE_DIR)/%.md
@mkdir -p $(@D) # Crée le répertoire cible s'il n'existe pas
cd $(dir $<) && pandoc $< -N -s --toc --pdf-engine=xelatex -o $(SOURCE_DIR)/$@
......@@ -93,6 +93,28 @@ The YAML header is used by Jekyll and pandoc to generate menus and front pages,
The YAML header is used by Jekyll and pandoc to generate menus and front pages, make sure all the metadata are present and up-to-date. The *.md files must start with the YAML header.
## Conversion Markdown to Pdf files
To generate pdf files use the command (might take some times)
```bash
sudo make -i pdf-gen
```
you can use
```bash
sudo make clean
```
to remove all generated files
!!WARNING!!
Be careful with table in markdown they may break your pdf if table are too big.
In any case if your pdf is break you might want to use the extension markdown pdf with visual studio code.
With this extension you can generate pdf one by one with command available in the extension.
Table with this extension are correct
## Links
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment