sweble / sweble-wikitext

The Sweble Wikitext Components module provides a parser for MediaWiki's wikitext and an engine trying to emulate the behavior of a MediaWiki.
http://sweble.org/sites/swc-devel/develop-latest/tooling/sweble/sweble-wikitext
70 stars 27 forks source link

Missing CSS #58

Closed drewmutt closed 6 years ago

drewmutt commented 7 years ago

I feel this might be a profoundly stupid question, but I couldn't find the answer anywhere. So upon exporting, I just got raw html (fair enough), but could you point me to a CSS that can make the page appear similarly to how it looks on Wikipedia?

DeepikaRay commented 7 years ago

This issue can come in scenarios where the source path provided in .html page doesn't match with the location of css files or css files are not available. You need to download the complete folder containing the .html and css files.Then it will work fine...

DeepikaRay commented 7 years ago

You can find the css files of targeted page with help of firebug or simply by inspecting the element with f12 key from keyboard..

hannesd commented 7 years ago

How are you exporting raw HTML? Are you using the swc-example-basic?

drewmutt commented 7 years ago

Thanks for the quick feedback. I tried scrapping the head from WP, but it's much too complicated as a lot of it is generated by PHP scripts. @hannesd Yes.

hannesd commented 7 years ago

Unfortunately sweble does not offer (wikipedia) css. I had a look at the sources and indeed the HTML template is including a screen.css file. That's misleading since there is no screen.css file :(

As far as I can tell the MediaWiki style sheets are GPL and therefore cannot be added verbatim to this project. If you have the time to write up a screen.css that imitates the Wikipedia's look&feel I'd be happy to accept a pull request!

drewmutt commented 7 years ago

Yep, you nailed the source of my confusion. I'll get on that CSS! Oh, and since I got you (and sorry this is a bit unrelated to my og question) I'm using this to show a "live preview" is there considerations I should take into account for performance? Like maybe I can just send the library diffs?

hannesd commented 7 years ago

I need a bit more context to answer this question. It's not clear to me what you mean by "library diff". Are you suggesting to run the parser on a diff instead of the full article? That would be quite difficult... Or are you worried about bandwidth when sending the rendered article?