当前位置: 动力学知识库 > 问答 > 编程问答 >

html - Wikipedia Reader on iPhone

问题描述:

I want to make a Wikipedia Reader for the iPhone. What's the best approach?

I've already made a few thought about that. Loading the content of the Wikipedia site is quite easy using the Wikipedia API.But the difficulty is how to display the content in a nice way. The content is marked up with wikipedia tags, not html. My idea is to parse the whole content and exchange these elements with real html tags, then I load the text (now in html) into a UIWebView and apply my own styles using a custom CSS file.

But I'm not sure if this a very good solution. Are there any other and better solution for my problem or am I on a right way? It would be nice if you could give a tutorial or and example on that.

Thanks

网友答案:

The content is marked up with wikipedia tags, not html.

This is to your benefit, since you probably don't want to use the regular Wikipedia layout on a screen as small as the iPhone's.

My idea is to parse the whole content and exchange these elements with real html tags, then I load the text (now in html) into a UIWebView and apply my own styles using a custom CSS file.

But I'm not sure if this a very good solution.

This is pretty much how MediaWiki (Wikipedia's own software) does it as well; the render() function calls lots of internal stuff to parse the markup.

分享给朋友:
您可能感兴趣的文章:
随机阅读: