Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Open Source Projects
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Open Source Projects The place to discuss Basic4ppc open source applications.


Personal Pocket PC Wiki


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-01-2008, 12:53 PM
Senior Member
 
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 128
Send a message via MSN to tsteward
Default Personal Pocket PC Wiki

I have started creating a Personal Wiki.
I decided to post it here under Open Source so all can use this program if they wish, but PLEASE post any improvements you make here.

Goals
  • Must run on both Desktop and PDA
  • Must support current BladeWiki syntax (for now)
It is currently only just the beginning and I am no programmer, just a hack. So anyone wishing to correct my coding or show me a better way then I am all ears.

This program is really coming along now. Thanks to Digitaldon37 and Klaus for there help. Thanks to agraham for his Web Browser.

I use this wiki for everything now. I organise my work documentation, instructions sheets, Product pictures and descriptions. Have Birthday lists, XMas card lists, Bank details. It is great for gathering all you info in one place.

I have bucked what seems to be the standard and included all library files in the zip. I just think its easier.

Regards
Tony Steward

Last Updated 8:00pm 29th Nov 2008
Attachment includes both PPC and Desktop versions.
You will need to add "System.Data.SQLite.dll" its not in the zip because its too large
Attached Files
File Type: zip personal_ppc_Help.zip (49.5 KB, 12 views)
File Type: zip Wiki081.zip (276.0 KB, 15 views)

Last edited by tsteward : 11-29-2008 at 09:04 AM.
Reply With Quote
  #2 (permalink)  
Old 08-01-2008, 12:54 PM
Senior Member
 
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 128
Send a message via MSN to tsteward
Default Reserved Progress Report

8 Aug 2008
Most Bladewiki markup is now supported with the exceptions below.

To Do:

1. Finish Blade markup - should be 100% compatible with Blade Wiki - I am starting to waver on this. I'm thinking it should be able to read bLade but I have added features that blade does not have. After all the reason I have gone to all this trouble was to get the features I wanted.
1.1 Create links to other wiki's
1.2 Create links to page sections

2. Make use whole screen on desktop
3. Create export to HTML routine
4. Create "Open File(wiki)" to support multiple top level wikis - Done with exception to 1.1
5. Create import HTML to convert HTML pages into wiki pages.

Last edited by tsteward : 08-27-2008 at 07:16 AM.
Reply With Quote
  #3 (permalink)  
Old 08-01-2008, 01:00 PM
Senior Member
 
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 128
Send a message via MSN to tsteward
Default

Struggling with the interpreter for reading in bladewiki files, but getting there slowly.

Currently I load a line from the file then process that line character by character to find the markup.

+ = <h1> Header Level 1
++ = <h2> Header Level 2
- = <li> list item
[ = Start of link to another file
] = end of link to another file

There is more but that's enough for now.

Here is my interpreter so far.
Code:
Sub GetFile(file)
 file = ProgDir & file
 If FileExist (file) = true Then
  FileOpen (c1,file,cRead ,, cASCII)
   HtmStr = "<html><head><meta http-equiv=" & Chr(34) & "Content-Type" & Chr(34) & " content=" & Chr(34) & "text/html; charset=utf-8" & Chr(34) & ">" & crlf
   HtmStr = HtmStr & "<title>homepage</title>" & crlf
   HtmStr = HtmStr & "<link rel=" & Chr(34) & "stylesheet" & Chr(34) & " href=" & Chr(34) & "file:///" & ProgDir & "wikistyle.css" & Chr(34) & " Type=" & Chr(34) & "text/css" & Chr(34) & ">" & crlf
   HtmStr = HtmStr & "</head><body>" & crlf
   line = FileRead (c1)
   Do Until line = EOF
    If line <> EOF Then                   ' START PROCESSING LINE
                 For i = 0 To StrLength(line)-1
                     If i = 0 AND bullet = True Then     ' CHECK TO SEE IF WE SHOULD END BULLET LIST
                         HtmStr = HtmStr & "</ul>"
                            bullet = False
                        End If
      If i = 0 AND SubString(line, i, 2) = "++" Then ' START HEADER LEVEL 2
                         If header2 = False Then
                          header2 = True
        HtmStr = HtmStr & "<h2><a name=" & Chr(43) & currentpage & Chr(34) & ">"
                            End If
                        Else If i = 0 AND SubString(line, 0, 1) = "+" Then ' START HEADER LEVER 1
                         If header1 = False Then
                          header1 = True
        HtmStr = HtmStr & "<h1><a name=" & Chr(43) & currentpage & Chr(34) & ">"
                            End If
                     Else If i = 0 AND SubString(line, 0, 1) = "-" Then 
                      If bullet = False Then                  ' START BULLET LIST
                          bullet = True
                                HtmStr = HtmStr & "<ul><li>"
                         Else                                    ' CONTINUE BULLET
                          HtmStr = HtmStr & "<li>"
                         End If
                        Else
                         If i = 0 Then
                             HtmStr = HtmStr & "<p>"                ' START PARAGRAPH
                                paragraph = True
                            End If
                         HtmStr = HtmStr & SubString(line, i, 1)
      End If
                    Next                                 ' FINNISHED LINE NOW TIDYUP BEFORE NEXT LINE
    End If
                If header1 = True Then                ' CLOSE HEADER 1
                 header1 = False
                    HtmStr = HtmStr & "</a></h1>" & crlf
                End If
                If header2 = True Then                ' CLOSE HEADER 2
                 header2 = False
                    HtmStr = HtmStr & "</a></h2>" & crlf
                End If
                If paragraph = True Then              ' CLOSE PARAGRAPH
                 paragraph = False
                 HtmStr = HtmStr & "</p>"
    End If
                HtmStr = HtmStr & crlf                ' ADD LINE FEED TO MAKE SOURCE CLEAN
    line = FileRead (c1)
   Loop
  FileClose (c1)
  Return HtmStr
 End If
End Sub
Reply With Quote
  #4 (permalink)  
Old 08-01-2008, 06:03 PM
Knows the basics
 
Join Date: Jan 2008
Posts: 84
Default wiki parser

Hi Tony,

I noticed that you are reading the wiki file one line at a time. There are some pros and cons to that, but my opinion is that you may want to read the whole file at once and then parse. The reason is that you don't have to write the wiki text with the closing tags all on one line.

I created two new procedures that you may want to look at

Read File
Code:
Sub ReadWikiFile(file)
	file = ProgDir & file
	If FileExist (file) = true Then
		FileOpen (c1, file, cRead ,, cASCII)
		wiki = FileReadToEnd(c1)
		FileClose (c1)
		
		Return ParseWiki(wiki)

	Else
	' wiki file doesn't exist - how did that happen?
	End If
End Sub
Parser
Code:
Sub ParseWiki (wiki)
	'HTML Header
	HtmStr = "<html><head><meta http-equiv=" & Chr(34) & "Content-Type" & Chr(34) & " content=" & Chr(34) & "text/html; charset=utf-8" & Chr(34) & ">" & crlf
   	HtmStr = HtmStr & "<title>homepage</title>" & crlf
   	HtmStr = HtmStr & "<link rel=" & Chr(34) & "stylesheet" & Chr(34) & " href=" & Chr(34) & "file:///" & ProgDir & "wikistyle.css" & Chr(34) & " Type=" & Chr(34) & "text/css" & Chr(34) & ">" & crlf
  	HtmStr = HtmStr & "</head><body>" & crlf

	For x=0 To StrLength(wiki)
		
	
		schr=SubString(wiki,x,1)
		' Msgbox(schr)
		
		' --- CONVERT SIMPLE SINGLE CHARACTERS ---
		If schr=" " Then
			HtmStr=HtmStr & "&nbsp;"
		End If
		If schr=Chr(13) Then
			HtmStr=Htmstr & "<br>"
		End If
		
		' --- CONVERT LINK ---
		Select schr
			Case "["
		'If schr="[" Then
			If SubString(wiki,x+1,1)="[" Then ' this is reference with differnt text ie [[wiki][welcome to my wiki!]]
				
			End If
			y=StrIndexOf(wiki, "]", x)
			'Msgbox(x & " " & y)
			HtmStr=Htmstr & "<a href='" & SubString(wiki,x+1,y-x-1) & "'>" & SubString(wiki,x+1,y-x-1) & "</a>"
			' Msgbox(SubString(wiki,x+1,y-x-1))
			'Msgbox(htmstr)
			x=y
		'End If
		
		Case Else
			HtmStr=HtmStr & schr
		End Select
	Next
	
	'HTML FOOTER
	HtmStr=HtmStr & "</body></html>"
	
	
	Return Htmstr
End Sub
This was tested on your sample wiki text and it creates links out of the "[text]" markups. It still needs a lot of work but it's an example.

Last edited by digitaldon37 : 08-01-2008 at 06:24 PM.
Reply With Quote
  #5 (permalink)  
Old 08-02-2008, 12:17 AM
Senior Member
 
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 128
Send a message via MSN to tsteward
Default

Yes I agree reading the whole file at once would be better and generally speeds up programs and is usually less drain on resources.

Thanks for that code suggestion I'll look at it. It seems less confusing than what I did.
Reply With Quote
  #6 (permalink)  
Old 08-02-2008, 02:57 AM
Senior Member
 
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 128
Send a message via MSN to tsteward
Default

Damn
Ok we need to work on a way to communicate on who is doing what.
I have a version working beautifully on my desktop but not running on ppc.
I haven't looked at your code above yet but will do so.
Have to go out for the day will do more tonight. about 6 hrs time

Thanks
Tony

This is where I was up to (your changes not included yet)
Attached Files
File Type: sbp wiki.sbp (7.4 KB, 10 views)
Reply With Quote
  #7 (permalink)  
Old 08-02-2008, 09:25 AM
Senior Member
 
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 128
Send a message via MSN to tsteward
Default

Ok the error causing PPPCWiki not to run on ppc is:
Code:
HtmStr = HtmStr & "<link rel=" & Chr(34) & "stylesheet" & Chr(34) & " href=" & Chr(34) & "file:///" & ProgDir & "wikistyle.css" & Chr(34) & " Type=" & Chr(34) & "text/css" & Chr(34) & ">" & crlf
I'm not really sure why
Its around line 56, just comment it out and all is fine but of course the css won't be working.
Reply With Quote
  #8 (permalink)  
Old 08-02-2008, 01:08 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by tsteward View Post
Damn
Ok we need to work on a way to communicate on who is doing what.

Tony
I would suggest you to subscrive to an Web based project Share space....
I havent search for one, but i'm sure that they are available, and mos surelly, for free too...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #9 (permalink)  
Old 08-02-2008, 02:11 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Found this one:
Online project management & collaboration - software as a service
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #10 (permalink)  
Old 08-02-2008, 09:12 PM
Knows the basics
 
Join Date: Jan 2008
Posts: 84
Default works on desktop, not on pda

Tony,

I've tried everything I can think of - this works on my PC but I get an "invalid address" on the PDA. I've written and rewritten the web_navigating procedure and get the same results.

Is this working on your PDA?

Don
Attached Files
File Type: sbp wiki.sbp (10.2 KB, 12 views)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Another Pocket Wiki digitaldon37 Open Source Projects 1 09-17-2008 11:01 AM
Written a Personal Wiki? tsteward Questions & Help Needed 3 08-01-2008 05:34 AM
Pocket Chess Database JamesC Share Your Creations 3 07-27-2008 05:07 AM
B4P Wiki meinewelle Questions & Help Needed 5 05-30-2008 07:55 AM
print class for pocket pc tanrikuluahmet Basic4ppc Wishlist 1 10-01-2007 10:10 AM


All times are GMT. The time now is 04:43 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0