claudioc / jingo

Node.js based Wiki
MIT License
1.02k stars 184 forks source link

Start jingo wiki using files from old (existing) site #71

Closed richb-hanover closed 9 years ago

richb-hanover commented 9 years ago

I have an old static site that desperately needs editing. It has about 100 HTML pages in it, so I don't want to re-type them. I think it would be interesting to employ the power of a wiki to allow the community to fix the site.

Can you recommend a straightforward method of taking those pages and introducing them into jingo so that I can continue to edit them?

(I am prepared to do a bunch of mass text processing to remove , , etc. to strip out stuff that jingo won't want to deal with...)

claudioc commented 9 years ago

Hi,

nice use case you have! Mmmh... I am pretty sure you can use plain HTML inside the documents, so I think that you just try feeding Jingo those documents as-they-are and see what happens.

The other option is to convert the documents to Markdown. I'd take a look a this thing here: https://github.com/xijo/reverse_markdown or Pandoc http://talk.commonmark.org/t/is-a-reverse-conversion-html-to-markdown-possible/899

richb-hanover commented 9 years ago

Yes, Pandoc or reverse_markdown could be very helpful at stripping out the HTML and getting to basic markdown text.

But that wasn't the important part of my question:

I have the sense (from reading the documentation) that all the markdown files are contained into a github repo. It's clear that if I start with an empty repo, I can use the web GUI to create and enter pages.

But I already have a bunch of files. Can I simply drop those files into that local repo and have jingo process them as if I'd entered them manually?

claudioc commented 9 years ago

Ah, sorry for the misunderstanding!

You can definitely do what you need. Github is not needed at all: if you want to push your document repository somewhere, then you'll have to configure jingo to use that remote via the remote configuration key. The only thing which is really needed is a valid git repository full or empty, it doesn't matter.

This is how you can do that.

Before starting Jingo, I created a directory and put some markdown documents in it (this directory is where the repository config key needs to point to).

First, you need to initialise the repository with git init. At this point, this is what I see:

claudioc@tiburon:~/D/jingo_test (master)$ git st
?? Bureaucracy.md
?? Coding-guidelins-for-Node.js.md
?? Google-Closure-coding-guidelins.md
?? How-to---Write-a-Soy-helper.md
?? How-to-Install-for-local-development.md
?? Include-a-template-in-another-template.md
?? The-Hello-World-example-with-V10.md
?? V10-Routing.md
?? Write-and-use-a-new-soy-template.md
?? cg-google-closure.md
?? v10-links.md

You need a Home.md file so that when you start Jingo it will use that file and doesn't complain about missing documents. I create the home file just with the content of the directory.

claudioc@tiburon:~/D/jingo_test (master)$ ls > Home.md

Now we are ready to add the files and commit. No push is needed.

claudioc@tiburon:~/D/jingo_test (master)$ git add .
claudioc@tiburon:~/D/jingo_test (master)$ git commit -m "First import"

Now you can start jingo, and you'll see the list of files (the Home.md we created) and you can start editing them (of course, some edits will be needed).

Hope this helps!