After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 168030 - Patch for phpwebnotes support for tutorial
Patch for phpwebnotes support for tutorial
Status: RESOLVED DUPLICATE of bug 614985
Product: gtkmm
Classification: Bindings
Component: reference documentation
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2005-02-21 10:13 UTC by Roel Vanhout
Modified: 2011-02-21 12:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to docs/tutorial/makefile.am (1.21 KB, patch)
2005-02-21 10:14 UTC, Roel Vanhout
none Details | Review
The docbook customization layer needed to insert the phpwebnotes code (1.30 KB, text/plain)
2005-02-21 10:14 UTC, Roel Vanhout
  Details
New version of the customization layer (1.35 KB, text/plain)
2005-02-22 10:30 UTC, Roel Vanhout
  Details
Semantically more correct stylesheet (1.34 KB, text/plain)
2005-02-22 12:36 UTC, Roel Vanhout
  Details
Add id's to all sect's that need it (15.09 KB, patch)
2005-02-23 14:19 UTC, Roel Vanhout
none Details | Review

Description Roel Vanhout 2005-02-21 10:13:28 UTC
phpwebnotes is an application to allow users to enter comments on webpages,
similar to the system that the php documentation uses (ie
http://www.php.net/manual/en/features.remote-files.php). To have
docbook-generated documentation use this system, a couple of options have to be
configured in a customization layer that will insert the php code necessary. The
attached xsl file is such a customization layer; the patch adds support to the
docs/tutorial/makefile.am to build that documentation. This way it's easy to
build both un-annotated documentation for distribution with the tarball and
annotated documentation for the website.

Websites that want to display annotated documentation will need to be hosted on
a webserver with php support and access to a mysql database.
Start with downloading phpwebnotes from http://webnotes.futureware.biz/. Untar
the release tarball to the directory where the index.html file of the tutorial
is (actually the index.php file, because the xsl will make xsltproc generate
.php files instead of .html files). (It is also possible to install phpwebnotes
somewhere else, like in the docs/ subdirectory, if you do that you'll have to
keep that location in account when reading the rest of this procedure) There is
an INSTALL file in the doc/ subdirectory that will tell you how to install
phpwebnotes further; basically, you have to make a mysql database and populate
it with the script in the sql/ directory, create a file called
'custom_config_inc.php' in the core/ directory and set the database host, name
and username/password and the directory where phpwebnotes is installed, relative
to the docroot (for example I have it set to '/html/phpwebnotes/' because my
docroot is the gtkmm2\docs\tutorial\html\ directory).

Now if you generate the annotated version of the tutorial (make html/index.php I
think) and navigate to the index.php file in your browser, you'll see that you
can enter new annotations there. You can also login (the default
username/password is 'administrator'/'root') and then you can delete and approve
annotations. If you want annotations to be approved by default (so not needing
approval basically), you can set that in the custom_config_inc.php file.

Please note that the makefile.am is untested as I don't have a make environment
on this (Windows) machine. Also I never really understood automake but I think
the patch should work. If it doesn't, the command line in it is clear and should
allow anyone who does know how automake work to easily correct any mistakes.
Comment 1 Roel Vanhout 2005-02-21 10:14:14 UTC
Created attachment 37740 [details] [review]
Patch to docs/tutorial/makefile.am
Comment 2 Roel Vanhout 2005-02-21 10:14:49 UTC
Created attachment 37741 [details]
The docbook customization layer needed to insert the phpwebnotes code
Comment 3 Murray Cumming 2005-02-21 16:06:55 UTC
As you can see here:
http://www.murrayc.com/temp/gtkmm_book_with_comments/html/ch01s02.php#id2637067

it's generating &lt; and &gt; instead of < and >, so the php code is just
displayed as plain text instead of being processed. Do you have an idea to fix that?
Comment 4 Roel Vanhout 2005-02-22 09:22:12 UTC
Apparantly I was using an old version of xsltproc. After upgrading I have the
same problem. I'll subscribe to the libxml mailing list and see what I can find
out. I've had a similar problem with xsltproc a year or 2 ago; my solution then
was to switch to Saxon but that's not included in most Linux distributions so
that's not really an option in this case. I'll post here as soon as I know.
Comment 5 Murray Cumming 2005-02-22 09:38:44 UTC
I'm sure that xsltproc does the right thing.
Comment 6 Daniel Veillard 2005-02-22 10:14:39 UTC
yes. Not a bug, here is my answer from the list:

--------------------
  CDATA does not exist in the XPAth data model. I.e. XSLT does not see
CDATA in any input or generated tree, only text nodes with the associated
text value. What you're trying to do is not possible in XSLT.
  The only thing you can do:
    - force some element content to be CDATA
      http://www.w3.org/TR/xslt#section-XML-Output-Method
      using cdata-section-elements
    - disable escaping for some specific text nodes
      http://www.w3.org/TR/xslt#disable-output-escaping
-------------

Daniel
Comment 7 Roel Vanhout 2005-02-22 10:30:01 UTC
Ok thanks a lot Daniel. I have attached a new version of the stylesheet that
does work.
Comment 8 Roel Vanhout 2005-02-22 10:30:50 UTC
Created attachment 37769 [details]
New version of the customization layer
Comment 9 Roel Vanhout 2005-02-22 12:36:48 UTC
Created attachment 37773 [details]
Semantically more correct stylesheet

I've been convinced that there is a better way to write the stylesheet
(http://mail.gnome.org/archives/xslt/2005-February/msg00043.html). So the
effect of this one should be the same, but it's 'better' xslt.
Comment 10 Murray Cumming 2005-02-23 12:48:39 UTC
Excellent. That works. Here's an example:
http://www.murrayc.com/temp/gtkmm_book_with_comments/html/ch13s02.php

(I'd like to use named sections anyway)
Comment 11 Roel Vanhout 2005-02-23 14:18:25 UTC
Aha good. Here's a patch that adds id's to all sect's that need it. I tried to
keep with the naming scheme, preferring lowercase over uppercase where applicable.
Comment 12 Roel Vanhout 2005-02-23 14:19:08 UTC
Created attachment 37835 [details] [review]
Add id's to all sect's that need it
Comment 13 Murray Cumming 2005-02-28 10:14:33 UTC
Thanks. Committed to HEAD. Please do remember to patch the ChangeLog in future.
Comment 14 Thierry Moisan 2005-06-18 13:13:17 UTC
I've looked in the gnome CVS and I didn't see it commited.
Comment 15 Murray Cumming 2005-08-02 19:12:07 UTC
Sorry, I haven't completely forgotten.
Comment 16 Murray Cumming 2006-07-25 10:12:57 UTC
This is currently waiting (again) on the results of the library.gnome.org Summer Of Code project. If that works then I would prefer to use it.
Comment 17 Murray Cumming 2011-02-11 15:45:22 UTC
All gtkmm documentation is now on library.gnome.org, so any commenting ability would have to be added to that.
Comment 18 Murray Cumming 2011-02-21 12:06:57 UTC

*** This bug has been marked as a duplicate of bug 614985 ***