Convert a HTML site into a Wiki - html

I have a basic HTML site (No JavaScript, PHP or CSS) that I would like to turn into a Wiki. The site has over 1000 pages. I would like the converter to take the contents of each page, and place the content into a its own newly created wiki page. I also need all the links to be converted as well. I would prefer to use MediaWiki, but any wiki software would do.
Does anyone know of a way to do this?

IIRC Reimar Bauer has written some tool to recover MoinMoin 1.9.x contents from html content on archive.org. Maybe you can slightly modify that for your purpose.
But be aware that that was made to convert html that was MADE by moin, maybe rather not arbitrary html. But if you html is simple, it might be worth trying.
Another idea (maybe needing a bit more research and coding) is to use the post url that is used by the gui editor of moin. It expects xhtml there and will try to convert that to moin wiki markup. You can also do a first try interactively by just copy&pasting your html to the gui editor of moin. But be aware that browsers do a sanitizing step (convert html to valid xhtml) that is not present if you just post (not well-formed) html to the post url.

Related

url link preivew for html textarea

I am currently trying to implement a textarea in html for entering url links. When a user types in a url and press enter, a link preview should come up just like in Facebook. I am quite sure there would be some kind of plugins or pre-built tool that I can use for such functionality, but I am not sure where to look for. Can someone give me an advice on how to make this work? Thank you.
Facebook accomplishes this behaviour by using the Open Graph Protocol. For it to work properly, your target site does need to have the specific Open Graph meta tags like og:title defined (you can find the complete documentation on the page).
If you scroll down to Implementations you will find parsers for those Open Graph meta tags written for different programming languages like PHP or Ruby. However, you will most certainly not be able to parse the needed information with plain html.

Beautifying HTML with JSP mixed in

Does anyone know of an HTML beautifier that can deal with (or at least ignore) JSP? I've searched high and low... I'm not looking for an HTML validator, just something that can format the file decently (i.e. indentation).
Most good IDE's will let you say which code template to use as default within another file extension.
So i use PHPstorm in which i can say, for example that a *.jsp will use html first and then jsp. This way the page will display and reformat my code with the correct spacings and what not.
Worth looking into which IDE you are using, assuming you're using one :)

Splitting up a html page and loading it through header?

I am using HTML5, and would like to speed up the creation and editing of my standard HTML template by splitting it into three separate HTML files.
header.html
content.html (this will be edited and will have other names e.g. home)
footer.html
I have looked at the following resources, but I am not sure if this is possible or how to go about it.
http://www.w3schools.com/html/html_head.asp
http://www.w3schools.com/tags/tag_link.asp
In PHP I would just include the files in the right order. Is there an equivelant in just a plain HTML site?
I have googled this, but I don't think Im searching for the right term. I would appreciate any information, or resources available!
Thanks for your time!
For just a static HTML site, there is no html-only way to include files the way you are trying to. You may be able to use server-side includes depending on your server, but by that point, you might as well just use PHP.
Another option would be to make extensive use of Javascript to load the page pieces after the main part of the page is already loaded.
In all cases, though, you will have a major reduction in performance, since a server request is slow. If you need to use templates, just use a dynamic language like PHP.
You can't do it cleanly with HTML. You could use iFrames, but that's far from clean. The optimal solution would be to use PHP. It will also save you the requests from the browser.
You can do it via include files in SHTML or through some server-side processing which can combine the files into one HTML output stream when a user requests the URL. Standard HTML isn't processed on the server so you'll need to use some server-side technology such as .NET, ASP, PHP, CGI, etc.
There is no way to do this with plain HTML. You could do it using JavaScript to load the different pages into their place after loading the main page. But that seems somewhat stange and unnecessary.
The easiest way that I know how to do this is to use a Model-View-Controller (MVC) style framework of some sort. I would use CodeIgniter, which is created with PHP. It's light (2.1 is VERY fast), has incredible documentation, is super easy to understand (even if you don't know much about PHP), creates clean URIs, and will allow you to build dynamic websites (which is what you're wanting to do) with great ease. Your separate pages (called "views" in MVC terminology) will be able to load in the order you choose; in as many controller methods as you need. It's fantastic!
The following are some resources that will help explain what I'm talking about:
CodeIgniter User Guide - Model-View-Controller:
http://codeigniter.com/user_guide/overview/mvc.html
CodeIgniter User Guide - Views
http://codeigniter.com/user_guide/general/views.html
Here are some resources to help you get started with CodeIgniter:
CodeIgniter User Guide:
http://www.codeigniter.com/user_guide
CodeIgniter From Scratch Series by Nettuts+:
http://net.tutsplus.com/sessions/codeigniter-from-scratch/
Here are some resources that you may want if you need to learn more about PHP to start:
http://www.php.net
http://net.tutsplus.com/tutorials/php/the-best-way-to-learn-php/
I hope this helps, and let me know if you need any more help or a clearer explanation. Good luck!
The question is what kind result are you expect? Your question looks like you don't have experience but you feel that is something wrong with your architecture. Do you need it for any bigger webpage or for something smaller? Try to find any CMS and it will have solution to make your work more clear:) If you want to make any experiments, start from begin. You can have one layout and more content files. If your website is simple try with
<body><div>header</div><div><?php include('content'.addslashes($_GET['id']).'.php') ?></div>
<div>footer</div></body>
Don't use iframe, this is deprecated solution:)
In HTML5, you can embed (but not include) HTML documents with the object element, with the iframe element, and with the embed element.
<object data="include-me.html" type="text/html"><!-- fallback content --></object>
<iframe seamless src="include-me.html"></iframe>
<embed src="include-me.html" type="text/html"></embed>
embed
Using embed might be a bit shaky, not least because it’s intended "for an external (typically non-HTML) application or interactive content". When it doesn’t render the HTML document, try to remove the type attribute (at least it then worked in Chromium).
iframe
Using iframe might work for you in combination with the seamless attribute (beware of browser support). The HTML5 (CR) spec has an example:
An HTML inclusion is effected using this attribute as in the following example. In this case, the inclusion is of a site-wide navigation bar.
<!DOCTYPE HTML>
<title>Mirror Mirror — MovieInfo™</title>
<header>
<h1>Mirror Mirror</h1>
<p>Part of the MovieInfo™ Database</p>
<nav>
<iframe seamless src="nav.inc"></iframe>
</nav>
</header>
...
object
The HTML5 (CR) spec has an example:
In this example, an HTML page is embedded in another using the object element.
<figure>
<object data="clock.html"></object>
<figcaption>My HTML Clock</figcaption>
</figure>

WYSIWYG HTML editor for grails gsp files

Does anyone know about a good HTML editor which can be configured in such a way that it is gsp aware?
What I mean is that at least tags such as <g:link> and <g:input> should be displayed as their html equivalent.
Yes I know: a perfect editor is hard to write and it is easier to edit the HTML sources (that's what I do), but there are people who prefer an HTML editor...
Update: yes, I am looking for a WYSIWYG HTML editor with which I can drag'n'drop some html elements to a page without changing the <g:...> tags which might already be contained in the page. In addition, this editor should have some gsp awareness, so that <g:...> tags are displayed in an appropriate way.
Update: still looking for something, so I started a bounty. What I need is something like this plugin: http://code.google.com/p/grails-form-builder-plugin/ but more evolved...
Bounty: not easy to select the right answer for the bounty. None of the answers is a solution to my problem, but I have decided that rschlachter points me in the right direction: a wysiwyg form editor is not the right solution for a developer...
I think there may be a flaw in the process here. You could build the page first in HTML and make any changes there before putting in any gsp elements. While the page is in HTML format people can continue to use WYSIWYG editors and then developers can add in the grails functionality.
It just seems like if you need/want to use a WYSIWYG editor, you shouldn't be modifying a gsp.
The iterations I prefer to use after I have gathered requirements are:
wireframe
mockup
html
gsp
If the gsps are already there (ie you inherited the project or something) you could go back a step and create an html only version of the page by pulling the gsp elements out and putting in images of them or replacing them with their html equivalents.
the IBM Maqetta Project seems to be going in the right direction:
http://maqetta.org/
Mercury editor might be worth looking at too.
http://jejacks0n.github.com/mercury/
There is one more editor that you might want to look at:
Aloha Editor - http://www.aloha-editor.org/
Orbeon can be an option
http://www.orbeon.com/orbeon/home/
Might be able to do this with TinyMCE by configuring the valid_elements or the extended_valid_elements (docs). For example, if you want to replace <g:link> and <g:input> you would do something like:
tinyMCE.init({
valid_elements : "a/g:link,input/g:input"
});
OR If you want to simply enable the additional elements, then you could do something like:
tinyMCE.init({
extended_valid_elements : "g:link,g:input"
});

How do I create some HTML help pages, with the same content at the top and bottom, without php or ASP etc?

I want to create some html help pages, separate html pages.
However, I want to have the same content on the top and bottom of the pages.
In the past I've used PHP or ASP, with header and footer files.
I've then had to do view source and save these pages to get what I want.
I just wondered if there an easiest way to do this ?
EDIT:
The pages are for use with software using a web object not a normal browser. So there won't be a web server
If your web server supports it, you could do server side includes
You could use frames, but it's not necessarily advisable (for one, it breaks navigation).
You could use XML files with an XSLT stylesheet to turn them into HTML documents that share similar elements.
You could use PHP or another server-side language to generate the pages, and then use a recursive download tool (such as wget) to turn them into HTML.
EDIT: you're basically asking whether the "standard-ish" subset of HTML supported by your component of choice provides a way of including data from a common file, just so you won't have to include the data in every HTML document.
The answer hovers somewhere between "no way" and "maybe your component has a few tricks to do that".
The sane thing to do here would be to have a tool generate the HTML documents from a common template. Could be XML + XSLT, PHP/ASP/whatever, or a fully-fledged CMS (this actually helps let non-technical users write the document contents).
It's awful, but you could include a JS file that uses a bunch of document.write("...") to include common elements. Not SEO friendly.