Comments (12)
Hi mathpere.
Thank you for your post.
I agree to your proposal. It's useful.
But htmlclean must know where the root of directory tree is. New option might have to be added.
I think more about it.
from htmlclean.
Thanks for your feedback.
I don't understand why you would need new option.
For this given structure:
src
|--- index.html
|--- subfolder1
|--- view1.html
|--- view2.html
If I modify line 268 of htmlclean binary like this:
pair(paths[0] + (paths[0].substr(-1) !== '/' ? '/' : '') + '/**/*.html', output);
I create destination directory: mkdir www
And I execute this command: htmlclean src -o www
I get this structure:
www
|--- index.html
|--- view1.html
|--- view2.html
Could we use the exact same option by modifying the behavior when HTML files like view1.html
, view2.html
are not located at the root of src
or am I wrong?
from htmlclean.
If you want only that behavior, htmlclean don't have to be modified. Just do htmlclean "src/**/*.html" -o www
.
A subfolder1
directory is missing in www
.
"recreate directory tree" you said. That is, subfolder1
must be made, right?
from htmlclean.
If the structure is:
src
|--- index.html
|--- subfolder1
| |--- view1.html
| |--- view2.html
|--- subfolder2
|--- view1.html
|--- view2.html
view1.html
in www
are mixed from subfolder1/view1.html
and subfolder2/view1.html
. view2.html
too.
from htmlclean.
Oh I'm sorry, my comment was not very clear.
By executing htmlclean src -o www
I get this structure
www
|--- index.html
|--- view1.html
|--- view2.html
But I would like
www
|--- index.html
|--- subfolder1
|--- view1.html
|--- view2.html
So I confirm: htmlclean should first automatically create subfolder1
folder (e.g. mkdirp)
from htmlclean.
Yes, therefore, I think new option have to be added.
htmlclean must know where the root of directory tree is. htmlclean must be given the root via new option, when it can't presume the root.
In your sample, a subfolder1
directory missing in www
. Then mkdir subfolder1
is needed. It's very simple. because it is clear that src
is root.
But, actually, the paths that is given might be not root, or the plurality of those are mixed, maybe.
For example:
src/content1/*.html
(I want to makecontent1
directory inwww
.)src/@(content1|content2)/*.html
src{1,2}
project1/src
(Don't makesrc
directory inwww
.)
from htmlclean.
I rewrote. Please check new version 2.6.0.
The --root
option was added.
- If you specify one root directory (even if it includes pattern) to input (like your sample), you have to do nothing. Because the specific directory is considered as the root.
- Note that if a directory is specified to the input, it is considered as
directory/**/*.html
. Notdirectory/*.html
.
And, I close this issue. If there is problem, please reopen it.
from htmlclean.
Not yet sure if this is an issue but when I execute this command: htmlclean src -o www
I get this following error Error: ENOENT, no such file or directory ''
from htmlclean.
Thank you for test.
Please check again in verbose
mode.
htmlclean src -o www -v
And, permission of www
is ok?
from htmlclean.
Sorry, I mistook...
I fixed it.
Please try v2.6.1.
from htmlclean.
I tried version 2.6.2, it works like a charm, thank you!
from htmlclean.
Thank you for report 😀
from htmlclean.
Related Issues (11)
- Remove commented out code? HOT 1
- Dangerous tampering of attribute value when it contains `>` sign HOT 7
- question(comparison): why htmlclean better, than alternatives? HOT 2
- 'Module not found' error when using in angular app HOT 10
- Add in a param to leave SVGs alone, as compression breaks already optimised SVGs HOT 4
- New lines are not removed {\n} HOT 8
- IE conditional directives from html5 boilerplate cause invalid output HOT 4
- Support the inline SVG HOT 1
- extra space inserted after <div> followed by new line HOT 7
- Improving documentation HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from htmlclean.