Skip to content

Commit c5c1721

Browse files
authored
Merge pull request #25 from thom-cr/function_parsing
Last modifications and implementation of Function Parsing
2 parents 7b93175 + 25a37ef commit c5c1721

20 files changed

+50
-49
lines changed

src/functions/DocumentationGenerator.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
const FileParsing = require('./FileParsing');
2-
const OutputTitle = require('./OutputTitle');
2+
const OutputTitlePDF = require('./OutputTitlePDF');
33
const OutputNameFilePDF = require('./OutputNameFilePDF');
44
const WritePDF = require('./WritePDF');
55
const OutputTitleMarkdown = require('./OutputTitleMarkdown');
66
const OutputNameFileMarkdown = require('./OutputNameFileMarkdown');
77
const WriteMarkdown = require('./WriteMarkdown');
8+
89
/* Doc:
9-
explication du generateur de documentation
10-
qui est vraiment super genial
10+
Function called by DocumentationGenerator component to generate output file (PDF and/or MD) with the help of
11+
WritePDF and WriteMarkdown
1112
*/
1213
const DocumentationGenerator = async (formData, rows) => {
1314
const { projectName, formats } = formData;
1415
const filesParsed = await FileParsing(formData, rows);
1516

1617
if (formats.pdf) {
17-
const outputTitle = OutputTitle(projectName);
18+
const outputTitle = OutputTitlePDF(projectName);
1819
const outputNameFilePDF = OutputNameFilePDF(projectName);
1920

2021
WritePDF(outputTitle, outputNameFilePDF, filesParsed);

src/functions/FileParsing.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Doc: Used to parse files and only keep the ones with desired extensions
2+
13
const FileParsing = async (formData, rows) => {
24
if (!formData || !formData.files || !Array.isArray(rows)) {
35
return [];

src/functions/FilesArray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const ToArrayExtensions = require("./ToArrayExtensions");
22
const FilterFiles = require("./FilterFiles");
33

4-
// Doc: fonction permettant l'affichage des fichiers pris en charge par la generation de la documentation
4+
// Doc: Use to display the files selected by FileSelector or FolderSelector. It updates based on the extensions input.
55
async function FilesArray (files, extensionsName) {
66
if (!extensionsName || typeof extensionsName !== "string" || extensionsName.trim().length === 0) {
77
return [];

src/functions/FilesArraySelection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//doc: fonction qui retourne un dictionnaire avec le nom du fichier et l'extension
1+
//doc: returns dictionnary with fileName and extensions
22

33
const FilesArraySelection = (files) => {
44
const rows = files.map((fileEntry) => {

src/functions/FilesSelector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Doc: fonction permettant de sélectionner les différents fichiers
1+
// Doc: Used to select the files
22

33
const FilesSelector = async () => {
44
const pickerOptions = {

src/functions/FilterFiles.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
// doc: Cette fonction filre les fichiers selon les extensions choisis et renvoie le tableau des fichiers filtres
1+
// doc: Can filter files based on the selected extensions and returns the array of filtered files.
2+
3+
4+
5+
6+
7+
8+
9+
210

311
const FilterFiles = async (files, extensions) => {
412
let filesArray = [];

src/functions/FolderSelector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const GetAllFiles = require("./GetAllFiles");
22

3-
// doc: Fonction pour sélectionner un dossier
3+
// doc: Used to select a folder
44
const FolderSelector = async () => {
55
try {
66
const directoryHandle = await window.showDirectoryPicker();

src/functions/GetAllFiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Doc: Permet d'attraper récursivement les fichiers dans les différents dossiers et sous-dossier
1+
// Doc: Catch files recursively in subdirectories
22

33
const GetAllFiles = async (directoryHandle, files) => {
44
for await (const entry of directoryHandle.values()) {

src/functions/OutputNameFileMarkdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// doc: ajoute le .md a la fin du project Name
1+
// doc: Add .md at the end of projectName
22

33
const OutputNameFileMarkdown = (projectName) => {
44
const extension = ".md";

src/functions/OutputNameFilePDF.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// doc: ajoute le .pdf a la fin du project Name
1+
// doc: Add .pdf at the end of projectName
22

33
const OutputNameFilePDF = (projectName) => {
44
const extension = ".pdf";

0 commit comments

Comments
 (0)