project2_pug v1.0.9
Set a folder where the files to be found will be to be the input directory, so set a folder for the output files
Example of directory paths to enter:
- Input directory : /home/mike98/Desktop/html_files
- Output Directory : /home/mike98/Desktop/pug_files
Install
git clone https://github.com/Miguel98R/project2Pug.gitnpm installnpm run devInstall by npm
can also install the converter by npm
command:
npm i -g project2_pugstart converter interface
command:
guiexample usage:
project2_pug guiThen visit http://localhost:3008/*
*By default start on port 3008 , this can be modified in the index.js file
Convert CLI mode
Also has the option to convert your html template to pug via CLI
command:
convertoptions:
-i, --inDirectory <inDirectory...> location of the folder where the files to be converted are
-o, --OutDirectory <OutDirectory...> location of the folder where the converted files will be savedexample usage:
project2_pug convert -i "/home/mike98/Desktop/html_files" -o "/home/mike98/Desktop/pug_files"install node modules and start the server in the output folder
command:
start_devexample usage:
project2_pug start_devInitializing template converted
Once you have converted the template, you will notice that a structure has been created for your project , an api-rest based on js express and a database connection in mongo db, this to help in the process of creating projects
Converted views to pug are located in the views folder and static/library files are located in the public folder
to initialize the project simply install the node modules and run the dev command
npm installnpm run devin the CLI section, the command to install the node modules and start the server in the output folder is shown
The project to be launched on port 3055 , this can be modified in the index.js of your output folder
Then visit http://localhost:3055 *
Note: if in your template static files are in an assets folder, this folder will be saved in the public folder just move the contents to the root of the public folder for your template to work properly