-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown file makes the generator skip the component with external javascript #8
Comments
Thanks for the note @StefanJanssen95 |
I only will be able to fix it by end of the week. I'll keep you posted |
Finally getting beck to fixing stuff. Sorry for being absent |
Hello. Have you solved this problem already? |
I am a bit stuck with a more general problem - parsing the files that are in specific component folder. I'll try to explain. We have 2 basic cases:
or
or even
so trying to figure out what file should be considered a right readme file and what file should be a correct component file the solution I was thinking to implement to have 2 folds:
Because adding proper read of .md is no big deal. But solving this problem properly is a obstacle for me. Let me know what you think of this. Also please send a PR, so that we could elaborate on your solution. |
Sorry! I misunderstood. I thought it was a problem only in this case.
Then I thought that I could parse by sorting the array of the names of the vue file and the md file in the folder with the extension. walker.js const readFlatFiles = (dirPath) => {
var dfd = Q.defer()
dir.readFiles(dirPath, {
match: RegExVueAndMdFiles,
exclude: (runOptions.exclude || /^\./),
excludeDir: runOptions.excludeDir,
matchDir: runOptions.matchDir,
recursive: false
}, function (err, content, next) {
next()
},
function (err, files) {
var files = sortFiles(files)
if (err) throw err
dfd.resolve({
dirPath, files})
})
return dfd.promise
}
const sortFiles = (list) => {
return list.sort(function(a,b){
const reg = /\.[^\.]+$/;
const aExtension = a.match(reg);
const bExtension = b.match(reg);
if( aExtension > bExtension ) return -1;
if( aExtension < bExtension ) return 1;
return 0;
});
}; I am glad that I understood what you wanted to achieve. |
yes, picking the right .vue or .md file is solved by iterating all the files in the folder in my case. the problem is a bit higher as I've said. thanks for the input anyway @To-maruyama . I will tyro to commit the updated as described by the end of this week. |
The new external javascript feature is working pretty well, but I noticed that when I have a markdown file (with the same name) in the component folder it will skip the component in the generation process. When I delete the markdown file again it will see the component in the generation process.
The text was updated successfully, but these errors were encountered: