Skip to content

Commit c591861

Browse files
Thomas CRATERThomas CRATER
authored andcommitted
Modification of README
1 parent dfa1dc5 commit c591861

File tree

1 file changed

+180
-9
lines changed

1 file changed

+180
-9
lines changed

README.md

Lines changed: 180 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,192 @@ npm run dev
1414

1515
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
1616

17-
## Learn More
17+
## Usage
1818

19-
To learn more about Next.js, take a look at the following resources:
19+
The documentation generator extracts comments from the code to generate structured documentation in **PDF** or **Markdown** format.
2020

21-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
22-
- [Learn Next.js](https://nextjs.org/learn-pages-router) - an interactive Next.js tutorial.
21+
### Comment Format
2322

24-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
23+
For a comment to be recognized and included in the documentation, it must follow one of these formats:
2524

26-
## Deploy on Vercel
25+
- **Single-line comments:**
26+
```js
27+
//Doc: This function retrieves user data.
28+
// Doc: This function retrieves user data.
29+
//doc: This function retrieves user data.
30+
// doc: This function retrieves user data.
31+
```
2732

28-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
33+
- **Multi-line comments:**
34+
```js
35+
/*Doc: This function retrieves user data. */
36+
/* Doc: This function retrieves user data. */
37+
/*doc: This function retrieves user data. */
38+
/* doc: This function retrieves user data. */
39+
```
2940

30-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/pages/building-your-application/deploying) for more details.
41+
### Function Association
42+
43+
To associate a comment with a specific function, it must be placed **immediately before the function declaration**. Example:
44+
45+
```js
46+
//Doc: This function retrieves user data from the database.
47+
function getUserData() {
48+
// Function logic here
49+
}
50+
```
51+
52+
### Supported Projects
53+
54+
Currently, this feature is only available for **JavaScript** projects. Support for additional languages may be added in future updates.
55+
56+
## Description
57+
The automatic documentation generator is a tool that allows the creation and export of technical documentation in **PDF** or **Markdown** format for a project using the code and its comments with the help of **Jspdf** and **File-saver**.
58+
59+
## Technologies
60+
- Node.js
61+
- Next.js
62+
- React
63+
64+
### Required Libraries:
65+
- File-saver
66+
- Jspdf
67+
- Jest
68+
- Mui
69+
70+
## MVP Features
71+
- Documentation generation based on comments.
72+
- Support for **REACT** and **JAVASCRIPT** files.
73+
- Selection of the project to document.
74+
- Storage and usage **ONLY** locally.
75+
76+
## Features
77+
- Display of detected file names.
78+
- Support for additional extensions.
79+
- Selection of file extensions to analyze.
80+
- Selection of output format (**PDF, MARKDOWN**).
81+
82+
## MVP Components
83+
- Documentation generation button (**ButtonGenerateDocumentation.jsx**)
84+
- File selection button (**ButtonFilesSelector.jsx**)
85+
- Folder selection button (**ButtonFolderSelector.jsx**)
86+
- Project name input field (**TextBoxProjectName.jsx**)
87+
88+
### Additional Components
89+
- Help button (**ButtonHelp.jsx**)
90+
- Output format checkbox (**CheckBoxOutputFormat.jsx**)
91+
- File table (**TableDetectedFiles.jsx**)
92+
- Extension input field (**TextBoxExtentions.jsx**)
93+
94+
## MVP Functions
95+
- Documentation generation (**DocumentationGenerator.js**)
96+
- File parsing (**FileParsing.js**)
97+
- File table (**FilesArray.js**)
98+
- File dictionary (**FilesArraySelection.js**)
99+
- File selection (**FilesSelector.js**)
100+
- File filtering (**FilterFiles.js**)
101+
- Folder selection (**FolderSelector.js**)
102+
- Markdown writing (**WriteMarkdown.js**)
103+
- PDF writing (**WritePDF.js**)
104+
105+
### Additional Functions
106+
- Recursive file capture (**GetAllFiles.js**)
107+
- PDF file name generator (**OutputNameFilePDF.js**)
108+
- Markdown file name generator (**OutputNameFileMarkdown.js**)
109+
- Markdown title generator (**OutputTitleMarkdown.js**)
110+
- PDF title generator (**OutputTitlePDF.js**)
111+
- Extension array transformation (**ToArrayExtensions.js**)
112+
113+
![Image 2](file-FrFcnmFZkC2Yhwav1K3Dgf)
114+
115+
## Components
116+
117+
### Documentation Generation Button
118+
A button that generates the documentation using the **DocumentationGenerator** function. At least one file must be selected, the project must have a name, and at least one output format must be chosen.
119+
120+
### Folder Selection Button
121+
A button that calls **FolderSelector, FilesArray,** and **FilesArraySelection** functions to select a folder from the disk and update the table.
122+
123+
### File Selection Button
124+
A button that calls **FilesSelector, FilesArray,** and **FilesArraySelection** functions to select one or more files from the disk and update the table.
125+
126+
### Output Format Checkbox
127+
Allows the selection of output format (**PDF** or **Markdown**) using two checkboxes. Updates the **formats dictionary** and the **boolean values** of the checkboxes.
128+
129+
### File Table
130+
Displays the file names and extensions to verify the correct detection of all selected files.
131+
132+
### Project Name Input Field
133+
Retrieves the project name from the text input field to update it in **formData**. The input is stored in the **projectName** variable.
134+
135+
### Extension Name Text Field
136+
Retrieves the names of extensions to analyze and updates the **formData** and the file table.
137+
138+
### Help Button
139+
A component that displays a button to help users understand how the generator works.
140+
141+
![Image 3](file-AxLWVqgC4Bt1AyRGqvwu3Z)
142+
143+
## Functions
144+
145+
### FolderSelector()
146+
Allows selection of the folder to analyze using **showDirectoryPicker**. Uses the **GetAllFiles** function to recursively retrieve files from subfolders. Returns an **array of files** in **filehandle** format.
147+
148+
### FilesSelector()
149+
Allows selection of one or more files to analyze using **showOpenFilePicker**. Returns an **array of files** in **filehandle** format.
150+
151+
### FilesArray(array files, string extensionsName)
152+
Takes an array of files and an **extensions string** as input. The function converts the extensions into an array and returns a call to the **FilterFiles** function.
153+
154+
### FilterFiles(array files, array extensions)
155+
Takes the **file array** and **extensions array** as input to return an array of files containing the targeted extensions using **ToArrayExtensions**.
156+
157+
### ToArrayExtensions(string extensionsName)
158+
Takes extensions **separated by commas** as a string and converts them into an array.
159+
160+
### OutputNameFilePDF(string projectName)
161+
Takes the **project name** as input to return the output file name with **.pdf**.
162+
163+
### OutputNameFileMarkdown(string projectName)
164+
Takes the **project name** as input to return the output file name with **.md**.
165+
166+
### OutputTitlePDF(string projectName)
167+
Takes the **project name** as input to rewrite it as the title at the beginning of the **PDF output** file using the **jspdf** library in the format **"Documentation of projectName"**.
168+
169+
### OutputTitleMarkdown(string projectName)
170+
Takes the **project name** as input to rewrite it as the title at the beginning of the **Markdown output** file in the format **"# Documentation of projectName"**.
171+
172+
### OutputFormat(boolean checkboxPdf, boolean checkboxMd)
173+
Takes the **PDF and Markdown checkbox booleans** as input to create a **dictionary (array)** that will be used in **DocGenerator**. It also checks that at least **one of the two checkboxes is checked**.
174+
175+
### FileParsing(formData, rows)
176+
Takes all the **data and sorted rows** as input to analyze the extension and choose the correct syntax for extracting comments and function names. It also generates a **dictionary** with the **file name, function names, and associated comments**.
177+
178+
### WritePDF(string outputTitlePDF, string outputNameFilePDF, array filesParsed)
179+
Takes the **title, PDF file name,** and **sorted file array** as input to generate the documentation in **PDF format**.
180+
181+
### WriteMarkdown(string outputTitleMarkdown, string outputNameFileMarkdown, array filesParsed)
182+
Takes the **title, Markdown file name,** and **sorted file array** as input to generate the documentation in **Markdown format**.
183+
184+
### DocumentationGenerator(formData, rows)
185+
Takes the **entire form data and sorted rows** as input to generate the output files by reusing the functions listed above (**FileParsing, OutputTitlePDF, OutputNameFilePDF, WritePDF, OutputTitleMarkdown, OutputNameFileMarkdown, WriteMarkdown**).
186+
187+
![Documentation Generator](images/Image1.jpg)
188+
189+
## Examples
190+
191+
Example documentation files generated by this project are available in the **examples** folder.
192+
-
193+
194+
## User Interface
195+
196+
![User Interface](images/Image2.jpg)
197+
198+
## Scheme
199+
200+
![Scheme Part 1](images/Image3.jpg)
201+
![Scheme Part 2](images/Image4.jpg)
31202

32203
## Coverage
33204

34-
[![codecov](https://codecov.io/gh/thom-cr/documentation-generator/graphs/tree.svg?token=iPKvKDwdvB)](https://codecov.io/gh/thom-cr/documentation-generator)
205+
[![codecov](https://codecov.io/gh/thom-cr/documentation-generator/graphs/tree.svg?token=iPKvKDwdvB)](https://codecov.io/gh/thom-cr/documentation-generator)

0 commit comments

Comments
 (0)