Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Stephan Beal
On Wed, Apr 23, 2014 at 6:00 PM, Chad Perrin c...@apotheon.net wrote:

 Is there some way to check out the wiki and make edits as one would for
 standard repository files, to be committed like standard repository
 files, rather than always having to use a browser to edit the wiki?  I


Kinda of:

[stephan@host:~/cvs/fossil/libfossil]$ f help wiki
Usage: f wiki (export|create|commit|list) WikiName

Run various subcommands to work with wiki entries.

f wiki export PAGENAME ?FILE?

   Sends the latest version of the PAGENAME wiki
   entry to the given file or standard output.

f wiki commit PAGENAME ?FILE?

   Commit changes to a wiki page from FILE or from standard
   input.

f wiki create PAGENAME ?FILE?

   Create a new wiki page with initial content taken from
   FILE or from standard input.

f wiki list

   Lists all wiki entries, one per line, ordered
   case-insensitively by name.


you can use 'export' to export a page to a file, edit in emacs (won't work
with anything else ;), then use 'commit' to save the changes. Unfortunate
there's not a direct way to preview changes without saving unless you want
to use the JSON API (which provides preview feature for wiki text passed
to it).



 have searched through the fossil help -a documentation and tried
 searching the fossil-scm website to no avail, making me think this is
 probably not something possible with Fossil in its present form.


It is, but it's not quite like the embedded docs feature (which might be
a better fit for you, except that you lose the ability to edit over the
HTML interface).

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Stephan Beal
On Wed, Apr 23, 2014 at 6:04 PM, Stephan Beal sgb...@googlemail.com wrote:

 'commit' to save the changes. Unfortunate there's not a direct way to
 preview changes without saving unless you want to use the JSON API (which
 provides preview feature for wiki text passed to it).


If that feature would really help you, though, let me know - it would
likely take only 15 minutes to add fossil wiki preview INFILE ?OUTFILE?,
which takes a file as input, processes as wiki, and writes the processed
form to a new file or stdout.


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Chad Perrin
On Wed, Apr 23, 2014 at 06:04:18PM +0200, Stephan Beal wrote:
 On Wed, Apr 23, 2014 at 6:00 PM, Chad Perrin c...@apotheon.net wrote:
 
  Is there some way to check out the wiki and make edits as one would for
  standard repository files, to be committed like standard repository
  files, rather than always having to use a browser to edit the wiki?  I
 
 
 Kinda of:
 
 [stephan@host:~/cvs/fossil/libfossil]$ f help wiki
 Usage: f wiki (export|create|commit|list) WikiName
 
 Run various subcommands to work with wiki entries.
 
 f wiki export PAGENAME ?FILE?
 
Sends the latest version of the PAGENAME wiki
entry to the given file or standard output.
 
 f wiki commit PAGENAME ?FILE?
 
Commit changes to a wiki page from FILE or from standard
input.
 
 f wiki create PAGENAME ?FILE?
 
Create a new wiki page with initial content taken from
FILE or from standard input.
 
 f wiki list
 
Lists all wiki entries, one per line, ordered
case-insensitively by name.
 
 
 you can use 'export' to export a page to a file, edit in emacs (won't work
 with anything else ;), then use 'commit' to save the changes. Unfortunate
 there's not a direct way to preview changes without saving unless you want
 to use the JSON API (which provides preview feature for wiki text passed
 to it).

. . . so basically I need to list wiki pages to figure out what I want,
export a page, edit that, then commit it to overwrite what's already
there, one file at a time, rather than having a checked out directory of
wiki stuff I can just edit and commit as I would a normal set of
repository files.  Is that correct?

It seems cumbersome, but I'll see if it's so cumbersome that I'd rather
just use the HTML interface, or whether it actually suits my needs.


 
  have searched through the fossil help -a documentation and tried
  searching the fossil-scm website to no avail, making me think this is
  probably not something possible with Fossil in its present form.
 
 It is, but it's not quite like the embedded docs feature (which might be
 a better fit for you, except that you lose the ability to edit over the
 HTML interface).

I haven't really looked at the embedded docs thing yet to see whether
that's something I should be using, but I definitely need the wiki
interface for at least some projects, and would like to be able to edit
them in much the same way I can edit standard repository files, so the
embedded docs feature doesn't seem to solve all my problems in this
regard.

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Stephan Beal
On Wed, Apr 23, 2014 at 6:29 PM, Chad Perrin c...@apotheon.net wrote:

 . . . so basically I need to list wiki pages to figure out what I want,
 export a page, edit that, then commit it to overwrite what's already
 there, one file at a time, rather than having a checked out directory of
 wiki stuff I can just edit and commit as I would a normal set of
 repository files.  Is that correct?


Correct.


 It seems cumbersome


Correct.


 , but I'll see if it's so cumbersome that I'd rather
 just use the HTML interface, or whether it actually suits my needs.


Sounds like a plan. Suggestions are welcomed.

I haven't really looked at the embedded docs thing yet to see whether
 that's something I should be using, but I definitely need the wiki
 interface for at least some projects, and would like to be able to edit
 them in much the same way I can edit standard repository files, so the
 embedded docs feature doesn't seem to solve all my problems in this
 regard.


Embedded docs are normal repository files, You can edit them with emacs
(doesn't work with anything else ;) and preview them with fossil
server/ui using the path /doc/ckout/path/to/the/file (i think that's the
right path, anyway). But you can't edit them from the HTML interface (nor
the JSON API), largely because they _are_ normal files and thus are managed
using the normal commit mechanism (which requires a checkout, which remote
CGI/server instances normally do not have access to).

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Chad Perrin
On Wed, Apr 23, 2014 at 06:06:17PM +0200, Stephan Beal wrote:
 On Wed, Apr 23, 2014 at 6:04 PM, Stephan Beal sgb...@googlemail.com wrote:
 
  'commit' to save the changes. Unfortunate there's not a direct way to
  preview changes without saving unless you want to use the JSON API (which
  provides preview feature for wiki text passed to it).
 
 If that feature would really help you, though, let me know - it would
 likely take only 15 minutes to add fossil wiki preview INFILE ?OUTFILE?,
 which takes a file as input, processes as wiki, and writes the processed
 form to a new file or stdout.

If I understand correctly what you propose, I do not think I
particularly need that at this time.  I'm just looking for the ability
to edit markdown for wiki pages locally without having to fire up the
web interface (which might be especially important in cases where
locally happens to be via SSH on a remote system without X).  I should
probably consider whether (less gifted at correct spelling) other
contributors might need that, though.

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Chad Perrin
On Wed, Apr 23, 2014 at 06:36:38PM +0200, Stephan Beal wrote:
 On Wed, Apr 23, 2014 at 6:29 PM, Chad Perrin c...@apotheon.net wrote:
 
  . . . so basically I need to list wiki pages to figure out what I want,
  export a page, edit that, then commit it to overwrite what's already
  there, one file at a time, rather than having a checked out directory of
  wiki stuff I can just edit and commit as I would a normal set of
  repository files.  Is that correct?
 
 Correct.
 
 
  It seems cumbersome
 
 Correct.

That's . . . encouraging.


 
  , but I'll see if it's so cumbersome that I'd rather
  just use the HTML interface, or whether it actually suits my needs.
 
 
 Sounds like a plan. Suggestions are welcomed.
 
 I haven't really looked at the embedded docs thing yet to see whether
  that's something I should be using, but I definitely need the wiki
  interface for at least some projects, and would like to be able to edit
  them in much the same way I can edit standard repository files, so the
  embedded docs feature doesn't seem to solve all my problems in this
  regard.
 
 
 Embedded docs are normal repository files, You can edit them with emacs
 (doesn't work with anything else ;) and preview them with fossil
 server/ui using the path /doc/ckout/path/to/the/file (i think that's the
 right path, anyway). But you can't edit them from the HTML interface (nor
 the JSON API), largely because they _are_ normal files and thus are managed
 using the normal commit mechanism (which requires a checkout, which remote
 CGI/server instances normally do not have access to).

Okay, yeah, that'll be handy -- but not suitable for my need/desire to
make the wiki editable from the console (obviously), as I definitely
need to make wiki pages available for editing from the web interface as
well.  Does the embedded docs feature do markdown formatting?

Wait.  I'll go look at documentation so you don't have to start
answering questions that are easily answered by doing some research.

Oh, never mind, the embedded docs won't do me any good, because I use
FreeBSD, not GNU/Emacs.

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Stephan Beal
On Wed, Apr 23, 2014 at 6:50 PM, Chad Perrin c...@apotheon.net wrote:

 Okay, yeah, that'll be handy -- but not suitable for my need/desire to
 make the wiki editable from the console (obviously), as I definitely
 need to make wiki pages available for editing from the web interface as
 well.  Does the embedded docs feature do markdown formatting?


i _think_ embedded docs support all the same formatting as wikis. It
seems...

  if( fossil_strcmp(zMime, text/x-fossil-wiki)==0 ){
...
  }else if( fossil_strcmp(zMime, text/x-markdown)==0 ){

yes, it does.


 Wait.  I'll go look at documentation so you don't have to start
 answering questions that are easily answered by doing some research.


Too late.


 Oh, never mind, the embedded docs won't do me any good, because I use
 FreeBSD, not GNU/Emacs.


Then you're outta luck. Can't help there ;).

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Richard Hipp
On Wed, Apr 23, 2014 at 12:50 PM, Chad Perrin c...@apotheon.net wrote:


 Oh, never mind, the embedded docs won't do me any good, because I use
 FreeBSD, not GNU/Emacs.


???  What does your OS and editor choice have to do with anything?

-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Stephan Beal
On Wed, Apr 23, 2014 at 6:52 PM, Richard Hipp d...@sqlite.org wrote:

 On Wed, Apr 23, 2014 at 12:50 PM, Chad Perrin c...@apotheon.net wrote:


 Oh, never mind, the embedded docs won't do me any good, because I use
 FreeBSD, not GNU/Emacs.


 ???  What does your OS and editor choice have to do with anything?


He was just poking me back for always saying that the doc editing only
works with emacs (i've tried with vi, but just can't do it).

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Matt Welland
Here is a bash script that I use to edit wiki pages:

Just use it like this:

editwiki wikipagename

===
#!/bin/bash

wikiname=$1
FOSSILBIN=/usr/local/bin/fossil

if [ x$wikiname == x ];then
  echo Usage: viwiki wikipagename
  exit
fi

$FOSSILBIN sync

wikitmpfile=`mktemp /tmp/${USER}_wikiedit.XXX`
if ! $FOSSILBIN wiki export $wikiname 2 /dev/null  1 $wikitmpfile ;then
cat /dev/null  $wikitmpfile
wikipagestate='new'
else
wikipagestate='existing'
fi

if [ x$EDITOR == x ];then
EDITOR=gvim -f
fi

echo $EDITOR | grep -q -e gvim
isGvim=$?

echo $EDITOR | grep -q -e 'gvim.*-f'
hasF=$?

if [[ $isGvim == 0  $hasF != 0 ]]; then
EDITOR=$EDITOR -f
fi

$EDITOR $wikitmpfile

if [ $wikipagestate == 'new' ];then
  $FOSSILBIN wiki create $wikiname $wikitmpfile
else
  $FOSSILBIN wiki commit $wikiname $wikitmpfile
fi

$FOSSILBIN sync

rm -f $wikitmpfile



On Wed, Apr 23, 2014 at 9:06 AM, Stephan Beal sgb...@googlemail.com wrote:

 On Wed, Apr 23, 2014 at 6:04 PM, Stephan Beal sgb...@googlemail.comwrote:

 'commit' to save the changes. Unfortunate there's not a direct way to
 preview changes without saving unless you want to use the JSON API (which
 provides preview feature for wiki text passed to it).


 If that feature would really help you, though, let me know - it would
 likely take only 15 minutes to add fossil wiki preview INFILE ?OUTFILE?,
 which takes a file as input, processes as wiki, and writes the processed
 form to a new file or stdout.


 --
 - stephan beal
 http://wanderinghorse.net/home/stephan/
 http://gplus.to/sgbeal
 Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
 those who insist on a perfect world, freedom will have to do. -- Bigby Wolf

 ___
 fossil-users mailing list
 fossil-users@lists.fossil-scm.org
 http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users




-- 
Matt
-=-
90% of the nations wealth is held by 2% of the people. Bummer to be in the
majority...
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Stephan Beal
On Wed, Apr 23, 2014 at 6:53 PM, Matt Welland estifo...@gmail.com wrote:

 EDITOR=gvim -f


Missing quotes?

[stephan@host:~/cvs/fossil/fossil/src]$ EDITOR=gvim -f
ec-f: command not found

But this works:

[stephan@host:~/cvs/fossil/fossil/src]$ EDITOR=emacs
[stephan@host:~/cvs/fossil/fossil/src]$ ;)

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Matt Welland
On Wed, Apr 23, 2014 at 9:55 AM, Stephan Beal sgb...@googlemail.com wrote:

 On Wed, Apr 23, 2014 at 6:53 PM, Matt Welland estifo...@gmail.com wrote:

 EDITOR=gvim -f


 Missing quotes?

 [stephan@host:~/cvs/fossil/fossil/src]$ EDITOR=gvim -f
 ec-f: command not found

 But this works:

 [stephan@host:~/cvs/fossil/fossil/src]$ EDITOR=emacs
 [stephan@host:~/cvs/fossil/fossil/src]$ ;)


Ha! Good catch. I think we all here have $EDITOR set and so that line has
never been exercised :)



 --
 - stephan beal
 http://wanderinghorse.net/home/stephan/
 http://gplus.to/sgbeal
 Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
 those who insist on a perfect world, freedom will have to do. -- Bigby Wolf

 ___
 fossil-users mailing list
 fossil-users@lists.fossil-scm.org
 http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users




-- 
Matt
-=-
90% of the nations wealth is held by 2% of the people. Bummer to be in the
majority...
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Martin Gagnon
On Wed, Apr 23, 2014 at 06:53:04PM +0200, Stephan Beal wrote:
 On Wed, Apr 23, 2014 at 6:50 PM, Chad Perrin c...@apotheon.net wrote:
 
 Okay, yeah, that'll be handy -- but not suitable for my need/desire to
 make the wiki editable from the console (obviously), as I definitely
 need to make wiki pages available for editing from the web interface as
 well.  Does the embedded docs feature do markdown formatting?
 
 
 i _think_ embedded docs support all the same formatting as wikis. It seems...
 
   if( fossil_strcmp(zMime, text/x-fossil-wiki)==0 ){
 ...
   }else if( fossil_strcmp(zMime, text/x-markdown)==0 ){
 
 yes, it does.

Of course, I always use markdown and raw html on my embedded docs. Just
need to use proper file extension: .md for markdown or .wiki for
fossil wiki etc...

And when you edit with your local editor, you can visualize your change
before commit using fossil ui and pointing your browser to
http://localhost:8080/doc/ckout/../path/to/file.md

Just need to press F5 after you save so see the change right away.. 

It's not quite like editing it on web browser directly, but it's even
better for me because I prefer to edit text with a real editor.

[snip]


Regards,

-- 
Martin G.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Stephan Beal
On Wed, Apr 23, 2014 at 7:10 PM, Martin Gagnon eme...@gmail.com wrote:

 And when you edit with your local editor, you can visualize your change
 before commit using fossil ui and pointing your browser to
 http://localhost:8080/doc/ckout/../path/to/file.md


Nice tip - i never thought of that (or had forgotten it) for previewing
wiki pages.

@Chad:

fossil export PageName foo.wiki

then visit your local server with the path /doc/ckout/foo.wiki

that should do the trick.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Chad Perrin
On Wed, Apr 23, 2014 at 12:52:36PM -0400, Richard Hipp wrote:
 On Wed, Apr 23, 2014 at 12:50 PM, Chad Perrin c...@apotheon.net wrote:
 
 
  Oh, never mind, the embedded docs won't do me any good, because I use
  FreeBSD, not GNU/Emacs.
 
 
 ???  What does your OS and editor choice have to do with anything?

There's an old joke about Emacs, that It's a nice operating system, but
it lacks a decent editor. [1]

He kept bringing up the (obviously tongue-in-cheek) idea that his
solutions only work with Emacs, so I finally pointed out that I'm using
a different operating system than him.  Just a joke back for a joke he
was making.  Sorry about the confusion.

NOTES:

1. I actually think that joke about Emacs is terribly unfair.  It comes
with a great editor, called Viper Mode.

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] wiki edits outside HTML UI

2014-04-23 Thread Stephan Beal
1) lol!

2) wikis are stored completely differently. It would possibly be less work
to add online edit to embedded docs (currently has the problem of needing a
checkout, but that is one of the things libfossil aims to make possible).

(sent from a mobile device - please excuse brevity, typos, and top-posting)
- stephan beal
http://wanderinghorse.net
On Apr 23, 2014 9:19 PM, Chad Perrin c...@apotheon.net wrote:

 On Wed, Apr 23, 2014 at 07:22:20PM +0200, Stephan Beal wrote:
  On Wed, Apr 23, 2014 at 7:10 PM, Martin Gagnon eme...@gmail.com wrote:
 
   And when you edit with your local editor, you can visualize your change
   before commit using fossil ui and pointing your browser to
   http://localhost:8080/doc/ckout/../path/to/file.md
 
 
  Nice tip - i never thought of that (or had forgotten it) for previewing
  wiki pages.
 
  @Chad:
 
  fossil export PageName foo.wiki

 Ah, now I see why it only works on Emacs for you.  On FreeBSD+nvi this
 works:

 fossil wiki export PageName foo.wiki


 
  then visit your local server with the path /doc/ckout/foo.wiki
 
  that should do the trick.

 Actually, I think I'll probably just use a wiki directory within the
 project's base directory, check out files there, and commit them to the
 main repository, as a workaround for making it possible to edit the wiki
 as part of the main repository.  There just needs to be a checkout from
 the wiki every time before editing, then a double-check to make sure
 someone hasn't changed the wiki again before importing the file contents
 back into the wiki.

 I'd really like to see the possibility of edit race conditions
 eliminated, of course, but I don't see a good way to do that without
 making it possible to either have a separate wiki checkout complete with
 merge and all the trimmings or integrate the wiki directly with the main
 check-out-able repository.  Is there any chance of such a feature being
 added in the nearish future . . . ?

 --
 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
 ___
 fossil-users mailing list
 fossil-users@lists.fossil-scm.org
 http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users