Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 64052 - Printable documents not easy to get or not really printable.
Summary: Printable documents not easy to get or not really printable.
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Infrastructure
URL:
Whiteboard:
Keywords:
: 64051 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-14 14:08 UTC by Xavier Neys (RETIRED)
Modified: 2005-03-27 09:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to several files to implement suggested improvement (print.patch,8.49 KB, patch)
2004-09-14 14:09 UTC, Xavier Neys (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Neys (RETIRED) gentoo-dev 2004-09-14 14:08:36 UTC
Up to now, users had to append ?style=printable to URLs to get a printable version of documents. This not user-friendly. Handbook pages show a "print" item in the navbar, why should they be an exception?
Users have no way of knowing whether a doc is printable (only <guide> and <book> are), it is clumsy and some printable docs do not even yield a printable version even with ?style=printable because guide.xsl has been hardcoded into the .xml

Dr. X has the cure ;-)

1) Making All Printable Docs Really Printable

Testing style==printable before calling either guide.xsl or guide-print.xsl is pointless. guide.xsl needs to test it again anyway and any .xml explicitely using guide.xsl cannot become printable. All we need is 1 (one) test in guide.xsl to get rid of guide-print.xsl. handbook.xsl can be made simpler as well because it does not need to test the style at all.
I have made guide-print.xsl trivial, it has to be available until the AxKit config has been updated to not reference it anymore.

2) Giving Users Easy Access to Printable Versions

To let users get a printable versions of a doc, the friendliest way is IMHO to put a "Print" button on printable pages. See http://dev.gentoo.org/~neysx/tests/gentoolkit.html for an example.
All <guide> and <book> are printable, but to display the link, the stylesheet needs the link attribute in <guide> or <book>.
I suggest making the link attribute #REQUIRED instead of #IMPLIED in the DTDs.
_ALL_ books already have the link attribute and it should have been made compulsory anyway because the navbar already relies on it.
The GWN and very few <guide> docs are missing it. I can fix most, not the GWN though.
The GWN guys would need to specify the link attribute in upcoming newsletters, old ones can be left as is (no link attribute==no print button==no change from current situation) or can be updated if the GWN guys want to.
The few other docs that would need an attribute link on their next commit are:
./proj/en/base/sparc/obpreference.xml:<guide>
./proj/en/desktop/research/manifest.xml:<guide>
./proj/en/desktop/research/config_tools_reqs.xml:<guide>
./proj/en/desktop/research/meeting_reports.xml:<guide>
./proj/en/desktop/science/hpc_annonce.xml:<guide>
./proj/en/releng/status/status_20040607.xml:<guide>

This not asking too much IMHO.
Comment 1 Xavier Neys (RETIRED) gentoo-dev 2004-09-14 14:09:50 UTC
Created attachment 39607 [details, diff]
Patch to several files to implement suggested improvement

Please review. Thanks.
Comment 2 Xavier Neys (RETIRED) gentoo-dev 2004-09-14 14:12:26 UTC
Suggested change to the AxKit config.
I am neither an apache nor an AxKit gutu, this is the one I used:

<IfDefine PERL>
  LoadModule perl_module extramodules/libperl.so
  PerlModule AxKit
  SetHandler perl-script
  PerlHandler Apache::AxKit::StyleChooser::PathInfo AxKit
  AddHandler axkit .xml .xsp
  AxAddXSPTaglib AxKit::XSP::Util
  AxAddXSPTaglib AxKit::XSP::IfParam
  AxAddXSPTaglib AxKit::XSP::Param
  AxAddStyleMap application/x-xsp Apache::AxKit::Language::XSP
  AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSLT
  <Files *.xml>
    AxAddProcessor text/xsl /xsl/guide.xsl
  </Files>
</IfDefine>


What's important:
- not reference guide-print.xsl anymore so that it can be removed
- use guide.xsl
Comment 3 Xavier Neys (RETIRED) gentoo-dev 2004-09-14 14:14:16 UTC
*** Bug 64051 has been marked as a duplicate of this bug. ***
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2004-09-25 05:08:08 UTC
The changes have been committed.
Comment 5 Xavier Neys (RETIRED) gentoo-dev 2004-09-27 03:22:56 UTC
Is axkit still using guide-print.xsl?
We'd like to get rid of this one.
Kurt?
Comment 6 Kurt Lieber (RETIRED) gentoo-dev 2004-09-27 11:37:42 UTC
I have no idea whether or not AxKit uses guide-print.xsl.  Also, you should not depend on any AxKit-specific features as we will be replacing it at some point (hopefully sooner, rather than later)  If we have to chose between losing features that we use (and even rely on) today vs. finding a suitable, if less feature-rich replacement for AxKit, we will definitely choose the later.

--kurt
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2004-09-27 14:01:53 UTC
AxKit doesn't "depend" on it, our configuration does (or at least did when I got the httpd.conf excerpt from you). Neysx' changes don't require the use of an additional XSL file for the printable version which is an improvement over the old style (since it makes the search for a new solution easier).

But you do have to alter the AxKit configuration as stated in comment #2. What I did was comment out the printable stuff:

"""
  <AxStyleName "#default">
    AxAddProcessor text/xsl /xsl/guide.xsl
  </AxStyleName>
  <AxStyleName printable>
    AxAddProcessor text/xsl /xsl/guide-print.xsl
  </AxStyleName>
"""
became
"""
  <AxStyleName "#default">
    AxAddProcessor text/xsl /xsl/guide.xsl
  </AxStyleName>
#  <AxStyleName printable>
#    AxAddProcessor text/xsl /xsl/guide-print.xsl
#  </AxStyleName>
"""

Everything still works, so this particular AxKit configuration can probably be removed. I haven't checked everything (especially those pages working on the /dyn generated ones) since I don't have those scripts.
Comment 8 Xavier Neys (RETIRED) gentoo-dev 2004-09-28 03:36:50 UTC
As Sven explained, we do not rely on axkit's features, well, not anymore. My recent changes help make things simpler and the move to another engine has become simpler as well.

FYI, AxKit looks at the requested URL and calls different stylesheets based on a style variable. The current setup is to default to guide.xsl and call guide-print.xsl whenever style=printable appears in the URL.

This is not required anymore. Sven's sample config keeps the style functionality but uses guide.xsl only. My sample in #2 completely removes the functionality. It works for me on docs, GWN and project pages.

BTW, what's the status on the new engine? Are you still looking for a solution?
I thought you'd use tr4nsf0rm. If not, I could cook you a simple ruby cgi script that processes the .xml through xsltproc, even adding caching would be trivial. Just let me know if you're interested.
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2004-10-10 07:49:04 UTC
Reassigning to klieber (you really need an infrastructure@gentoo.org alias for bugzilla :). Check out if parts of the site still rely on guide-print.xsl. If not, it can be removed. 
Comment 10 Xavier Neys (RETIRED) gentoo-dev 2005-01-31 09:43:38 UTC
guide-print.xsl has been removed as current AxKit config does not use it.

This can be closed IMHO
Comment 11 Xavier Neys (RETIRED) gentoo-dev 2005-03-27 09:28:20 UTC
No need to keep this one open any longer.