-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhtmlBasic.bat
63 lines (58 loc) · 1.3 KB
/
htmlBasic.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
::this script create the basic files for a webpage
@echo off
setlocal enabledelayedexpansion
set filename=%1
set openWithCode=%2
goto :main
:CreateTheFiles
setlocal
::make the dirictories
mkdir !filename!
mkdir !filename!\css
mkdir !filename!\scripts
mkdir !filename!\img
::make the needed files
type NUL> !filename!\index.html
type NUL> !filename!\css\style.css
type NUL> !filename!\scripts\script.js
endlocal
goto :eof
:CheckForFilesExistence
setlocal
echo the followed files are created
dir !filename!
endlocal
goto :eof
:OpenWithCode
setlocal
if !openWithcode! == y (
code !filename!
)
endlocal
goto :eof
:CreateTheIndexContent
setlocal
(
echo ^<^^!DOCTYPE html^>
echo ^<html lang="en"^>
echo ^<head^>
echo ^<link rel="stylesheet" href="./css/style.css"^>
echo ^<meta charset="UTF-8"^>
echo ^<meta name="viewport" content="width=device-width, initial-scale=1.0"^>
echo ^<meta http-equiv="X-UA-Compatible" content="ie=edge"^>
echo ^<title^>Document^</title^>
echo ^</head^>
echo ^<body^>
echo ^</body^>
echo ^</html^>
) >> !filename!\index.html
endlocal
goto :eof
:main
setlocal
call :CreateTheFiles
call :CheckForFilesExistence
call :OpenWithCode
call :CreateTheIndexContent
endlocal
goto :eof