From bff92e38909363ee11f3c24ee230f8ee373cfd67 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 Mar 2008 17:47:43 -0500 Subject: [PATCH 01/12] web commit by ManojSrivastava --- doc/rcs/git.mdwn | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/doc/rcs/git.mdwn b/doc/rcs/git.mdwn index bff322d5a..cefa649ff 100644 --- a/doc/rcs/git.mdwn +++ b/doc/rcs/git.mdwn @@ -47,10 +47,15 @@ repositories: repositories will push to/pull from. It is a bare repository, since there are problems pushing to a repository that has a working directory. This is called _repository_ in [[ikiwiki-makerepo]]'s - manual page. Nominally, this bare repository has a `post-commit` - hook that would change directory to the ikiwiki leaf node repository - below (the working directory for ikiwiki), do a _git pull_, and - refresh ikiwiki to regenerate the wiki with any new content. + manual page. + + Nominally, this bare repository has a `post-commit` hook that either + is or calls ikiwiki's git wrapper, which changes to the working + directory for ikiwiki, does a _git pull_, and refreshes ikiwiki to + regenerate the wiki with any new content. + + The configuration sections below show how to let the post-commit + hook be replaced by the ikiwiki git wrapper. * The second repository is a clone of the bare root repository, and has a working tree which is used as ikiwiki's srcdir for compiling the wiki. **Never** push to this repository. When running as a @@ -107,8 +112,8 @@ the srcdir to become group writable. (umask 022 will work.) ### Ikiwiki working directory * Configure a cgi wrapper as usual, but configure the git wrapper to - be written to the post-commit hook of the git clone being used by - the ikiwiki (clone 0 in the image). Set in the configuration: + be written to the post-commit hook of the bare root repository. Set + in the configuration: gitorigin_branch=> "origin", ## git post-commit wrapper @@ -118,16 +123,39 @@ the srcdir to become group writable. (umask 022 will work.) ### Working clones (Clone 1 .. N in the image) +These are repositories usually setup to avoid permission problems with +the working directory used by ikiwiki itself. They also represent the +most convenient way to add content to the wiki on a different machine +(that is, not the machine the wiki is published on) which is more +convenient. + +The use case for these clones is this: If you want to edit your wiki +on your development box, or on your laptop, you usually set up a clone +as above. But very often, you also want to test what the changes look +like, locally, before pushing it to the root repository and publishing +the wiki for the world to see. + +In order to do this, you should another setup file and setup a private +ikiwiki on the local machine (your laptop, for instance) where you do +most of your editing. You will also need to set up a webserver, and +install ikiwiki on this machine. Only when you are happy with any +changes do you push them to the root repository. + +Here are some things to be aware of when configuring ikiwiki on the +local machine: + * By default, ikiwiki pulls and pushes from `origin`. This is not - ideal for the working clones, since the user might go through - several iterations of a posting before pushing to the bare root of - the repository tree. In the configuration, set: + ideal for the working clones on the local machine, since you might + go through several iterations of a page before pushing to the bare + root of the repository tree and publishing it on your public + wiki. In the configuration, set: gitorigin_branch => "", ## git post-commit wrapper wrapper => "/working/dir/.git/hooks/post-commit", - Then just committing should refresh the ikiwiki on the local host. + Then just committing should refresh the private ikiwiki on the local + host. * You can optionally enable to the [[plugins/mirrorlist]] plugin, and configure it so that each page links to the corresponding page on the From 0702e3aabe37736c6c53f15bad7ff7d144bd867e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 Mar 2008 18:01:35 -0500 Subject: [PATCH 02/12] web commit by ManojSrivastava --- doc/rcs/git.mdwn | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/doc/rcs/git.mdwn b/doc/rcs/git.mdwn index cefa649ff..539c1e8b1 100644 --- a/doc/rcs/git.mdwn +++ b/doc/rcs/git.mdwn @@ -107,27 +107,13 @@ repository, should only be writable by the wiki's admin, and *not* by the group. Take care that ikiwiki uses a umask that does not cause files in the srcdir to become group writable. (umask 022 will work.) -## Configuration +## Configuration of working clone repositories -### Ikiwiki working directory - -* Configure a cgi wrapper as usual, but configure the git wrapper to - be written to the post-commit hook of the bare root repository. Set - in the configuration: - - gitorigin_branch=> "origin", - ## git post-commit wrapper - wrapper => "/path/to/bare/repo/.git/hooks/post-commit", - - - -### Working clones (Clone 1 .. N in the image) - -These are repositories usually setup to avoid permission problems with -the working directory used by ikiwiki itself. They also represent the -most convenient way to add content to the wiki on a different machine -(that is, not the machine the wiki is published on) which is more -convenient. +These are repositories (Clone 1 .. N in the image) usually setup to +avoid permission problems with the working directory used by ikiwiki +itself. They also represent the most convenient way to add content to +the wiki on a different machine (that is, not the machine the wiki is +published on) which is more convenient. The use case for these clones is this: If you want to edit your wiki on your development box, or on your laptop, you usually set up a clone From 5df638c445860e92bff44253002f14c7d47d71ba Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 Mar 2008 18:35:20 -0500 Subject: [PATCH 03/12] web commit by ManojSrivastava --- doc/rcs/git.mdwn | 94 +++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 57 deletions(-) diff --git a/doc/rcs/git.mdwn b/doc/rcs/git.mdwn index 539c1e8b1..74402e155 100644 --- a/doc/rcs/git.mdwn +++ b/doc/rcs/git.mdwn @@ -47,29 +47,26 @@ repositories: repositories will push to/pull from. It is a bare repository, since there are problems pushing to a repository that has a working directory. This is called _repository_ in [[ikiwiki-makerepo]]'s - manual page. + manual page. Nominally, this bare repository has a `post-commit` hook + that either is or calls ikiwiki's git wrapper, which changes to the + working directory for ikiwiki, does a _git pull_, and refreshes ikiwiki + to regenerate the wiki with any new content. The [[setup]] page describes + how to do this. - Nominally, this bare repository has a `post-commit` hook that either - is or calls ikiwiki's git wrapper, which changes to the working - directory for ikiwiki, does a _git pull_, and refreshes ikiwiki to - regenerate the wiki with any new content. - - The configuration sections below show how to let the post-commit - hook be replaced by the ikiwiki git wrapper. * The second repository is a clone of the bare root repository, and has a working tree which is used as ikiwiki's srcdir for compiling the wiki. **Never** push to this repository. When running as a [[cgi]], the changes are committed to this repository, and pushed to the master repository above. This is called _srcdir_ in [[ikiwiki-makerepo]]'s manual page. + * The other (third, fourth, fifth, sixth -- however many pleases you) repositories are also clones of the bare root repository above -- and these have a working directory for you to work on. Use either the `git` transport (if available), or `ssh`. These repositories may be on remote machines, your laptop, whereever you find convenient to hack on your wiki. you can commit local changes to the version on - the laptop, perhaps while offline. You can browse and edit the wiki - using a local web server. Any new content should be pushed to the + the laptop, perhaps while offline. Any new content should be pushed to the bare master repository when you are ready to publish it, and then the post-commit hook of the bare repository will ensure that the ikiwiki's source directory is updated, and the ikiwiki refreshed @@ -107,54 +104,37 @@ repository, should only be writable by the wiki's admin, and *not* by the group. Take care that ikiwiki uses a umask that does not cause files in the srcdir to become group writable. (umask 022 will work.) -## Configuration of working clone repositories +## Optionally using a local wiki to preview changes -These are repositories (Clone 1 .. N in the image) usually setup to -avoid permission problems with the working directory used by ikiwiki -itself. They also represent the most convenient way to add content to -the wiki on a different machine (that is, not the machine the wiki is -published on) which is more convenient. +When working on the "working clones" to add content to your wiki, +it is common (but optional) practice to preview your changes using a +private wiki on the local host before publishing the updates by +sending it to the root repository. If you do want to setup a private +wiki, you will have to have another setup file and and an ikiwiki +installation on your local machine. You will need all the packages +this implies -- a web server, git, ikiwiki, etc. However, there is a +_caveat_: by default, ikiwiki pulls and pushes from `origin`. This is +not ideal for the working clones on the local machine, since you might +go through several iterations of a page before pushing to the bare +root of the repository tree (and thus publishing it on your public wiki). +You do not want the action of refreshing the local wiki in order to +review your work to accidentally publish the +contents before you are ready. In order to prevent the git push that +is the normal behaviour of ikiwiki, set the configuration of the local wiki: -The use case for these clones is this: If you want to edit your wiki -on your development box, or on your laptop, you usually set up a clone -as above. But very often, you also want to test what the changes look -like, locally, before pushing it to the root repository and publishing -the wiki for the world to see. + gitorigin_branch => "", + ## git post-commit wrapper + wrapper => "/working/dir/.git/hooks/post-commit", -In order to do this, you should another setup file and setup a private -ikiwiki on the local machine (your laptop, for instance) where you do -most of your editing. You will also need to set up a webserver, and -install ikiwiki on this machine. Only when you are happy with any -changes do you push them to the root repository. +Then just committing should refresh the private ikiwiki on the local +host. Now just run `ikiwiki -setup localwiki.setup -getctime` and +you should be good to go. (You only need the slow `-getctime` option +the first time you run setup.) Use standard git commands to handle +pulling from and pushing to the server. **Note**: Currently, after +pulling changes from the bare root repository, you will need to +manually update the local wiki, with a command such as `ikiwiki +-setup localwiki.setup -refresh`. This is because git 1.5.4 doesn't +have a hook that is run locally after pulling changes. Newer +versions of git will have a `post-merge` hook that should work for +this purpose. -Here are some things to be aware of when configuring ikiwiki on the -local machine: - -* By default, ikiwiki pulls and pushes from `origin`. This is not - ideal for the working clones on the local machine, since you might - go through several iterations of a page before pushing to the bare - root of the repository tree and publishing it on your public - wiki. In the configuration, set: - - gitorigin_branch => "", - ## git post-commit wrapper - wrapper => "/working/dir/.git/hooks/post-commit", - - Then just committing should refresh the private ikiwiki on the local - host. - -* You can optionally enable to the [[plugins/mirrorlist]] plugin, - and configure it so that each page links to the corresponding page on the - server. - -Now just run `ikiwiki -setup wiki.setup -getctime` and you should be -good to go. (You only need the slow `-getctime` option the first time you -run setup.) - -Use standard git commands to handle pulling from and pushing to the server. - -Note: Currently, after pulling changes, you will need to manually update -the wiki, with a command such as `ikiwiki -setup wiki.setup -refresh`. This -is because git 1.5.4 doesn't have a hook that is run locally after pulling -changes. Newer versions of git will have a `post-merge` hook that should -work for this purpose. From 61205cd9952e3ad8be6aae6cc254440939b41448 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Mar 2008 02:23:05 -0500 Subject: [PATCH 04/12] web commit by bremner --- doc/todo/plugin.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/todo/plugin.mdwn b/doc/todo/plugin.mdwn index c502b08c9..901e8e55e 100644 --- a/doc/todo/plugin.mdwn +++ b/doc/todo/plugin.mdwn @@ -54,4 +54,7 @@ There is work in progress at -- [[DavidBremner]] * What about a translator plugin using source-highlight or some alternative to view a collection of source code. I have a collection -of e.g. java for students to look at. I'd like to e.g. update the tags in the java file, then rebuild the wiki. +of e.g. java for students to look at. I'd like to e.g. update the tags in the java file, then rebuild the wiki. A first hack, can be found in +[my wiki](http://www.cs.unb.ca/~bremner/wiki/software/java.pm) +Among many possible improvements would be generalizing to handle other languages. I have to play some more. +-- [[DavidBremner]] From 445e460b00c1c39a340856028fdb82f8182d568c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Mar 2008 02:58:06 -0500 Subject: [PATCH 05/12] web commit by bremner: me too request for the tag generating code --- doc/plugins/tag/discussion.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/plugins/tag/discussion.mdwn b/doc/plugins/tag/discussion.mdwn index 61f375b80..87edf2ab8 100644 --- a/doc/plugins/tag/discussion.mdwn +++ b/doc/plugins/tag/discussion.mdwn @@ -16,4 +16,7 @@ Thanks. That works fine. @Ben: could you publish the code for that? ---David Riebenbauer \ No newline at end of file +--David Riebenbauer + +-- AOLMODE=true echo "I too would really like this feature, which would make cgi free life much +better" --[[DavidBremner]] From 0e071ba9af61e40fde1a953f02e0d4ebc13a9818 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Mar 2008 03:19:32 -0500 Subject: [PATCH 06/12] web commit by bremner: added work in progress sourcehighlight plugin --- doc/plugins/contrib/sourcehighlight.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/plugins/contrib/sourcehighlight.mdwn diff --git a/doc/plugins/contrib/sourcehighlight.mdwn b/doc/plugins/contrib/sourcehighlight.mdwn new file mode 100644 index 000000000..99896971b --- /dev/null +++ b/doc/plugins/contrib/sourcehighlight.mdwn @@ -0,0 +1,10 @@ +I noticed several places in the wiki talking about similar ideas, so I decided to put a page here to point to what I am working on. + +I have copied otl.pm and am wrapping source-highlight (why this instead of vim highlight, I dunno, I must be a real emacs guy). You can find more or less the latest +version on +[my wiki](http://www.cs.unb.ca/~bremner/wiki/software/sourcehighlight.pm) + +In the tradition of publish early and often, this just supports java +at the moment. I will add more languages soon. +You can (and I will) add more languages by cutting and pasting the hook line. + From edadac1951a6732097075b95a65a85a779292aa9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Mar 2008 03:25:29 -0500 Subject: [PATCH 07/12] web commit by bremner: added link to sourcehighlight plugin --- .../automatic_use_of_syntax_plugin_on_source_code_files.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files.mdwn b/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files.mdwn index c39261e82..00108918c 100644 --- a/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files.mdwn +++ b/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files.mdwn @@ -8,3 +8,5 @@ as the type argument. Together with the ability to have [[wiki-formatted_comments|wiki-formatted_comments_with_syntax_plugin]], this would allow the use of ikiwiki for [[wikipedia literate programming]]. + +* I have started something along these lines see [[plugins/contrib/sourcehighlight]]. For some reason I started with source-highlight [[DavidBremner]] From 890863679fea395172c247877579d391563c3b5e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Mar 2008 03:40:02 -0500 Subject: [PATCH 08/12] web commit by bremner --- doc/plugins/contrib/sourcehighlight.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/plugins/contrib/sourcehighlight.mdwn b/doc/plugins/contrib/sourcehighlight.mdwn index 99896971b..b34f41b3c 100644 --- a/doc/plugins/contrib/sourcehighlight.mdwn +++ b/doc/plugins/contrib/sourcehighlight.mdwn @@ -6,5 +6,8 @@ version on In the tradition of publish early and often, this just supports java at the moment. I will add more languages soon. -You can (and I will) add more languages by cutting and pasting the hook line. +You can add more languages by cutting and pasting the hook line; I want to add a configuration option to allow the user to specify. + +One outstanding problem is that I would like to have a link to the raw source; I'm not quite sure how to manage this at them moment. + From 2404ce0ddd3482f24d62ca1d7ef948ae6db0c6a0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Mar 2008 04:51:44 -0500 Subject: [PATCH 09/12] web commit by bremner: new version, language configurable, sortof --- doc/plugins/contrib/sourcehighlight.mdwn | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/plugins/contrib/sourcehighlight.mdwn b/doc/plugins/contrib/sourcehighlight.mdwn index b34f41b3c..8f302b7f6 100644 --- a/doc/plugins/contrib/sourcehighlight.mdwn +++ b/doc/plugins/contrib/sourcehighlight.mdwn @@ -4,10 +4,13 @@ I have copied otl.pm and am wrapping source-highlight (why this instead of vim h version on [my wiki](http://www.cs.unb.ca/~bremner/wiki/software/sourcehighlight.pm) -In the tradition of publish early and often, this just supports java -at the moment. I will add more languages soon. -You can add more languages by cutting and pasting the hook line; I want to add a configuration option to allow the user to specify. +you must specify a highlight_lang=>"foo,bar" in your setup file. +where foo and bar are the (source-supported) languages you want to +highlight +# Issues -One outstanding problem is that I would like to have a link to the raw source; I'm not quite sure how to manage this at them moment. +- I would like to have a link to the raw source; I'm not quite sure how to manage this at them moment. +- the common case of foo.c and foo.h breaks +because they both generate page working/dir/foo. Is there some way to change the default output name? From da9bf8df555465ab6ec79495239b78995e47939f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Mar 2008 07:52:36 -0500 Subject: [PATCH 10/12] web commit by bremner: answer one of my own questions --- doc/plugins/contrib/sourcehighlight.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/plugins/contrib/sourcehighlight.mdwn b/doc/plugins/contrib/sourcehighlight.mdwn index 8f302b7f6..f5628052d 100644 --- a/doc/plugins/contrib/sourcehighlight.mdwn +++ b/doc/plugins/contrib/sourcehighlight.mdwn @@ -12,5 +12,5 @@ highlight - I would like to have a link to the raw source; I'm not quite sure how to manage this at them moment. - the common case of foo.c and foo.h breaks -because they both generate page working/dir/foo. Is there some way to change the default output name? - +because they both generate page working/dir/foo. +It looks to me like ikiwiki is hardcoded to strip the extension in `pagename()` (IkiWiki.pm). From 8f44d519b02cb11eca9e2f825c430f618171abd8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Mar 2008 08:11:41 -0500 Subject: [PATCH 11/12] web commit by http://madduck.net/: add debpkgsid to link to packages.d.o/sid directly --- doc/shortcuts.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/shortcuts.mdwn b/doc/shortcuts.mdwn index 50f1e624e..764ae6027 100644 --- a/doc/shortcuts.mdwn +++ b/doc/shortcuts.mdwn @@ -20,6 +20,7 @@ This page controls what shortcut links the wiki supports. * [[!shortcut name=debbug url="http://bugs.debian.org/%s" desc="bug #%s"]] * [[!shortcut name=deblist url="http://lists.debian.org/debian-%s" desc="debian-%s@lists.debian.org"]] * [[!shortcut name=debpkg url="http://packages.debian.org/%s"]] +* [[!shortcut name=debpkgsid url="http://packages.debian.org/sid/%s"]] * [[!shortcut name=debpts url="http://packages.qa.debian.org/%s"]] * [[!shortcut name=debmsg url="http://lists.debian.org/msgid-search/%s"]] * [[!shortcut name=debrt url="https://rt.debian.org/Ticket/Display.html?id=%s"]] From 91ea6629433fb4e21db4b64ef47a8990e80a2533 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Mar 2008 08:14:44 -0500 Subject: [PATCH 12/12] web commit by bremner: added pointer to relevant discussion --- doc/plugins/contrib/sourcehighlight.mdwn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/plugins/contrib/sourcehighlight.mdwn b/doc/plugins/contrib/sourcehighlight.mdwn index f5628052d..b48fd1a16 100644 --- a/doc/plugins/contrib/sourcehighlight.mdwn +++ b/doc/plugins/contrib/sourcehighlight.mdwn @@ -9,8 +9,13 @@ where foo and bar are the (source-supported) languages you want to highlight # Issues -- I would like to have a link to the raw source; I'm not quite sure how to manage this at them moment. +- I would like to have a link to the raw source; using will_render() and then copying the file +may work. +The discussion in [[plugins/contrib/texinfo]] seems relevant. - the common case of foo.c and foo.h breaks because they both generate page working/dir/foo. It looks to me like ikiwiki is hardcoded to strip the extension in `pagename()` (IkiWiki.pm). +This problem with sourcehighlight needs to be fixed before it is very useful. + +[[DavidBremner]]