Merge branch 'master' of ssh://git.kitenet.net/srv/git/ikiwiki.info
commit
0e7896690b
|
@ -0,0 +1,21 @@
|
||||||
|
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)
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
- 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]]
|
|
@ -16,4 +16,7 @@ Thanks. That works fine.
|
||||||
|
|
||||||
@Ben: could you publish the code for that?
|
@Ben: could you publish the code for that?
|
||||||
|
|
||||||
--David Riebenbauer <davrieb@htu.tugraz.at>
|
--David Riebenbauer <davrieb@htu.tugraz.at>
|
||||||
|
|
||||||
|
-- AOLMODE=true echo "I too would really like this feature, which would make cgi free life much
|
||||||
|
better" --[[DavidBremner]]
|
||||||
|
|
|
@ -47,24 +47,26 @@ repositories:
|
||||||
repositories will push to/pull from. It is a bare repository, since
|
repositories will push to/pull from. It is a bare repository, since
|
||||||
there are problems pushing to a repository that has a working
|
there are problems pushing to a repository that has a working
|
||||||
directory. This is called _repository_ in [[ikiwiki-makerepo]]'s
|
directory. This is called _repository_ in [[ikiwiki-makerepo]]'s
|
||||||
manual page. Nominally, this bare repository has a `post-commit`
|
manual page. Nominally, this bare repository has a `post-commit` hook
|
||||||
hook that would change directory to the ikiwiki leaf node repository
|
that either is or calls ikiwiki's git wrapper, which changes to the
|
||||||
below (the working directory for ikiwiki), do a _git pull_, and
|
working directory for ikiwiki, does a _git pull_, and refreshes ikiwiki
|
||||||
refresh ikiwiki to regenerate the wiki with any new content.
|
to regenerate the wiki with any new content. The [[setup]] page describes
|
||||||
|
how to do this.
|
||||||
|
|
||||||
* The second repository is a clone of the bare root repository, and
|
* 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
|
has a working tree which is used as ikiwiki's srcdir for compiling
|
||||||
the wiki. **Never** push to this repository. When running as a
|
the wiki. **Never** push to this repository. When running as a
|
||||||
[[cgi]], the changes are committed to this repository, and pushed to
|
[[cgi]], the changes are committed to this repository, and pushed to
|
||||||
the master repository above. This is called _srcdir_ in
|
the master repository above. This is called _srcdir_ in
|
||||||
[[ikiwiki-makerepo]]'s manual page.
|
[[ikiwiki-makerepo]]'s manual page.
|
||||||
|
|
||||||
* The other (third, fourth, fifth, sixth -- however many pleases you)
|
* The other (third, fourth, fifth, sixth -- however many pleases you)
|
||||||
repositories are also clones of the bare root repository above --
|
repositories are also clones of the bare root repository above --
|
||||||
and these have a working directory for you to work on. Use either
|
and these have a working directory for you to work on. Use either
|
||||||
the `git` transport (if available), or `ssh`. These repositories may
|
the `git` transport (if available), or `ssh`. These repositories may
|
||||||
be on remote machines, your laptop, whereever you find convenient to
|
be on remote machines, your laptop, whereever you find convenient to
|
||||||
hack on your wiki. you can commit local changes to the version on
|
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
|
the laptop, perhaps while offline. Any new content should be pushed to the
|
||||||
using a local web server. Any new content should be pushed to the
|
|
||||||
bare master repository when you are ready to publish it, and then
|
bare master repository when you are ready to publish it, and then
|
||||||
the post-commit hook of the bare repository will ensure that the
|
the post-commit hook of the bare repository will ensure that the
|
||||||
ikiwiki's source directory is updated, and the ikiwiki refreshed
|
ikiwiki's source directory is updated, and the ikiwiki refreshed
|
||||||
|
@ -102,45 +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
|
group. Take care that ikiwiki uses a umask that does not cause files in
|
||||||
the srcdir to become group writable. (umask 022 will work.)
|
the srcdir to become group writable. (umask 022 will work.)
|
||||||
|
|
||||||
## Configuration
|
## Optionally using a local wiki to preview changes
|
||||||
|
|
||||||
### Ikiwiki working directory
|
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:
|
||||||
|
|
||||||
* Configure a cgi wrapper as usual, but configure the git wrapper to
|
gitorigin_branch => "",
|
||||||
be written to the post-commit hook of the git clone being used by
|
## git post-commit wrapper
|
||||||
the ikiwiki (clone 0 in the image). Set in the configuration:
|
wrapper => "/working/dir/.git/hooks/post-commit",
|
||||||
|
|
||||||
gitorigin_branch=> "origin",
|
Then just committing should refresh the private ikiwiki on the local
|
||||||
## git post-commit wrapper
|
host. Now just run `ikiwiki -setup localwiki.setup -getctime` and
|
||||||
wrapper => "/path/to/bare/repo/.git/hooks/post-commit",
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Working clones (Clone 1 .. N in the image)
|
|
||||||
|
|
||||||
* 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:
|
|
||||||
|
|
||||||
gitorigin_branch => "",
|
|
||||||
## git post-commit wrapper
|
|
||||||
wrapper => "/working/dir/.git/hooks/post-commit",
|
|
||||||
|
|
||||||
Then just committing should refresh the 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.
|
|
||||||
|
|
|
@ -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=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=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=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=debpts url="http://packages.qa.debian.org/%s"]]
|
||||||
* [[!shortcut name=debmsg url="http://lists.debian.org/msgid-search/%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"]]
|
* [[!shortcut name=debrt url="https://rt.debian.org/Ticket/Display.html?id=%s"]]
|
||||||
|
|
|
@ -8,3 +8,5 @@ as the type argument.
|
||||||
Together with the ability to have
|
Together with the ability to have
|
||||||
[[wiki-formatted_comments|wiki-formatted_comments_with_syntax_plugin]],
|
[[wiki-formatted_comments|wiki-formatted_comments_with_syntax_plugin]],
|
||||||
this would allow the use of ikiwiki for [[wikipedia literate programming]].
|
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]]
|
||||||
|
|
|
@ -54,4 +54,7 @@ There is work in progress at
|
||||||
-- [[DavidBremner]]
|
-- [[DavidBremner]]
|
||||||
|
|
||||||
* What about a translator plugin using source-highlight or some alternative to view a collection of source code. I have a collection
|
* 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]]
|
||||||
|
|
Loading…
Reference in New Issue