File Naming Best Practices
Mecha has some disciplines in naming their files.
General
In general, Mecha uses ^[a-z\d]+(?:-[a-z\d]+)*(?:\.[a-z\d]+)?$ pattern to name a file, which means:
- All characters are in lower-case mode, including the file extension.
- File name should only contains
a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9and-characters. - Each word can be connected with a
-, but you can’t repeat-character in a file name.
foo-bar-baz.txtNamespace
Mecha uses . character to represent a namespace in file name:
foo.bar-baz.txtWhen converted by the f2c function, the file name above (without the file extension) will be returned as this:
Foo\BarBazPartial
Prefix a file name with a - to tell the engine that the file is part of another file:
page.php-page.header.php
-page.body.php
-page.footer.phpHidden
Prefix a file name with a . or a _ character to represent a hidden file:
.foo-bar.txt
_foo-bar.txt
0 Comments
No comments yet.