-
Notifications
You must be signed in to change notification settings - Fork 5
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
Infobox parsing module #2
Comments
Hi @dijs , Thanks for your suggestion, if you only want the parser, I can change the interface of current lib like this: var wikiParser = require('wiki-infobox-parser');
/* Previous interface */
wikiParser('france', function(err, result) {
if (err) {
console.error(err.message);
} else {
console.log(result);
}
});
/* New interface */
let config = {
'keyword': 'france',
'wikitext': '=== A sample of original wiki text. ==='
};
/* If wikitext is not null, I will use the text directly without calling Wiki API. */
wikiParser(config, function(err, result) {
if (err) {
console.error(err.message);
} else {
console.log(result);
}
}); Does this work for you? |
I was hoping to not have the request dependency. Since this will be
|
So, a follow up to this. My wikijs is not able to be bundled as a browser app b/c your library uses request. That is why I was hoping the parser itself could be it's own module. If you can't, no problem. I can externalize it. And if I do that, do you mind if I use your code? |
Hi @dijs, sorry for the late reply, I'm OOO this week. I can extract the parser out of this lib, hopefully I can publish it tomorrow. By the way, if you want to use the code directly, feel free to play with it :D |
Hi @dijs , I've publish the first version of the parser, you can check it out here: + wiki-infobox-parser-core@0.0.1. More tests will be added. |
Thank you so much!
|
Awesome. I threw it in here: dijs/wiki#23 Could we not always console log when parsing? Or maybe use the debug module if necessary. |
Thanks @dijs , I will fix them as soon as possible. |
I am the developer of wikijs.
I have a favor to ask, I love the problem this module is solving... Is there any way you could export the parser of this module so I could use JUST the parsing functionality?
I already have the infobox request part, but I would like to use your library for the parsing.
Thanks,
The text was updated successfully, but these errors were encountered: