Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 May 2013, 02:45
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
offline Wiki?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
mahaju


Joined: 11 Oct 2010
Posts: 455
Location: between the keyboard and the chair

PostPosted: Thu 22 Dec 2011, 11:13    Post subject:  offline Wiki?
Subject description: Something like an offlike wiki for source code?
 

Hello everyone,
I recently learned how to edit a wiki and wikipedia article
It is very easy to edit any given article, but what is more fascinating is that you can also compare between the various versions of the article between edits
The wiki software highlights where the differences are, so it is much easier to see which part has been changed. What I want to know is whether there is some software that allows me to do this offline with different versions of source code, showing all the syntax highlight, as well as allowing to compare between edits easily

I think something like that would be very helpful. Any ideas anyone?

thanks
Back to top
View user's profile Send private message 
big_bass


Joined: 13 Aug 2007
Posts: 1736

PostPosted: Thu 22 Dec 2011, 12:34    Post subject:  

there is also tkdiff
and Xdiff these have more features but I like DragNdrop better

something simple and light is just use diff

this is what I use all the time to view differences in code
its one of my many homemade tools
Joe


Code:

#!/bin/sh

# version 2 changed to *.patch
# just a simple diff tool for the lazy
# there are better but this is easy :D
# Joe Arose
# call this dnd_diff
# patched are auto made for you
DIALOG=Xdialog

$DIALOG --title "The original for DIFF   " \
        --inputbox "Type in a value or Drag N drop.
         enter first file to diff now
        the name will be given from the this file.patch
        and placed in root\n
" 0 0  2> /tmp/one.txt

retval=$?



input=`cat /tmp/one.txt`


case $retval in
  0)
    echo "Input string is '$input'";;
  1)
    echo "Cancel pressed."
    exit;;
  255)
    echo "Box closed."
    exit;;
esac

#----------------------------------
$DIALOG --title "The edited file for DIFF   " \
        --inputbox "Type in a value or Drag N drop.
        you enter second file to diff now\n
" 0 0 2>/tmp/two.txt

retval=$?

input2=`cat /tmp/two.txt`

case $retval in
  0)
    echo "Input string is '$input2'";;
  1)
    echo "Cancel pressed."
    exit;;
  255)
    echo "Box closed."
    exit;;
esac

diff -pruN $input $input2 >/root/`basename $input`.patch

#or you could do this if you have another editor installed
$DEFAULTTEXTEDITOR  /root/`basename $input`.patch

#geany is the default editor change this if you have another editor
#geany /root/`basename $input`.patch

rm -f /tmp/two.txt
rm -f /tmp/one.txt

_________________
slackware 14
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 1758

PostPosted: Thu 22 Dec 2011, 13:52    Post subject:  

Using a wiki to write/edit source code would be a bad idea because of the syntax restraints -you'd have to write pages of code which are not really code, but made to llok like code when displayed on the wiki page.

The real main program for comparing code is 'diff' -tkdiff and many other GUI diff programs usually rely on diff itself to do the work. Using diff allows you to directly edit the real code (as written for the compiler/interpretor) without having to make any cosmetic changes.

If you are intending to write and maintain a project, then what you really want is called a Version Control System -like CVS, SVN/subversion or 'git'. There are many others, but git it probably the best and most commonly used. The linux kernel (which contains thousands of files and millions of lines of code) is maintained using 'git'.
Back to top
View user's profile Send private message 
mahaju


Joined: 11 Oct 2010
Posts: 455
Location: between the keyboard and the chair

PostPosted: Fri 23 Dec 2011, 00:57    Post subject:  

Thank you for your replies
I am using TortoiseHg for my work in my Windows 7 machine
I am still learning about all it's features, but it seems to provide features for much of what I need to do
However I will also need something similar for Puppy Linux 5.2.8 later on so I'm searching for some ideas

amigo wrote:
Using a wiki to write/edit source code would be a bad idea because of the syntax restraints -you'd have to write pages of code which are not really code, but made to llok like code when displayed on the wiki page.
...

If you are intending to write and maintain a project, then what you really want is called a Version Control System -like CVS, SVN/subversion or 'git'. There are many others, but git it probably the best and most commonly used. The linux kernel (which contains thousands of files and millions of lines of code) is maintained using 'git'.


I am not actually storing it in a wiki, I was just trying to describe what kind of feature I was looking for
As you suggested I have acquired a version control system called TortoiseHg and I am trying out it's features right now
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 3843

PostPosted: Fri 23 Dec 2011, 06:43    Post subject:  

there are quite a few hg/mercurial frontends for pretty much every OS imaginable, but if you aren't already familiar with it, I would also recommend fossil as it is quite easy to learn (Barry is now using it for woof)

hg/git/svn are still better for larger projects with many developers, but for basic operations (and some things the others dont have, like bug tracking, wiki, self-hosting web server... in a much smaller package even) its really nice.

_________________
Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0578s ][ Queries: 12 (0.0131s) ][ GZIP on ]